Seven ways out of a coding agent’s sandbox, without breaking the sandbox
Pillar Security published seven sandbox escapes across four coding agents in one week. None broke the sandbox itself. Each worked because the agent wrote something that an unsandboxed component, in several cases the Docker daemon, later read or ran.
By the NoFly team
docker run --privileged -v /:/host alpine …- Agent
- Coding agent · sandboxed
- Came from
- A task that reached for the local Docker daemon
- Rule
- Container run reaches the host
- Why
- The run is privileged and mounts the host root, which hands the whole machine to the container.
What happened
In its Week of Sandbox Escapes, starting 20 July 2026, Pillar Security described seven boundary bypasses in Cursor, OpenAI Codex, Gemini CLI and Google Antigravity, and grouped them into four patterns: sandboxes that miss some operating-system behavior, workspace files that run as configuration, command allow-lists that trust a program’s name without reading its arguments, and privileged local daemons reachable from inside the sandbox.
The Docker socket was the clearest of these. The socket is not just a file, it is a control surface: whatever can talk to it can tell the daemon to start a privileged container, mount the host filesystem, and inherit the daemon’s own trust. An agent confined to a sandbox could reach the socket and, through it, the host.
Patch responses varied. Cursor fixed its workspace-controlled hook flaw (CVE-2026-48124) in 3.0.0, and OpenAI fixed a Codex CLI issue and paid a bounty. Google downgraded its Antigravity findings, and both Google and OpenAI declined to treat their Docker-socket exposure as needing a fix. The Cloud Security Alliance tied parallel issues in GitHub Copilot and Claude Code to the same root cause.
- 01
The agent runs a command the sandbox allows.
- 02
The command reaches the Docker daemon socket, or writes a file a trusted tool runs.
- 03
The daemon starts a privileged container with the host mounted.
- 04
Code runs on the host, outside everything the sandbox controlled.
Why it worked
Probable cause
The sandbox contained the agent’s own process, but a privileged daemon and several host tools sat outside it and trusted whatever reached them.
How NoFly stops it
Protect
A request to the container daemon is graded on what it does, whichever way it is made: a state-changing call to the daemon socket, a container run that mounts the host or runs privileged, the same shape reached through docker compose, or the daemon aimed over TCP with DOCKER_HOST. A command allow-list that trusts a program name is not enough, so the arguments are read.
Protect
A write whose target is a container or dev-container definition is screened before docker compose up starts it, and a write that drops a developer-tool executable into the working directory, where Windows resolves it ahead of the system path, is held.
Attack
Attack simulation fires these same escape shapes at your own agents on a schedule, and a sandbox is graded on what actually crossed it, not on the fact that it is there.
What to do this week
- Do not expose the Docker socket, or a TCP daemon, to the environment an agent runs in.
- Grade what crosses a sandbox, rather than trusting that one is in place.
- Treat workspace configuration files as code that can run, and review changes to them.
- Read the arguments of allow-listed commands, not just the program name.
More from the blog.
Find out what your AI is allowed to do today.
Book a call and we will map your agents, MCP servers and keys with you, or start on one laptop with the free scan.