sandbox
A sandbox is an isolated, safe test environment where a program or AI agent can work without harming the real system even if an error occurs.
In plain terms
Think of a sandbox at a playground: a child can build anything there and also tear it down, but the sand remains within the frame, and the garden is not harmed. The computer sandbox is a similar frame for a program: inside, it can work freely, but from there, it cannot reach out to your other files, your passwords, or the corporate network.
With AI agents, this became important because the agent does not just write text but also acts: it runs commands, modifies files, and opens websites. If it misunderstands something or is deceived by a malicious website, the sandbox wall will contain the damage.
A sandbox does not make the agent smarter or more reliable. It only limits how much trouble it can cause if it makes a mistake. It is like a student pilot's simulator: a crash there is still a crash, but no one gets hurt.
How it works
- An isolated environment is created: for example, a virtual machine, a container, or a restriction of the operating system that confines the program to a single folder and separates it from the rest of the real system.
- Rules specify what is allowed inside: which files the agent can see, which websites it can access, and how much memory and time it can use.
- The agent works within these boundaries: it writes and runs code, creates files, and launches tests. Anything falling outside the rules is either rejected or requires separate human permission.
- At the end of the work, only the verified result leaves the sandbox, such as a finished file or a proposal that you approve.
- The environment can then be deleted or reset to a clean state, so the next task inherits nothing from previous errors.
An everyday example
You upload an Excel spreadsheet to an AI assistant and ask it to create a chart from it. The assistant runs the code not on your machine, but in the provider's isolated sandbox, and you receive only the finished image. If the code were faulty, at most the sandbox would collapse, leaving your machine and data untouched.
Who is affected
A common misconception
Limits and risks
- A sandbox does not improve the agent's judgment: a bad result inside is still a bad result, so you cannot skip verification.
- The more access you grant (internet, accounts, corporate data), the less protected you are; convenience and security work against each other here.
- No single sandbox is perfect: software bugs are occasionally found that allow escape. A container generally provides weaker isolation than a virtual machine.
- In an overly strict sandbox, the agent cannot perform many tasks, creating a strong temptation for the user to relax or disable it, thereby removing the protection.
Similar, but not the same
- regulatory sandbox – This is a legal and regulatory framework (a regulatory sandbox) in which companies can test new solutions under regulatory supervision and controlled conditions; the EU AI Act also requires member states to set them up. It is not a technical containment environment, and it does not exempt anyone from the law.
- guardrail – Guardrails regulate what a model can say or attempt, while a sandbox controls what the executed operation can access.
- virtual machine – A virtual machine is one possible technique for building a sandbox, but the sandbox itself is the goal: isolation.
Related concepts
AI safety, cybersecurity, access control
container, virtual machine, code execution environment
AI-agent, coding agent, guardrail, prompt injection, human approval
A brief history
The word moved from children's sandboxes to computer science. As a security term, it spread following a 1993 study on software fault isolation (Wahbe et al.), and the general public encountered it with the launch of Java in 1995 and later via browsers.
Where things stand
In late 2026, AI assistants that run code in the providers' cloud typically work in a sandbox. Coding agents running on your own machine also have a built-in sandbox, but how strict it is often depends on the user's settings. The debate is about how much access to give the agent and when it must ask for human permission.
In the news
- Unofficial relay service disables sandboxes in OpenAI Codex and Claude CodeOct 29, 2026 · Code
- METR red team broke OpenAI's agent monitoring in three waysOct 26, 2026 · Code
- Docker, Pydantic AI and Google ship tools to run AI agents in isolated environmentsOct 21, 2026 · Code
- HKMA launches "ART" framework for responsible AI adoption in banking; banks test deepfake detectionOct 19, 2026 · Money
- Ping An Digital Bank reaches 96% deepfake detection accuracy in HKMA GenAI sandboxOct 15, 2026 · Money
- GitHub Copilot comes to Windows with local models and sandboxed tools; what goes to the cloud is unclearOct 7, 2026 · Code
- FCA publishes good and poor practice on AI; Mills Review examines future of retail financeOct 5, 2026 · Money
- Utah lets AI prescribe acne medication without direct physician oversightOct 5, 2026 · Health
Also known as
sandbox · sandbox · sandboxing · sandboxing · sandbox environment · isolated runtime environment · isolated environment · agent sandbox
Sources
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.