External sandboxes for coding agents

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Developers running coding agents like Claude Code, Codex or Pi can now isolate executed code in a sandbox, so prompt injection or model mistakes can't damage the host machine.

Read this as

Simon Willison, working with the research lab Prime Radiant, published a way to let AI coding assistants run code safely. Three open-source 'sandbox' servers run the AI's code in a sealed-off mini-computer, for example, Alpine Linux inside Apple Containers, while the AI itself stays outside. The sandboxes include a proxy that restricts which websites the code may contact and can supply secret passwords without ever showing them to the AI. This protects people running local AI models from prompt injection attacks or simple mistakes.

Willison and Prime Radiant released three interchangeable sandbox servers (external-sandbox-v86, external-sandbox-container, external-sandbox-quicksand) exposing one identical localhost API. Any team using coding agents like Claude Code, Codex or Pi can point them at a sandbox to contain untrusted code execution, cutting the risk of prompt injection causing real damage. Network access is controlled through an allow-list proxy with credential replacement, so agents never hold secrets. Adoption is optional but cheap; competitors building agent-safety tooling lose some differentiation.

The 'external sandbox' pattern places the agent outside the sandbox while its code executes inside one. Three implementations share a single localhost API: external-sandbox-v86 (Node.js running Alpine Linux in WebAssembly via v86), external-sandbox-container (Python server using Alpine Linux in Apple Containers), and external-sandbox-quicksand (Python using Microsoft's Quicksand library, which bundles QEMU and Alpine). Sandboxes include an HTTP/HTTPS allow-list proxy with a live reconfiguration UI and a credential replacement mechanism for authenticated API calls without exposing secrets to the agent.

Questions this answers

The article above answers these:

  • How do I sandbox code executed by Claude Code or Codex?
  • What are the external-sandbox-v86 and external-sandbox-quicksand servers?
  • How can an AI agent call authenticated APIs without seeing my secrets?

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Simon Willison Prime Radiant Superpowers v86 Quicksand Apple Containers Datasette

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading