Default task containers join the daemon's network instead of a sandbox bridge #1867
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1867
Reference in new issue
Block a user
Problem
Pool.Acquireputs a default-path task container on the daemon's own Docker network, or the configured one. That network is not internal, so the container can reach NATS, the other compose services, the host bridge and the internet directly. Model calls are routed through the egress proxy by environment variables, but nothing stops a process from ignoring them. Kit tasks already run on an internal bridge with no host address, where the egress relay is the only reachable endpoint.Wanted
Every task container runs on its own internal sandbox bridge and reaches the egress proxy, NATS and the State Store only through the relay. Which code survives depends on #1865.
Done when
Context I missed when filing: the external-agent-harness PRD (Egress section) keeps image profiles off the proxied path on purpose, because workflows such as the network investigator need raw DNS, ICMP and arbitrary TCP. So the fix is not "put every container on the sandbox bridge". It is to enforce the identity's network grants for image profiles, which today are not enforced at the container: the container joins the daemon's network, which also reaches NATS, the State Store and sibling services. Scope this issue to that gap.
Generated by Claude Code
Scope after #1877 (Kit deleted): default tasks move onto the internal sandbox network behind the egress relay,
containerEnvpoints at the relay ports, and the in-processstateStoreRelayis deleted (was #1870). Image-profile workflows that need raw network access get it as an explicit per-profile grant rather than by default.Generated by Claude Code
Fixed in
e7d3ed72. Each task container gets its own internal bridge (no host address), shared only with the egress relay. Boot sweeps leftover sandbox networks and starts the relay, which forwards :3128 to the model proxy, :4222 to NATS and :50051 to the State Store (a loopback State Store goes to the host gateway). Workers get the relay addresses via WorkerEnv, and model calls use archie-egress:3128. The network is removed with the task. The per-task State Store relay on the host bridge is gone.Verified: task check passes. A fake-Engine test asserts the container attaches only to its sandbox network and that the network is removed on release and after a failed start; it fails if either is reverted. A table test covers the loopback State Store rewrite.
Not yet verified: a live run with Docker. Done-when still needs: a task container cannot connect to anything except the relay's three ports, and model calls work through the proxy.
Follow-ups: #1967 (allowlisted egress for remote MCP and package registries), #1968 (per-profile network grant), #1969 (containers.network now needs a restart).
Already fixed by
e7d3ed72e: each task container joins its own internal network (internal/infrastructure/egress/networks.go:128, Internal: true), and TestTaskContainerRunsOnItsOwnSandboxNetwork (internal/container/sandbox_test.go:43) guards that attachment.