
In 2026, several stories said an AI escaped its sandbox. In most of them, the agent walked through a door someone had left open. This post reads six of these incidents and explains what a sandbox actually controls.
Sandboxing has become the default answer to securing AI agents. But what exactly is a sandbox? The term covers everything from network restrictions and filesystem boundaries to process isolation and credential protection. It can mean a hardened microVM, a thin OS policy around a single command, or a filter on the agent's outgoing network traffic. These are fundamentally different security controls, yet they're often discussed as if they provide the same protection.
TL;DR
- Many 2026 headlines about an AI "escaping its sandbox" describe something else: an internet connection left open, a name lookup nobody filtered, a bug in a service the agent was allowed to use. The word "escape" says little about what actually failed.
- A sandbox controls what the agent can reach (files, network, credentials), and how isolated its code runs, from a microVM down to an interpreter that only runs the model's code.
- Credentials need their own control to keep real keys away from the agent. Some sandboxes include one, others leave it to you.
- Scope matters as much as strength: which part of the agent is sandboxed? The whole agent, its tools and code, or only the code it writes?
Revisiting Sandbox escapes in the media
2026 gave us several "AI escapes sandbox" headlines. "Escape" suggests the agent broke through a wall, and that is how most readers take it. Looking closer, most of these stories describe something else: internet access left open by mistake, a DNS resolver nobody filtered, or an allowed service with a bug in it. A broken wall calls for a stronger isolation type, while an open door only needs a tighter configuration.
Incident | Headline | Area | What actually happened |
|---|---|---|---|
"OpenAI Flags AI Agent's DNS Escape in 15 Minutes" (Tech Insider) | Network | Side channel the filter missed | |
"Anthropic says its own AI models breached three companies during security tests" (TechCrunch) | Network, then the target's credentials | No wall: internet open by mistake | |
Same TechCrunch story | Network | Went out through machines that had internet | |
"Meta AI Model Accessed Internet, Hacked Outside Firm in Testing" (Bloomberg) | Network | No wall: internet open by mistake | |
"OpenAI says its models escaped a sandbox and breached Hugging Face" (TechRadar) | Network, execution, credentials | A bug in the one allowed network service | |
Critical, CVSS 10.0 | Filesystem | Gap between the sandboxed and unsandboxed parts |
The two cases that look most like real escapes still went through an open door. In OpenAI's ExploitGym incident, the agents found a zero-day in the package registry proxy, the only network path they were allowed (OpenAI's account; it has not said what isolated the agents' code). CVE-2026-39861 is a scope failure: Claude Code's sandboxed commands and its unsandboxed process each did something harmless, and together they wrote outside the project.
Most of these runs used very capable models on purpose, with safety classifiers switched off, doing offensive security work. Full write-ups, timelines and sources for each incident are in Manifold's Agent Incident Ledger (introduction).
The failures in these runs carry over to everyday agents. The rest of this post explains why agents go looking for a way out, and which parts of a sandbox the table above refers to.
Why an agent needs a sandbox at all
An agent is a language model plus the harness around it (like Claude Code or Codex), which together read files, run shell commands, install packages and make web requests.
An agent that has everything it needs rarely causes trouble. It does the task and stops. Trouble starts when the task gets stuck: a tool fails, a target is offline, a permission is missing. Agents are persistent, so they keep trying the next thing they can reach, until they either finish or run out of options. Over a long enough run, assume they will try everything within reach, whether or not you meant it to.
The obvious first defense was human approval for risky commands. However, like alert fatigue in security, approval fatigue soon sets in: people stop reading prompts and just approve. Hardly any prompt is actually security critical, so people learn to approve quickly to keep the work going.
A sandbox reduces the number of prompts by setting boundaries that are enforced by something the agent cannot talk to, such as the operating system or a separate machine. Typical boundaries allow writes only to the project folder and network access only to approved domains. Commands that stay inside them can run without asking, because the damage they could do is already limited, and only actions that cross a boundary need a person to approve them. The boundaries also define the blast radius if something goes wrong. Anthropic reports that sandboxing Claude Code reduced permission prompts by 84% in its internal use (Anthropic, 2025).
What a sandbox limits
A sandbox answers two questions. What can the agent reach: which files, which network destinations, which credentials? And how isolated does it run? The reach is set by policies. Isolation depends on the technology and how much of your machine it shares.
Area | What it controls | A good default | What goes wrong |
|---|---|---|---|
Files | Which folders the agent can read and write | Read and write the project folder, read the tools it needs, nothing else | Secrets in reach (~/.aws, .env), or writes to the agent's own settings |
Network | Where the agent can connect | An allowlist, with packages from an internal registry | Paths the filter misses, such as DNS, or a bug in an allowed service |
Credentials | Which keys the agent can use | A proxy outside the sandbox adds the real key, or short-lived tokens | Static keys in files or environment variables, valid until revoked |
Execution isolation | How much the running code shares with your machine | The whole agent in a VM or container, or at least an OS process sandbox | A kernel bug on a shared kernel, or a mounted docker.sock |
Files, network and credentials decide what the agent can reach. Execution isolation decides how hard it is to break out. Most incidents above went through something the agent was allowed to reach, without breaking any isolation. A microVM with your AWS key and open internet protects you less than a small interpreter that can reach nothing.
Credentials need the most care, because using one needs no escape at all. An agent that can read your GitHub token can do anything that token allows, from inside the sandbox. The safest setup keeps the real key out: the agent gets a placeholder, and a proxy outside or part of the sandbox adds the real key only to allowed requests.
Execution isolation trades strength for convenience. From lightest to heaviest, the options are a language runtime that only runs code written for it, an OS process sandbox such as Seatbelt or Landlock around the agent's real tools, a container with its own view of files and network, and a VM or microVM with its own kernel. The heavier the option, the less the code shares with your machine, and the more work it takes to give the agent the files and tools it needs.
Scope: which part of the agent is sandboxed
A sandbox can hold the whole agent, everything except the agent loop, or only the code the model writes. Anthropic's Managed Agents design calls these parts the brain, meaning the model and the loop that drives it, and the hands, meaning the sandboxes and tools that act (Anthropic, 2026). The hands are often sandboxed, while the brain often is not. Yet it is the brain that reads the poisoned web page and keeps trying when it gets stuck.
Scope | Sandboxed | Not sandboxed | Examples |
|---|---|---|---|
Whole agent | The agent loop, its tools and the code it writes | Credentials, if a proxy adds them | Docker Sandboxes, nono, Codex Cloud, an agent inside a microVM |
Tools and code | The tools, or some of them, and the code they run | The agent loop and the model, plus any tools left out | Anthropic Managed Agents; Claude Code and Codex CLI, which sandbox only the shell tool |
Generated code only | The code the model writes | The agent, all its tools and its credentials | Pydantic's Monty, Cloudflare Code Mode, hosted code interpreters |
Scope can surprise you even inside one product. Claude Code and Codex both sandbox shell commands, but not all of the agent's other tools. In Claude Code, a rule that stops shell commands from reading a file does not stop the agent's own Read tool (Claude Code, Sandboxing). In Codex, the network filter covers sandboxed commands but not web search, MCP server connections or browser activity (Codex, Agent approvals and security).
Putting it to use
No single sandbox fits every agent. Start from what you run:
You run | Start with |
|---|---|
A coding agent on your laptop | The whole agent inside a VM or container, or at least an OS process sandbox. |
An agent that runs generated code in your product | Sandboxing only the generated code is fine for the code. Guard the agent separately, since it keeps the tools and the keys. |
Autonomous or offensive security agents | The whole agent in a microVM, network limited to in-scope targets, and a person watching the run. |
How a sandbox is configured matters as much as how it is built. In SandboxEscapeBench (Marchand et al., 2026), frontier models got out of Docker containers mostly through misconfigurations, such as a mounted docker.sock, rather than kernel flaws. Most of the configuration can be set once for a whole team:
- Keep real keys out of every sandbox: inject them through a proxy, or hand out short-lived tokens.
- Make network access an allowlist that covers DNS.
- Never mount docker.sock or the SSH agent socket into a sandbox.
- Keep logs outside the sandbox, where the agent cannot edit them.
And the next time you read that an AI escaped its sandbox, ask three things. Did it break a wall or walk through a door? Which area did it get through: files, network, credentials or execution? And was the agent inside the sandbox at all?
There are many sandboxes, each with its own scope, isolation type and defaults. Across a team, someone has to know which agent runs where, what it can reach, and whether that matches the rules you meant to set. Keeping track of that is the job of an agentic AI security platform such as Manifold Security.
About the author

Security Researcher
Markus is a security researcher with over 12 years of experience across software engineering, security research, and product management.





