Simon Willison releases sandbox prototypes to restrict AI coding agents’ commands
The tools support Claude Code, Codex and Pi through a shared interface. But which actions stay isolated depends on the agent.
Listen to this story
The audio brief
Story brief
3 key pointsWillison’s prototypes make command execution—not necessarily the coding agent itself—the security boundary: users choose mounted folders and can keep network access closed or allow narrowly scoped requests through a proxy. Protection varies by integration: Claude Code’s Bash commands are sandboxed, but its native Read and Edit tools remain on the Mac; Codex and Pi route broader operations through the sandbox. A shared local API, protocol specification and conformance tester let developers build compatible alternatives, though Codex compatibility remains experimental.
- 01
external-sandbox-v86 runs Alpine Linux in a WebAssembly x86 emulator and requires Node.js 22.19 or later; the other options use Apple Containers or Quicksand with QEMU.
- 02
The proxy can replace placeholder credentials with real API keys, but an allowed service could return those credentials in its response.
- 03
Willison reports automated tests with Codex CLI 0.164.0 and a simulated model; the execution-server protocol is experimental, and other versions may need checking.
Coding agents can keep running on a developer’s Mac while sending commands into a separate, restricted Linux environment. In a November 16 release post, Simon Willison introduced three prototype tools for that setup, with integrations for Claude Code, Codex and Pi. The aim is to limit what an agent’s commands can reach without approving every action.
The starting problem is permission fatigue. Willison argues that asking people to approve every action slows work and encourages them to approve requests without fully considering them. The prototypes instead let users define which folders and network destinations commands may access before the agent gets to work.
The team considered putting the agent itself inside the restricted environment, but chose to leave it outside. Willison says this avoids situations where an agent changes its own immediate environment and makes the boundary easier to audit. “External” describes the sandbox’s relationship to the agent—not a requirement to use another computer.
One interface, three Linux environments
The release offers three compatible implementations rather than one required virtualization system. All expose the same local web API—the interface agents use to send work to the sandbox—so the supported agents and sandbox implementations can be mixed and matched.
- external-sandbox-v86 runs Alpine Linux through v86, an x86 emulator compiled to WebAssembly and hosted in Node.js. It is distributed through npm.
- external-sandbox-container uses a Python process to manage Apple Containers running Linux. Its setup requires an Apple silicon Mac and Apple’s container command-line tool.
- external-sandbox-quicksand uses Python, Microsoft’s Quicksand and QEMU to run a full virtual machine. QEMU and the Alpine image arrive as Python packages.
The shortest demonstration uses two terminal commands: one starts the v86 sandbox, and the other starts Pi with its sandbox extension. That route requires Node.js 22.19 or later. Users choose which folders to mount, with separate options for read-only access and permission to change files.
Different agents send different work
Codex routes process and filesystem operations through the sandbox, including its native apply_patch editing operation. Pi routes its command execution, reading, writing, editing and file-search tools there. The Pi setup disables its built-in tools so they cannot run locally if the extension fails to load.
Compatibility remains a prototype concern. Willison says automated tests pass with Codex CLI 0.164.0 using a simulated model, but its execution-server protocol is experimental. Other versions may need checking. The setup instructions also disable Codex’s own sandbox to avoid layering it inside the external one.
Network access starts closed
All three implementations default to no external network access. An optional proxy, which acts as a traffic gatekeeper, can allow HTTP and HTTPS requests only to specified hosts and with specified methods. That lets a policy permit reads from a service without permitting every kind of request to it.
The proxy can also replace placeholder credentials with real API keys held outside the sandbox. Code can then make authenticated requests without receiving the actual key. Willison cautions that an allowed service could echo a credential back in its response, so credential rules should cover trusted services and narrowly defined requests.
A browser interface provides a terminal, live network-policy editing and logs of allowed or denied requests. The release also includes a protocol specification and a conformance-testing tool, giving developers a defined interface to target when building another compatible sandbox.
Sources
- blog.primeradiant.comExternal sandboxes for coding agents
Reader comments
Newest comments first. Replies stay oldest first.