Sandboxing
A term from AI security for a method that restricts, at the operating-system level, where an AI agent can run commands and edit files, and which network destinations it can reach.
What does Sandboxing mean in simple terms?
AI coding tools and work agents can run commands and edit files directly on the user's computer. Sandboxing isolates this workspace so the agent cannot edit files outside designated folders or connect to servers that have not been allowed. Because the fence is enforced by the operating system rather than by the AI's judgment, it is hard for the AI to go beyond that scope even if it is tricked by malicious instructions. As a result, users need to approve execution requests less often and can hand more work to the agent. A sandbox and execution approval are separate mechanisms, so using them together is the baseline.
How can Sandboxing be explained with an analogy?
It is like letting a child play only inside a fenced play area rather than across the whole living room, so no serious accident happens even without watching every move.
Where is Sandboxing used?
Anthropic — Introducing the Claude Code sandbox
On October 20, 2025, Anthropic introduced a sandbox feature for Claude Code that restricts file access and network access separately.[1] Inside the working folder it can read and write files but cannot modify files outside it, the network connects only to approved servers, and the feature is built on operating-system features such as Linux bubblewrap and macOS seatbelt.[1]
Result: Reported that permission prompts fell by 84% in its own internal use (per Anthropic's internal measurement).[1]
OpenAI — Per-task isolated environments in Codex
When OpenAI announced its cloud coding agent Codex on May 16, 2025, it explained that each task runs in a separate cloud sandbox containing the user's repository, and that internet access is turned off during the task.[2] The current Codex documentation sets out three levels—read-only, writing to the working folder, and full access—and explains that the sandbox and approvals are separate controls that work together.[3]
Result: Lets users choose, level by level, the boundaries for files outside the workspace and for the network (per OpenAI's official documentation).[3]
Learning steps, limitations and developments
- When handing a task to an AI agent, open only the folders that task needs.
- Allow the agent to connect only to the external sites it needs.
- Do not keep files containing passwords or authentication keys inside the sandbox.
- Use settings such as "full access" only briefly in a test environment, then switch them back.
A sandbox is effective only when both boundaries, files and network, are in place; with only one, information can leak or the agent can get outside the fence.[1] The 84% figure comes from Anthropic's internal use, so it cannot be assumed that other organizations will get the same result.[1]
How has Sandboxing evolved?
Which concepts are related to Sandboxing?
- Tool that uses itClaude CodeA coding agent that runs commands inside a sandbox
- Underlying technologyDockerRuns programs in isolated containers
- Risk it aims to preventExcessive AgencyA state in which AI can do too much
- Related riskLethal TrifectaBlocking outbound transfer paths reduces the risk of leaks
Execution approval vs Sandbox
Which sources explain Sandboxing?
- Anthropic — Beyond permission prompts: making Claude Code more secure and autonomous (2025-10-20) — https://www.anthropic.com/engineering/claude-code-sandboxing
- OpenAI — Introducing Codex (2025-05-16) — https://openai.com/index/introducing-codex/
- OpenAI — Sandboxing (accessed 2026) — https://learn.chatgpt.com/docs/sandboxing
Tell us what you think
Your feedback helps us improve the content.