Where Should a Coding Agent's Sandbox Live? OpenAI and Prime Radiant Answer Differently
In the same week, two opposite answers were published to a question every team with coding agents ends up asking: when the agent runs a command, where does it run and what can it touch?
On November 16, 2026, Prime Radiant published External sandboxes for coding agents, signed by Simon Willison. It proposes keeping the agent on your machine and sending every command to a separate, isolated Linux, which can run on that same computer: it is external to the agent, not to the machine. Willison linked to it the next day on his blog.
On November 18, OpenAI published Inside the Codex sandbox, by Michael Bolin. It describes the opposite: Codex does not move to another environment; it restricts each command inside your usual environment with operating system mechanisms.
The two texts agree on much more than it seems. And both are honest about what they do not cover, which is exactly the part that interests me.
What problem are both trying to solve?
A coding agent runs commands: it installs dependencies, runs tests, edits files. If the model makes a mistake, or if a prompt injection slips an instruction in, everything that command can read or write is at stake.
The usual defense is to ask for approval for every action. The Prime Radiant text rejects it because it is slow and leads to decision fatigue: you end up approving everything without reading it.
It also mentions the AI filters the products themselves use, Claude Code’s auto mode and Codex auto-review, which according to the text seem to work well. Its argument is that those checks depend on a model judging each action correctly, and that a sandbox does not depend on any model’s judgment.
That argument carries more weight with small or local models, which according to the text make more mistakes and fall sooner to a prompt injection. That is the project’s stated motivation.
OpenAI reaches the same place by another road. It talks about defense in depth: training and alignment help the model use its access well, and the sandbox limits that access in case it does not.
How does Codex isolate commands without leaving your machine?
OpenAI’s design decision is explicit: no virtual machines or containers. Its example is an iOS app on a Mac, whose native toolchain and simulator do not work inside Docker.
Instead, Codex uses each operating system’s mechanism and exposes it through a single API that takes a command and a permission profile. The restrictions are inherited across the whole process tree the command launches.
- On macOS it uses Seatbelt through
/usr/bin/sandbox-exec, with a base profile that starts by denying everything. - On Linux it combines bubblewrap, which builds a view of the file system in a separate namespace, with seccomp-bpf filters on network calls.
- On Windows it is migrating to MXC, Microsoft’s isolated execution system, which Codex uses with native process isolation, to leave behind a custom sandbox that needed administrator permissions.
With a Git repository as the root, the built-in :workspace profile allows writes inside the project, keeps .git and .codex read-only, allows reading the rest of the disk with the user’s permissions and disables the network.
To grant limited network access, Codex starts a proxy that filters by domain. A thoughtful detail: the proxy only resolves the host name after deciding it is allowed, because a DNS query can already leak data encoded in the name.
Companies can restrict which profiles are available with a requirements.toml file or with cloud policies, so a user cannot enable full access even if they want to.
And the codex sandbox command lets you use the same mechanism outside an agent session. OpenAI shows it wrapping an MCP server, which the Codex harness does not isolate on its own.
What does the external sandbox pattern propose?
Prime Radiant separates the two roles. The agent stays on your Mac, with its interface and its session. The commands it decides to run travel through a local API to an isolated Linux that only sees the folders you mount.
They published three Apache-2.0 licensed prototypes that speak the same protocol:
- external-sandbox-v86: Node.js with v86, an x86 emulator compiled to WebAssembly that boots Alpine Linux. It requires Node.js
22.19or later. - external-sandbox-container: Python on top of Apple’s containers, for Macs with Apple silicon.
- external-sandbox-quicksand: Python on top of Quicksand, Microsoft’s MIT-licensed library that launches QEMU virtual machines designed to isolate agents and installs as a Python package.
By default none of them has network access. If you enable it, traffic goes through a proxy that allows specific hosts and HTTP methods, for example only GET and HEAD to PyPI.
The part I like most is credential substitution. The code inside the sandbox sees a placeholder token; the proxy swaps it for the real secret, which lives in the server’s environment on the host. The agent can call the GitHub API without ever seeing the key.
The caveat the authors themselves add: an allowed host could return the credential in its response, so those rules should only be used with trusted services and with narrow methods and paths.
The protocol is specified in writing, with a conformance test suite. The main repository, external-sandbox, was created on October 9, 2026 and had 39 stars on November 20, 2026, according to the GitHub API; Quicksand had 428. These are young projects.
What does the sandbox see depending on the agent that uses it?
This is the detail that changes the picture most. The pattern is the same, but each agent connects in a different way, and that decides what stays inside and what stays outside.
- Claude Code only sends its Bash tool commands to the sandbox, through the
CLAUDE_CODE_SHELL_PREFIXvariable. Its native read and edit tools keep working directly on the Mac’s files. - Codex connects through its
exec-servermechanism, a JSON-RPC server, and sends both processes and file operations, includingapply_patch. It is launched indanger-full-accessmode so it does not stack its own sandbox on top of the external one. - Pi replaces its shell, read, write, edit, search and list tools with an extension. If it is launched without its built-in tools and the extension does not load, Pi is left without tools; if the sandbox does not respond, they return an error instead of running on your machine.
That last behavior is the one I would want by default in any agent: fail closed.
There is another practical warning: Codex mode depends on a protocol the document itself calls experimental, and its tests pass against Codex CLI 0.164.0. Other versions may need verification.
The two architectures, side by side
The table is my reading of the two documents. Neither compares its design with the other, and no third party has measured both.
| Codex (OpenAI) | External sandbox (Prime Radiant) | |
|---|---|---|
| Where the command runs | On your system, with its native tools | On a guest Linux on the same machine: WebAssembly, container or QEMU |
| Mechanism | Seatbelt, bubblewrap with seccomp-bpf, MXC | v86, Apple containers, Quicksand |
| Default reads | Broad, with the user’s permissions | Only the mounted folders (except Claude Code’s native reads) |
| Default writes | Workspace; .git and .codex read-only | Read-write mounts you choose (except Claude Code’s native edits) |
| Default network | Disabled | Disabled |
| Limited network | Per-domain proxy, DNS after deciding | Per-host and per-HTTP-method proxy |
| API secrets | Not described in the article | Credential substitution in the proxy |
| Agents | Codex, and any tool via codex sandbox | Claude Code (Bash only), Codex, Pi |
| Stated maturity | Part of current Codex | Unaudited experimental prototypes |
What they share seems more important to me than what differs. Both deny the network by default, both use a proxy as the way to grant limited network access and both let the user decide which folders are writable.
The underlying difference is compatibility versus isolation. Codex stays in your environment so it does not break native toolchains, and pays with broad reads. The external sandbox isolates more, and pays with a different Linux: according to its authors, a node_modules or a .venv built for macOS may have to be reinstalled inside.
What each document admits it does not cover
This is the section I would make anyone who deploys agents read, because both texts point out their own gaps.
OpenAI acknowledges that the default profile leaves sensitive files outside the project readable, such as configuration files with API keys. If a process can read, for example, ~/.aws and also has an allowed network exit, the per-domain proxy is the only thing left between that data and the outside.
Its subtlest example is the node_modules one. The agent, inside the sandbox, writes malicious code into a local copy of Prettier.
Git does not show it because that folder is usually ignored. When the editor formats on save, that code runs outside the sandbox.
The sandbox did its job and the damage still got out. That is why OpenAI insists that isolation is one layer and not the complete answer.
There are more limits in its text.
On Linux and Windows, exclusion patterns are expanded when each command starts, so a new matching file is not protected while the command runs. Broad wildcards or access to DNS services can still allow exfiltration over DNS. And stdio MCP servers start without a sandbox unless you wrap them.
On macOS, in addition, the sandbox-exec man page marks it as deprecated. OpenAI says it will keep using Seatbelt, as Chrome and Chromium do, but the piece depends on a profile language Apple does not document for third parties.
Prime Radiant is even more direct about its own work. It calls the three implementations experimental prototypes that have not been through an audit that would justify using them with sensitive workloads.
A folder mounted with write access can be wrecked just as easily from inside, so they recommend keeping it under version control and mounting as much as possible read-only. With Claude Code, in addition, native reads and edits do not go through the sandbox.
The protocol specification adds a limit worth reading twice: the conformance suite is an interoperability test, not an isolation test. DNS rebinding, resource exhaustion and races on the host file system need separate security testing.
It also says that web terminal tokens do not authenticate local command-line processes. In other words, the API only listens on localhost, but any local process can talk to it.
Neither design solves prompt injection. They only limit what an injected command can reach.
Willison has long described that dangerous combination as the lethal trifecta: private data, untrusted content and the ability to communicate externally. Cutting the network by default attacks the third leg.
What would I review in a team that already uses agents?
You do not need to pick a side to get something useful out of this week. These are the questions I would ask, in this order.
- Which agent tools go through the sandbox and which do not? With Claude Code and the external pattern, only Bash. With Codex, stdio MCP servers stay outside unless you wrap them, and it is worth writing that down agent by agent.
- What can a command read outside the project? List the files with secrets on a typical development machine and decide which ones need an explicit deny rule.
- Which files written by the agent will something else run later? Git hooks, editor configuration, local dependencies and CI scripts. Codex protects
.gitand.codexby default; the rest depends on your profile or your mounts. - Does the network go out through a single proxy with an allowlist? With limited methods when possible, and with credentials injected in the proxy instead of in the agent’s environment.
- What happens if the sandbox fails? The right behavior is Pi’s with its extension: an error, not silent execution on the host.
My conclusion is modest: neither article shows that its sandbox withstands an attack. Prime Radiant says so explicitly; OpenAI admits that, even with the sandbox, harmful actions remain possible.
What they do make clear is where each boundary sits, and that is already more than many teams have written about their own agents.
Sources
- Prime Radiant, External sandboxes for coding agents, November 16, 2026.
- Simon Willison, External sandboxes for coding agents, November 17, 2026.
- OpenAI, Inside the Codex sandbox, November 18, 2026.
- Prime Radiant, External Sandbox protocol, revision 1.
- Microsoft, Quicksand.