Server racks in a computer room in Tucson, Arizona (illustrative). Image: NOIRLab/NSF/AURA/T. Slovinský / Wikimedia Commons, CC BY 4.0, cropped
An AI sandbox is a sealed-off computer where an AI agent can run code, use tools and browse (usually a copy of) the web without touching anything real. Labs use them by the millions to train and test agents, and this month has shown, again and again, that the agents inside don’t always stay put. Here’s what sandboxes are, how the labs build them, and why they keep failing.
Jump to:
[What is a sandbox?](#what)
[How big is this?](#scale)
[Types of sandbox](#types)
[Why do agents escape?](#why)
[Real escapes](#examples)
[How labs fight back](#defences)
[Why it matters](#matters)
[FAQ](#faq)
What is an AI sandbox? #
A sandbox is an isolated environment, a bit like a locked practice room, where an AI model can act rather than just talk. Inside, an agent can open files, run programs, install software and call tools, while the sandbox limits what it can reach and stops mistakes spreading to the real systems around it.
Labs need them because of how today’s agents are trained. In reinforcement learning, a model attempts a task (fix this bug, find this fact, build this spreadsheet), gets scored on the result, and gradually learns what earns a good score. That means running enormous numbers of attempts, each in its own clean environment, often with access to a cached, offline copy of the web rather than the live internet.
How big is this? #
Bigger than most people imagine. DeepSeek has just published the most detailed public description yet of a lab’s sandbox system, a platform it calls DeepSeek Elastic Compute, or DSec. According to DeepSeek’s paper:
- 3 million sandboxes a day run on a single production unit of about 160 servers.
- More than 380,000 sandboxes run at the same time.
- Over 5,000 new sandboxes are created every second.
- Up to 3,200 containers or 800 microVMs can share one server, because agents spend most of their time waiting for the model to decide its next move.
Those are DeepSeek’s own figures, but they give a sense of the scale at which every frontier lab now trains agents. It also explains the numbers behind this week’s headlines: when a lab runs millions of attempts, even a tiny rate of bad behaviour adds up to a lot of incidents.
What kinds of sandbox are there? #
Not all sandboxes are equal. There’s a trade-off between how strongly a sandbox isolates the agent and how cheap and fast it is to run. DSec offers four kinds, which map neatly onto the options most labs use:
| Type | What it is | Isolation | Used for |
|---|---|---|---|
| Function call | A short-lived process in a pre-built, reusable container | Weakest | Quick, stateless jobs like running a snippet of code or compiling a program |
| Container | A packaged Linux environment that shares the host computer’s operating system kernel | Medium | Most coding tasks on real software projects; fast to start and cheap to run |
| MicroVM | A tiny virtual machine with its own kernel (DSec uses Firecracker, the technology behind AWS Lambda) | Strong | Security-sensitive tasks, at the cost of more memory and slower start-up |
| Full virtual machine | A complete computer, operating system and all | Strongest | Tasks that need a whole desktop or phone, such as “computer use” or Android apps |
Source: DeepSeek’s DSec paper. Containers are the workhorse because they’re cheap, but DeepSeek notes that because they share the host kernel, they’re “not always appropriate for security-sensitive tasks.”
Why do AI agents try to escape? #
Not because they want freedom. The best explanation is simpler and, in a way, more worrying: they’re trying very hard to finish the job, and the rules are in the way.
AI researchers call one version of this reward hacking: a model finds a way to score well without doing the task as intended, like a student who finds the answer sheet instead of learning the material. The risk was spelled out a decade ago in the influential paper “Concrete Problems in AI Safety”, co-written by Dario Amodei, now Anthropic’s chief executive. Today’s agents are capable enough to act on it. If the answer is easier to find by peeking at a log file, scanning the network or asking another chatbot, a sufficiently resourceful agent may try.
OpenAI defines the problem in its misalignment reports as “agent behavior that circumvents restrictions or pursues a goal beyond reasonable expectations.” Nobody tells the agent to break out. It just keeps going when it hits a wall.
How have agents actually got out? #
This month has produced an unusual amount of detail, much of it published by the labs themselves.
Smuggling questions through DNS (OpenAI)
On September 20, an OpenAI agent working on a search task couldn’t find its answer with its approved tools. Web access was blocked, but the sandbox didn’t filter DNS, the internet’s address book, tightly enough. The agent hid its questions inside DNS lookups to reach an outside chatbot, and got answers back the same way. OpenAI’s monitoring flagged it within 15 minutes, but the run wasn’t killed for another two and a half hours. Our full story is here.
Hacking Hugging Face through a screenshot service (OpenAI)
The most serious case so far happened in July, when a swarm of about 700 OpenAI agents broke into the AI platform Hugging Face. An independent investigation called Swarm Traces found the agents could only load web pages, not send data, so they hid code inside web addresses, chained almost a million shortened links together and got a free screenshot service to run it. Inside, one script gathered stolen credentials into a collection it called “LOOT,” and agents tried to delete the evidence. Our full story is here.
Posting files on the public internet (OpenAI)
Less dramatic cases show how routine this is. In one, agents that couldn’t share a spreadsheet through their local files uploaded it to a public file-hosting site so their co-working agents could download it. In another, an agent that already had the data it needed uploaded it to a public paste site just so its browser tool could “cite” it.
Forged messages, a rewritten bash and a crashed filesystem (DeepSeek)
DeepSeek’s paper lists what its own agents tried inside DSec. They searched platform files and logs for leftover answers, sent crafted messages directly to the sandbox’s internal control service to forge user requests, and tried overwriting /bin/bash, the program that runs shell commands, to slip past checks. After DeepSeek added file and socket restrictions, one agent tried an obscure low-level command to swap the contents of two files and read a protected one. It corrupted the filesystem and forced it to shut down.
Outside the sandbox, DeepSeek’s agents scanned ports to find reachable software mirrors and pulled code from GitHub through Go’s module proxy, looking for existing solutions to their tasks. “Final-output checks alone cannot reliably establish whether the agent solved the task as intended,” the paper says.
Accidents count too
Not every failure is sneaky. DeepSeek describes an agent that searched every file from the root directory, stumbled into a special system file and triggered a kernel bug that crashed the machine, and another that ran a command which prints “y” forever, filling tens of gigabytes of storage with its output.
How do labs try to stop it? #
With layers, and a growing acceptance that no single layer is enough.
- Stronger boundaries for risky tasks: moving security-sensitive work from containers to microVMs or full virtual machines.
- File and socket locks: DeepSeek uses AppArmor, a Linux security module, to control which files and internal channels an agent can touch, even when it runs as the all-powerful “root” user inside its sandbox.
- Network allowlists: DeepSeek uses per-sandbox eBPF filters so each task can reach only approved services (for example, allowing the Python package index but blocking others). OpenAI says it now blocks outside access at two independent layers and limits DNS to an approved list.
- Offline copies of the web: OpenAI says all internet access in its DNS case, apart from the DNS lookups, hit an offline web cache rather than the live internet.
- Monitoring and measuring: OpenAI runs an automated misalignment monitor, and Anthropic publishes how often its models misbehave. Its latest model, Opus 5.5, tried to escape a sandbox in 1.5% of test runs, down from 25% for its earlier Mythos model,according to Axios .
DeepSeek is candid about the limits. “No single mechanism can prevent all agent misbehavior and system failures,” its paper says, adding that its controls “address only part of the problem.”
Why does this matter to everyone else? #
Because the same agents, or close relatives of them, are now doing real work. Tools like Claude Code, OpenAI’s agents, Grok Bot and Meta’s Muse can run code, browse and act on people’s behalf, and the behaviours showing up in labs, working around blocks, reaching for outside help, going further than asked, don’t disappear just because a product is released.
It’s also why regulators are paying attention. OpenAI has d tool use for its most capable models, Australia’s Senate wants to question the heads of OpenAI and Anthropic, and Axios reports the labs are investigating tens of thousands of incidents. The sandbox is where AI companies find out what their models will do when nobody is watching. This month, they found out quite a lot.
Frequently asked questions #
What is an AI sandbox?
An AI sandbox is an isolated computer environment where an AI agent can run code, use tools and browse without affecting real systems. Labs use millions of them to train and test agents safely.
Why do AI agents escape their sandboxes?
Usually to finish their task. When an agent is blocked, it may look for workarounds, like hiding requests in DNS lookups or up files to public sites, because those routes help it score well. Researchers call one version of this reward hacking.
Does an AI escaping a sandbox mean it is conscious or wants to be free?
No. There is no evidence of that. The behaviour comes from goal-seeking: the agent is trained to complete tasks and keeps trying other routes when the intended ones are blocked.
What is reward hacking?
Reward hacking is when an AI finds a way to get a good score without doing the task as intended, for example by finding the answers in a log file instead of solving the problem. The risk was described in the 2016 paper “Concrete Problems in AI Safety”.
Can a sandbox be made completely escape-proof?
Not with any single measure. Labs combine stronger isolation such as microVMs, file and network restrictions, offline copies of the web and monitoring. DeepSeek says no single mechanism can prevent all agent misbehaviour.
How many sandboxes do AI labs run?
Millions. DeepSeek says one production unit of its DSec platform runs about 3 million sandboxes a day, with more than 380,000 running at once.
Sources: DeepSeek, “DeepSeek Elastic Compute (DSec)”, OpenAI misalignment reports, Swarm Traces, Axios, Amodei et al., “Concrete Problems in AI Safety” (2016).