
Agent sandbox: an isolated place for AI agents to act
In short: An agent sandbox is an isolated environment where an AI agent runs code and tools with limited files, network and credentials, so mistakes stay contained.
An agent sandbox is an isolated environment, such as a container, microVM or restricted process, where an AI agent can run code, install packages and use files without access to your real machine, credentials or network beyond what you allow. It limits the blast radius when the agent makes a mistake or is manipulated by malicious input.
Agent sandbox in plain words
It is like letting a new driver practise in an empty car park before the motorway. Mistakes still happen; they just cannot hit anything that matters.
How it works
The harness runs tool calls inside an environment with three kinds of limits: filesystem (only the project folder, often a copy), network (blocked, or restricted to an allow-list of domains) and credentials (none, or short-lived and scoped).
Claude Code's sandboxed Bash tool, as documented in November 2026, shows the pattern on a laptop. It uses Seatbelt on macOS and bubblewrap on Linux, limits which paths commands can read and write, and routes traffic through a proxy that checks each host against the allowed domains. Heavier isolation comes from containers, microVMs or a user-space kernel such as gVisor, which describes itself as an application kernel that isolates applications from the host operating system.
Example
As an illustration, a coding agent works in a container that mounts only the repository, can reach the package registry but nothing else, and holds no cloud keys. If a poisoned README tells it to upload ~/.ssh, there is no ~/.ssh and no route out.
Where you'll meet it
- Claude Code's sandboxing and permission settings
- Cloud coding agents that run each task in a fresh environment
- Code-execution tools in chat products
- Hosted sandbox services built for agents
What it changes for you
Sandboxing is what makes higher autonomy acceptable. In Claude Code, for example, sandboxed commands can run without a permission prompt in auto-allow mode. For platform teams, sandbox policy (what is mounted, which domains are allowed) becomes infrastructure to review and version.
Agent sandbox vs permission prompts
Permission prompts ask a person before each risky action. A sandbox limits what any action can reach, so fewer prompts are needed.
Common mistake
My view: sandboxing the filesystem but leaving the network open. A manipulated agent that can still reach the internet can send your data out, and that is harder to undo than a changed file. Restrict egress first.
Related terms
Permission modes · Prompt injection · Lethal trifecta · Guardrails · Computer use
From the archive: An isolated sandbox needs evidence for its exceptions · Security evals need a real egress deny
Lock down network egress first, because leaked data is harder to undo than a changed file.


