Coding Agents · [ 3 min read ]

External Sandboxes Keep Coding Agents Out of Harm's Way

Three open-source sandbox servers from Simon Willison and Prime Radiant run agent code in Alpine with an allow-list proxy, shielding against prompt injection.

Key findings

  1. Three sandbox servers released: external-sandbox-v86, external-sandbox-container, and external-sandbox-quicksand
  2. All three implementations expose the same localhost API for code execution
  3. Pi, Claude Code, and Codex can be configured to route code execution to the sandboxes
  4. Optional HTTP/HTTPS allow-list proxy controls which hosts agent code may contact
  5. Credential replacement mechanism makes authenticated API calls without sharing secrets with the agent
External Sandboxes Keep Coding Agents Out of Harm's Way
Pexels / pixabay

Three new open-source sandbox servers landed today, all built around one idea: the agent stays on your machine, the code it runs doesn't. Simon Willison published the work with Prime Radiant, the AI research lab behind Superpowers, introducing what he calls the external sandbox pattern. Code executed by the agent runs inside a dedicated sandbox. The agent itself lives outside it.

The motivation is blunt: prompt injection and plain model mistakes. Willison says he's been exploring ways to make it safer to try local models "without worrying that a mistake or prompt injection attack might cause them to take damaging actions on a machine." That's the threat model. Nothing more exotic.

What shipped?

Three server implementations, each exposing the same localhost API:

  • external-sandbox-v86 — a Node.js server that uses v86 to run Alpine Linux inside WebAssembly.
  • external-sandbox-container — a Python web server running Alpine Linux inside an Apple Containers instance.
  • external-sandbox-quicksand — another Python web server, this one on Microsoft's Quicksand library, which bundles QEMU and Alpine Linux into a single Python package.

Same API across all three. That's the interesting design decision. Swap the isolation backend — WASM emulator, Apple container, QEMU VM — without touching the client.

What does this change for Claude Code, Codex, and Pi users?

You can configure Pi, Claude Code, or Codex to send their code-execution calls to any of these sandbox servers instead of running commands on your host. No fork of the agent required, if your tool supports pointing execution at an endpoint. The three named agents already do.

Network egress gets its own controls. Each sandbox includes an optional HTTP/HTTPS allow-list proxy, so you decide exactly which hosts the agent's code may contact. There's a UI for reconfiguring that proxy while the sandbox is still running — policy JSON editor, allowed destinations list, and a recent proxy activity view.

The credential story is the quieter win. A credential replacement mechanism lets the sandbox make authenticated API calls on the agent's behalf without ever sharing the secret with the agent. Your API keys stay outside the model's reach, and injected instructions can't exfiltrate what the sandbox never received.

The caveats

n Be honest about what this is. It's an experiment, not a product. Willison frames it as fascination, not a finished security boundary: "I continue to be fascinated by the challenge of safely running untrusted code. This external sandbox pattern provides a neat way to experiment with different approaches." Experiment is the operative word.

Note what's not said. There are no benchmarks, no formal isolation guarantees, and no claims about hardened releases. Emulation via v86 in WebAssembly will be slow for heavy workloads. Apple Containers locks the container option to Apple hardware. Quicksand is the most portable of the three on paper, but it inherits whatever maturity QEMU-in-a-Python-package currently has.

Still, the pattern itself is the contribution. Moving execution out of the agent's process — and out of the agent's trust boundary — kills a whole class of "the model ran rm -rf with my permissions" failures. The allow-list proxy plus credential substitution handles the network side. Together they cover the two main damage vectors: filesystem actions and data exfiltration.

For anyone running local models with coding agents attached, this is worth an afternoon. Clone one of the three repos, point your agent at the localhost API, and see how much of your workflow survives inside Alpine. If a weaker model prompt-injects itself into mischief, the blast radius is a throwaway sandbox, not your home directory.

blog.primeradiant.com (Original)

Price tags

Share this article:

More from Priya Raman

Priya Raman

Show full bio

Staff writer covering technology and product news in AI-coding movement at Vibe Coder.

26 articles

Adjacent departments

Next article »