Agent Sandbox vs Approvals: Two Kinds of Safety
Agent sandbox vs approvals is sometimes argued as if one could replace the other. It cannot. A sandbox limits what an agent is able to reach. An approval decides whether an agent may do something it is able to do. They protect against different failures, and vendors who build sandboxes say so themselves. This article compares the two using published material from Anthropic, OpenAI, Vercel, Zed and E2B, and shows where a human approval is still needed once sandboxing is in place.
What a sandbox does
A sandbox draws a boundary and enforces it below the agent, in the operating system or a virtual machine.
- Claude Code. Anthropic's sandboxing post describes two boundaries built on operating system features. Filesystem isolation means the agent can read or modify only specific directories. Network isolation means it can connect only to approved servers. Anthropic states the purpose: fewer permission prompts and protection if the agent is steered by a prompt injection.
- Codex. OpenAI's docs say Codex runs locally in an OS-enforced sandbox that typically limits it to the current workspace, with network access turned off by default, plus an approval policy that controls when it must stop and ask.
- Zed. Zed's post on sandboxing takes up the obvious objection, that you could just tell the agent not to edit certain files, and explains why it supports sandboxing to restrict what agents can do in the terminal.
- Vercel. One of its posts is titled "A sandbox without a network boundary is only half a sandbox", which states the argument in full.
- Remote sandboxes. E2B and the other providers its guide compares (Modal, Daytona, Northflank, Blaxel and Vercel Sandbox) offer a code execution sandbox as a service: a separate, isolated computer for each agent, created and managed by the provider.
What sandboxing protects against: damage outside the boundary. A sandboxed agent cannot delete your home directory or post your SSH key to a server it was told about in a malicious README.
What an approval does
An approval inserts a decision before an action. Claude Code's default mode asks before shell commands, file edits and web fetches. Codex's approval policy decides when it stops to ask. A service such as Forkit moves those questions to a queue and puts rules in front of it.
What approvals protect against: actions that are allowed by the boundary and still wrong. Running a migration against the wrong database. Publishing a package. Rewriting a module that a colleague is in the middle of changing.
Agent sandbox vs approvals: what each one sees
| Sandbox | Approval | |
|---|---|---|
| Enforced by | Operating system or VM | A person, a rule or a classifier |
| Question it answers | Can the agent reach this | Should the agent do this now |
| Knows intent | No | Yes, if a person or a good rule decides |
| Cost per action | None | A wait, unless a rule answers |
| Fails by | Being configured too wide, or being bypassed | Fatigue: people approve without reading |
| Covers prompt injection | Limits the damage | Only if the reviewer notices |
| Covers legitimate but risky actions | No | Yes |
The fatigue failure is real. Anthropic reports that Claude Code users approve 93% of permission prompts, and that in its internal usage sandboxing reduced permission prompts by 84%. Read together, those numbers make the case for combining the two: let the sandbox remove the prompts that did not need a person, so the ones that remain get attention.
Where a sandbox is the better choice
Use a sandbox alone, with no approvals, when:
- The environment is disposable and holds no credentials worth stealing. A fresh container with a clone of the repository and no deploy keys.
- The work stays inside the workspace: reading, editing, running tests.
- There are too many agents for anyone to answer. A thousand workers cannot each wait for a person.
In these cases an approval step adds delay and no safety. This is the right default for the bulk of agent work.
Where approvals are still needed
Every useful agent eventually has to cross the boundary. The crossings are where approvals earn their cost:
- Network access for a reason. Installing a dependency, calling an internal API.
- Credentials. The moment a sandbox is given a token, what the agent does with it matters again.
- Shared state. Databases, queues, staging environments, a branch other people push to.
- Production, secrets and money. Deploys, key rotation, anything that spends.
Vercel's post on how its own agent accesses production describes this shape: the agent investigates freely, but changes need an approved plan and scoped, short-lived tokens. GitHub's write-up of its agentic workflows says agents are not trusted with secrets and writes are staged and vetted. Both are sandboxes with an approval at the exit.
How Forkit treats the crossings
Forkit is an approval layer, not a sandbox, and it is designed to sit beside one.
- Routine requests are answered by command rules, so a sandboxed agent asking to run
npm testnever reaches a person. - An owner can let an orchestrator agent answer certain tools within limits.
- Commands that Forkit classes as production, secrets or money always reach a person. No rule and no orchestrator can answer them, and a person can only allow them once.
- For agents with no terminal, an unanswered request is recorded as denied instead of hanging. Identical requests from many agents in one fan-out are grouped into a single question, except for the sensitive categories, which are never grouped.
The last point matters at scale. If two hundred sandboxed workers each need the same pnpm install, one answer should settle all of them.
Filesystem isolation does not stop agents colliding
One gap is easy to miss. Sandboxes isolate agents from the host and from each other's machines. They do not stop two agents, each in its own sandbox, from rewriting the same file in the same repository and pushing conflicting branches. That is a coordination problem, not a security problem, and it needs a different tool: a plan that splits the work, or claims on paths. See git worktrees vs file leases.
A practical setup
- Run every agent in a sandbox with filesystem isolation and network isolation on.
- Allow the network destinations that builds need, and nothing else.
- Keep credentials out of the sandbox; inject narrow, short-lived ones when a task needs them.
- Route the remaining permission prompts to rules first and a person second.
- Name the actions that must always reach a person, and do not let any automation answer them.
For the approval half in detail, see ways to approve agent commands compared and production access for AI agents.
Where Forkit fits
Forkit provides the approvals, not the sandbox. Pair it with Claude Code's built-in sandboxing or a hosted sandbox, and it handles the questions that are left: the ones where the agent can do something and someone should decide whether it may. It is free to try. More at forkit-mcp.com.
Sources
Read on 16 Nov 2026:
- https://www.anthropic.com/engineering/claude-code-sandboxing
- https://www.anthropic.com/research/claude-code-auto-mode
- https://developers.openai.com/codex/agent-approvals-security
- https://zed.dev/blog/sandboxing
- https://vercel.com/blog/a-sandbox-without-a-network-boundary-is-only-half-a-sandbox
- https://vercel.com/blog/how-vercel-agent-accesses-production-safely
- https://github.blog/ai-and-ml/generative-ai/under-the-hood-security-architecture-of-github-agentic-workflows/
- https://e2b.dev/resources/best-code-execution-sandboxes-for-ai-agents