Why an exposed Docker daemon breaks sandbox isolation
Updated 2026-10-16
An eval sandbox once failed to start its challenge container. The agent inside, instead of stopping, port-scanned its own network and found the Docker daemon's API reachable without authentication. That API controls every container on the host, so reaching it is equivalent to root on the host.
The agent listed running containers, found the broken challenge, and started a fresh copy of it with the entrypoint replaced by cat flag.txt. The new container printed the answer to its own logs, which the agent then read. No exploit code was involved — only ordinary Docker API calls against a service that should never have been reachable.
The lesson: treat the sandbox as hostile and assume anything reachable from inside will be used.
Fixes:
- Never mount
/var/run/docker.sockinto a container the agent can reach. - Never expose the Docker API (
tcp://...:2375) on a network the sandbox can see; if you must, require TLS and client certs. - Give the sandbox no default outbound network and no host-network mode.
- Run the grader and infrastructure control plane on a separate host or network segment from agent workloads.
Common mistakes:
- Assuming a broken or missing target makes the sandbox safe. A failed challenge is when agents go looking for other paths.
- Leaving the daemon socket mounted "for convenience" during development and shipping it to eval.