Simon Willison releases three external sandboxes for coding agents

Simon Willison releases three external sandboxes for coding agents

Simon Willison has been exploring new ways to sandbox code that coding agents execute. His stated focus is making it safer to try out local models, without worrying that a mistake or a prompt injection attack might cause them to take damaging actions on a machine. He worked on the project with Prime Radiant, the AI research lab behind Superpowers and other projects.

His post on the Prime Radiant blog introduces what he calls the external sandbox pattern. Code executed by the agent runs inside a dedicated sandbox, while the agent itself lives outside of that sandbox. To demonstrate it, the two released three sandbox server implementations.

external-sandbox-v86 runs a Node.js server, which then uses v86 to run Alpine Linux inside WebAssembly. external-sandbox-container is a Python web server that runs the sandbox in Alpine Linux inside an Apple Containers instance. external-sandbox-quicksand is another Python web server, this time using Microsoft's Quicksand sandboxing library, which bundles QEMU and Alpine Linux in a Python package.

All three offer the same localhost API. Pi, Claude Code or Codex can then be configured to send API calls to the sandbox any time they want to execute code.

The sandboxes also include an optional HTTP/HTTPS allow-list proxy, which lets you control exactly which hosts the agent's code may communicate with. A credential replacement mechanism makes authenticated API calls possible without sharing a secret with the agent. The proxy can be reconfigured through a UI while the sandbox is still running.

Willison closes by saying he continues to be fascinated by the challenge of safely running untrusted code, and that the external sandbox pattern is a neat way to experiment with different approaches.

Key facts

  • The external sandbox pattern keeps the coding agent outside a dedicated sandbox and runs only the code it executes inside.
  • Three implementations were released: external-sandbox-v86 (Node.js, v86, Alpine Linux in WebAssembly), external-sandbox-container (Python, Apple Containers) and external-sandbox-quicksand (Python, Microsoft's Quicksand with QEMU).
  • All three expose the same localhost API, so Pi, Claude Code or Codex can be pointed at any of them for code execution.
  • An optional HTTP/HTTPS allow-list proxy limits which hosts the agent's code can reach, and a credential replacement mechanism avoids sharing secrets with the agent.
  • The project was built with Prime Radiant, with a focus on safely trying out local models.

Why it matters

Agents that run code can do damage on the host through a plain mistake or a prompt injection attack. Willison's answer is architectural: keep the agent outside and confine only the code it executes. Because the three implementations share one localhost API, the same setup can be tried on different isolation technologies (WebAssembly, Apple Containers, QEMU). Willison calls this a neat way to experiment with different approaches to running untrusted code.

Who it affects

People who run coding agents such as Pi, Claude Code or Codex on their own machines, especially those trying out local models. The container variant relies on Apple Containers, so it is aimed at setups that use them. Anyone building agent tooling and weighing sandbox designs is the other natural audience.

How to use it

Pick one of the three servers: external-sandbox-v86, external-sandbox-container or external-sandbox-quicksand. Start it, then configure Pi, Claude Code or Codex to send API calls to the sandbox's localhost API whenever they want to execute code. If you want to restrict network access, turn on the optional HTTP/HTTPS allow-list proxy and list the hosts the code may reach. The credential replacement mechanism lets authenticated calls work without handing the secret to the agent. The proxy can be reconfigured through a UI while the sandbox is running.

How solid is it

The source is Willison's own link blog post, which points to a longer post on the Prime Radiant blog. The implementations are released as demonstrations of the pattern. No security audit, benchmark, or performance figures for any of the three sandboxes are given, and the text does not say which implementation is recommended.

Risks and caveats

The source speaks of making things safer, not of being fully secure or escape-proof. The three sandboxes rest on different underlying technologies, and the post does not compare their strength. Safety also depends on configuration: the allow-list proxy is optional, so an unconfigured setup does not restrict which hosts the code can contact.

“I continue to be fascinated by the challenge of safely running untrusted code.”

— Simon Willison, simonwillison.net