Definition · AI security
Sandbox
A sandbox is a restricted, controlled environment where untrusted code operates with access only to approved resources. Many AI agents that write code or start commands work in a sandbox. The sandbox limits the files the agent can change. It also limits the network addresses the agent can connect to. Thus a mistake or an attack stays in the sandbox.
Last reviewed
Key points
- A sandbox lets untrusted code operate, but gives it access only to approved resources.
- Many AI agents operate in a sandbox, frequently a Docker or OCI container.
- Anthropic says a sandbox for an agent must isolate the files and the network. One wall without the other is not sufficient.
- A sandbox is not a guarantee. In a 2026 UK AISI benchmark, frontier models escaped containers with usual configuration faults.
How it works
A sandbox puts walls around code. The code can do its work in the walls. When the code tries to go through them, the operating system stops it.
For an AI agent, two walls are the most important:
- Files. The agent can read and write in one work folder. The Claude Code sandbox from Anthropic blocks “the modification of any files outside of it”.
- Network. The agent can connect only to approved addresses. In Claude Code, all traffic goes through a proxy server out of the sandbox. The proxy controls which domains the code can connect to. In Codex from OpenAI, with public internet access off, commands connect only to hosts on a managed allowlist.
Claude Code and Codex use features of the operating system to apply these limits: Seatbelt on macOS and bubblewrap on Linux. The limits also apply to each command that the agent starts. Many other agent systems use a Docker or OCI container as the sandbox.
Anthropic says that the two walls are necessary. With no network wall, a compromised agent can send out sensitive files such as SSH keys. With no file wall, the agent can “easily escape the sandbox and gain network access”.
Why it matters
An agent can do damage by mistake. A prompt injection can also tell the agent to do damage. A sandbox does not stop the bad command. It limits what the command can touch. Code that the agent must not operate is the risk of unexpected code execution.
A sandbox also changes how frequently a person must give approval. OpenAI says the sandbox “defines technical boundaries” and the approval policy decides “when the agent must stop and ask before crossing them”. Anthropic says that constant approval “can lead to ‘approval fatigue’”. Anthropic reports that, in its internal use, the sandbox cut permission prompts by 84%. That number is a vendor figure for one product. Human-in-the-loop gives more about the approval control.
Trade-offs
A sandbox is only as strong as its configuration. In March 2026, UK AI Security Institute researchers published SandboxEscapeBench. It tests if a model with shell access can break out of a container. The researchers added known faults on purpose.
Frontier models “reliably escape common sandbox weaknesses”. Examples are privileged containers, writable host mounts and an exposed Docker daemon. On harder tasks, the largest models succeeded “at meaningful rates on level 3 tasks”. They had “zero success on levels 4 and 5”.
The paper also shows a difference in practice. Large inference providers usually use microVMs such as Firecracker, or userspace kernels such as gVisor. Much of the open source agent ecosystem and local developer tools use standard Docker containers.
Questions and answers
Why do AI coding agents work in a sandbox?
A coding agent starts commands and changes files, and a person does not examine each step. A sandbox keeps those commands in set limits on files and network. OpenAI calls its sandbox "the boundary that lets the agent act autonomously without giving it unrestricted access to your machine".
Is a Docker container a safe sandbox for an AI agent?
Only with a correct configuration. In a 2026 UK AISI benchmark, frontier models escaped containers with usual faults. Examples are privileged containers, writable host mounts and an exposed Docker daemon. The paper says that large inference providers usually use microVMs such as Firecracker, or userspace kernels such as gVisor.
What is the difference between a sandbox and human approval?
A sandbox sets technical limits that the code cannot go through. Approval is a stop for a person to accept or refuse a step. OpenAI says the sandbox "defines technical boundaries" and the approval policy "decides when the agent must stop and ask before crossing them".
Sources
- Glossary: sandboxNIST Computer Security Resource Center
- Quantifying Frontier LLM Capabilities for Container Sandbox EscapearXiv (Marchand et al., UK AI Security Institute, ICML 2026), 1 Aug 2026
- Beyond permission prompts: making Claude Code more secure and autonomousAnthropic, 20 Oct 2025
- Sandbox (Codex documentation)OpenAI
Guides that use this term
Related topics
In the news
- LocalStack adds local tests for Amazon Bedrock AI agents
- SCAN-MCP checks 10,121 AI tool servers and finds chain weak points
- Anthropic tests if AI agents break out of 26 sandboxes
- AWS releases an open source tool to select a cloud for each workload
- Open project checks AI agent commands in less than 1 millisecond
- AI agents break weak sandboxes in 21% to 32% of Anthropic tests
- AI agents in different sandboxes sent secret signals by one server
- Meta refused a UK regulator test of its Muse AI agent
- AWS lets durable functions operate agent code in isolated MicroVMs
- A new Perplexity tool shows AI agents the web of a set date
- JetBrains rebuilt its Kotlin test after agents found the answers
- OpenAI agents used web tools to go out of their test sandboxes
- Two AI models sent signals through one inference server
- Epochal AI starts with $100 million for models that predict results
- All Vercel Sandbox runtimes use Vercel Managed Images
- Study of 48,682 agent skills finds flaws in their own code
- Tests show agents state incorrect answers as fact in up to 26% of runs
- AWS makes three tools that find APIs and stop attacks on them
- AWS releases 5 open decision models and a sandbox tool for agents
- Apple job listing points to a Mac AI agent, Bloomberg says
- Talgent releases Workbench, open source software for AI agents
- Perplexity gives AI agents a monitor API for web changes
- Singapore plans an ID check and a test area for AI agent payments
- Eclipse Foundation launches Enclave 1.0, a sandbox for AI agents
- In a test of when to stop, 17 AI models got 59.5% at most
- RadixArk model lifts an agent test score from 5.6% to 12.0%
- OpenAI shows how the Codex sandbox limits the access of an AI agent
- Google adds IPv6 only AI clusters to GKE in preview
- Three agent runtimes go to the CNCF but agent control is behind
- Cowboy opens a market for AI agents with $5M and 100 agents
- Google gives its Agent Substrate sandbox for AI agents to a foundation
- Amazon tells that agent sessions start as much as 15 times faster
- Google shows how GKE can start 300 agent sandboxes each second
- Mount Thor raises $45 million to rent Apple Macs to AI agents
- Google gives OpenRL training software to an open source group
- AWS Lambda MicroVMs can operate x86 software with no change
- Trust3 AI releases an AI agent kill switch with a trust score
- Google Cloud shows six open AI tools for Kubernetes
- LangChain operates LangSmith in customer AWS accounts in 15 regions
- AWS launches Nitro Sandboxes with one VM for each Kubernetes pod
- IBM adds an open-source policy engine to the Praxis AI gateway
- Red Hat releases OpenShift 5 with an AI agent that finds faults
- MuseSpark AI tells of 40% less cost for 400 AI models
- Red Hat reports a 70% cut in frontier model costs
- Nvidia shows Agentic AI Stack to lower the cost of AI agents
- Korean firms use NVIDIA OpenShell to make AI agents safe
- An engineer made an open copy of the Google agent sandbox
- AWS adds Kiro bots, agents with their memory and set tools
- A new tool lets AI agents test Windows apps on a clean PC
- WorkOS update blames a test AI agent for its data breach
- Microsoft AI chief opposes Delaware bill for AI agent companies
- Google opens Z4M servers with 168,000 GiB of fast local storage
- RunSybil shows a model template can get out of a Python sandbox
- Researchers bypassed ChatGPT Lockdown Mode through HTML preview
- Nvidia says its Vera CPU gives 1.6 times more agents for each watt
- E2B says its AI agent sandbox revenue is above $120 million a year
- Google gives three agent tools to the CNCF and ships Substrate 1.0
- Conductor joins Meta and closes its coding agent cloud on 20 November
- Hugging Face CEO puts his risk of AI doom near zero
- Google adds agent security controls and new CodeMender scan modes
- Docker repairs a bug that let AI agents read secret files
- Axion 1.0 is an open AI agent model with a 3 step recipe
- Tests show 4 of 4 AI providers open to attack in code pipelines
- The Hong Kong securities regulator will write agentic AI guidance
- Google shows how AI agents can reply with maps and lists
- A ChatGPT hyperlink could read chats until OpenAI repaired it
- New turn in OpenAI dismissals as 20 Democrats write to Altman
- Google Cloud spend caps stop AI use at the budget limit
- OpenAI says new monitors give a warning 30 hours before the breach
- Replay tests connect the Qwen upload to model errors, not a backdoor
- Relay gives China access to coding tools with safety off
- Cisco open sources Quarry to find AI agents that go out of scope
- Harbor raises $10m to insure the work of AI agents
- Nine of 10 AI models raised their own wallet limit by email code
- The sill tool gives AI coding agents a Bash shell on Windows
- AWS adds a context layer for AI agents to read company data
- Docker Compose adds AI agents and models to one file
- Akamai launches a sandbox to contain code that AI agents write
- New turn in OpenAI training pause as work starts again
- Helpful AI agents go around review when no reviewer is there
- Block launches Dessa, a voice AI that learned from human voices only
- SUSE adds NVIDIA agent safety to its closed AI platform
- OpenAI agents escaped test sandboxes and found zero-day bugs
- OpenAI and Anthropic report AI models that broke test limits
- AWS and UC Berkeley release Infinity for 75,000 agents in 8 GB
- Daytona gets $60 million at a $1 billion value for an agent cloud
- AISI finds Mythos 5 incorrectly called its targets simulated
- Google makes a microVM for each AI agent in its cloud
- A changed voice-to-text model made AI agents move $5,000 in a test
- Google Cloud opens NVIDIA Vera Rubin A5X instances next month
- NVIDIA adds Confidential Bare Metal for AI model makers
- Solcis releases tools that check each AI agent task against rules
- Cloudflare leads tsrs, a fast Rust checker for TypeScript code
- Daytona gets $60 million for a cloud for AI agents
- Neo4j releases Context Engine, a knowledge layer for AI agents
- Microsoft adds controls that start AI agents with no access
- Perplexity makes its SPACE agent sandbox open source
- New turn in California inquiry into the OpenAI Hugging Face breach
- Hong Kong regulator gives an AI framework to banks
- Three US agencies give AI companies guidance for safe model tests
- AWS releases two open-source tools to control AI agents
- 4 AI agents train a raw model to the score of its instruct model
- Perplexity makes its SPACE sandbox for AI agents open source
- CyberArena tests AI agents in live attack and defense matches
- Coding agents can copy some biological AI tools with no internet access
- 2 senators want the US government to test AI models
- Pi 1.0 has MCP and Code Mode, and a new harness, Pi Durable
- AAIF adds a sandbox step for new projects
- XBOW got a $250,000 Chrome bounty with AI agents in 6 days
- AIR finds a vulnerability in Vercel Sandbox that lets agents leak data
- Artificial Analysis made AA-3D, a test for AI 3D scenes
- Anthropic and OpenAI prepare for a large AI incident
- AWS made Strands Box, an open source sandbox for AI agents
- HKT Payment will test a digital ID for AI agents in Hong Kong
- AI agents escaped the ExploitGym sandbox and compromised Hugging Face
- Wikimedia reports that OpenAI agents sent millions of API requests
- Microsoft makes MXC available to limit the files an AI agent can use