Glossary
Agent sandbox
An isolated environment where an AI agent can run code, use a shell or browse without being able to harm the host system or reach data outside it.
An agent sandbox is an isolated environment where an AI agent can run code, use a shell or drive a browser without being able to damage the host system or reach data it should not see. The sandbox limits what the agent’s actions can touch: its own filesystem, processes and network, usually thrown away when the task ends. It is the standard safety layer for coding agents and for any agent that executes code it wrote itself.
Why agents need sandboxes
Code generated by a model is untrusted. It can contain bugs that delete files or loop forever, and an agent that has read a hostile web page or document may have been steered by prompt injection into running something harmful. Running that code on a developer laptop or a production server gives it the same access as the person or service that launched it. A sandbox applies least privilege at the level of the machine: the agent gets a disposable computer with nothing valuable in it, and only the network access and credentials the task needs.
How agent sandboxes are built
Sandboxes differ mainly in how strongly they separate the agent from the host and how fast they start.
Isolation approach | How it separates the agent | Typical trade-off |
|---|---|---|
Containers | Shared host kernel with namespaces and resource limits | Fast to start, weaker isolation for untrusted code |
User-space kernels | A layer such as gVisor intercepts system calls | Stronger isolation, some compatibility gaps |
MicroVMs | A lightweight virtual machine per sandbox, for example Firecracker | Strong isolation with fast start-up |
WebAssembly | Code runs in a restricted runtime with no direct system access | Very light, limited to supported languages |
Hosted sandbox services package one of these approaches behind an API, with features such as file upload, port forwarding, long-running sessions and pause and resume. Best AI agent sandboxes compares the main providers, and the E2B alternatives page covers the wider field.
What a sandbox does not cover
A sandbox protects the machine the agent runs on. It does not protect the systems the agent reaches through its agent tools. If an agent inside a sandbox holds an API key for your CRM, it can still delete CRM records, and if it can send email, the email still goes out. Those risks need scoped agent permissions, approval through human in the loop for irreversible actions, and a way to recover data after a bad run, which is what agent rollback describes. Agents that click through real interfaces, such as browser agents and computer use agents, combine both concerns: the browser runs in a sandbox, but the websites it acts on are real.
Sandboxes and Exabase
Exabase is not a code execution sandbox. It does not run your agent or its code; the agent runs wherever you run it, including inside a sandbox from a provider such as E2B, Daytona or Modal. What Exabase provides is the data side: an isolated, versioned place for the agent to read and write files, notes and memory.
Each Base is a separate environment with its own storage, search index and memory, so you can point an agent under test at a Base filled with realistic data without exposing production. With filesystem snapshotting turned on, Exabase records the state of every resource, letting you query the Base as it was before a run, see what the agent renamed, moved or deleted, and recover deleted resources from the bin for 30 days. Snapshots record resource metadata, not file content, and they are not a sandbox: they make changes inside the Base visible and recoverable, but they do not contain code execution or reverse actions in outside systems. The agent undo solution sets out those boundaries, and the snapshot settings endpoint turns recording on per Base.
Many teams use both: a sandbox for where the agent’s code runs, and a Base for the workspace it changes. Exabase vs E2B, Exabase vs Daytona and Exabase vs Modal explain how the two layers fit together, and testing agents on real data without risking it walks through a test setup. The agent context versioning use case covers versioned agent workspaces in more depth.
FAQs
What is an agent sandbox?
An agent sandbox is an isolated environment where an AI agent can run code, use a shell or browse without being able to harm the host system or reach data outside the sandbox.
Why do coding agents need a sandbox?
Coding agents run code they generated, which is untrusted and may be buggy or influenced by injected instructions. A sandbox keeps the damage inside a disposable environment.
Is a Docker container a secure sandbox?
A container gives useful separation but shares the host kernel, so for untrusted, model-generated code many teams prefer microVMs or a user-space kernel such as gVisor for stronger isolation.
Does a sandbox stop an agent from deleting data in other systems?
No. A sandbox protects the machine the agent runs on, not the services it calls with its credentials. Those need scoped permissions, approvals and a recovery plan.
Is Exabase a sandbox?
Exabase is not a code execution sandbox. It provides isolated, versioned workspaces called Bases, where agents store and search data, and filesystem snapshots that show and recover what a run changed inside a Base.
What is the difference between a sandbox and a snapshot?
A sandbox limits what an agent’s code can reach while it runs. A filesystem snapshot records the state of data so you can inspect or recover it after the run. They solve different problems and are often used together.
Related pages: Agent rollback, Snapshot, Coding agents, Least privilege, Agent workspace, Agent undo solution, Best AI agent sandboxes, Exabase vs E2B, Exabase vs Vercel Sandbox, Agent context versioning use case, Agent runtime, Browser agents