# External sandboxes for coding agents
<!--
ref: @content/web/simon-willison/2026-11-17-external-sandboxes-for-coding-agents
tags: [coding-agent-sandboxing, prompt-injection, local-models, alpine-linux, network-allowlist, credential-isolation, agent-tooling]
version: 2
updated_at: 2026-11-21T17:14:53.895Z
-->

**[Read the original](https://simonwillison.net/2026/Nov/17/external-sandboxes-for-coding-agents/)**


*Synthesized from Simon Willison's article on Simon Willison's Weblog, 2026-11-17.*

This short link post describes an "external sandbox" pattern for coding agents. The agent stays outside the sandbox while the code it generates runs inside a dedicated one, so that people can safely try local models without a mistake or prompt injection damaging their machine. Willison built the project with Prime Radiant, the AI research lab behind Superpowers.

## Core Thesis

Simon Willison argues that the agent should live outside the sandbox that runs its code. Keeping the execution environment separate limits the damage from a bad command or a prompt injection, and the same boundary can control network reach and keep credentials away from the agent.

## Key Insights

- **The pattern.** The agent "lives outside of that sandbox," and the code it runs executes inside a dedicated sandbox.
- **Three reference servers.** All three expose 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 that runs Alpine Linux inside an Apple Containers instance.
  - `external-sandbox-quicksand`, a Python web server that uses Microsoft's Quicksand library, which bundles QEMU and Alpine Linux.
- **Agent wiring.** Pi, Claude Code or Codex can be configured to send code execution requests to the sandbox.
- **Network allow-list.** The sandboxes offer an optional HTTP/HTTPS allow-list proxy that controls which hosts the agent's code can reach.
- **Credential replacement.** A replacement mechanism makes authenticated API calls without exposing a secret to the agent.
- **Live policy UI.** The post includes a screenshot of a UI for changing the proxy policy while the sandbox runs.

## Actionable Takeaways

- Run agent-generated code in a separate sandbox, such as one of the three servers, when trying local models.
- Configure the agent (Pi, Claude Code or Codex) to send execution requests to the sandbox's localhost API.
- Enable the HTTP/HTTPS allow-list proxy so the executed code can reach only the hosts you approve.
- Use the credential replacement mechanism rather than giving the agent a raw API secret.
- Pick the backend by platform: v86 for in-browser WebAssembly with Alpine, Apple Containers on macOS, or Quicksand for a QEMU-based VM.

## Notable Quotes

- "lives outside of that sandbox" Simon Willison, describing where the agent sits relative to the sandbox.

---

*Related: `@content/web/hacker-news/2026-11-18-mastra-factory` · `@content/web/github/2026-11-16-rust-anything` · `@content/web/github/2026-11-10-janestreet-agent-skills` · `@content/web/atuin/2026-10-27-atuin-threads` · `@content/web/github/2026-11-20-lot-map`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*