Skip to content
AI News HubLIVE
Original source2 min read

External sandboxes for coding agents

Summary

Simon Willison and Prime Radiant introduce the external sandbox pattern, where agent-executed code runs in a dedicated sandbox while the agent stays outside, releasing three server implementations supporting Pi, Claude Code, and Codex to safely test local models and defend against prompt injection.

External sandboxes for coding agents
Report an error

The correction channel is not available yet. You can copy the article reference below for later.

Correction instructions
Read article

External sandboxes for coding agents

Simon Willison’s Weblog

Newsletter

17th November 2026 - Link Blog

External sandboxes for coding agents. I've been exploring new ways to sandbox code that is executed by agents, with a focus on making it safer to try out local models without worrying that a mistake or prompt injection attack might cause them to take damaging actions on a machine.

I worked on this project with Prime Radiant, the AI research lab behind Superpowers and other projects.

My post on the Prime Radiant blog introduces the external sandbox pattern, where code executed by the agent runs inside a dedicated sandbox while the agent itself lives outside of that sandbox.

To demonstrate this pattern we've 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 which 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!

Each of these implementations offers the same localhost API. You can then configure Pi, Claude Code, or Codex to send API calls to that sandbox any time they want to execute code.

The sandboxes also include an optional HTTP/HTTPS allow-list proxy, so you can control exactly which hosts your agent's code is allowed to communicate with - plus a credential replacement mechanism to make authenticated API calls without sharing a secret with the agent. Here's the UI you can use to reconfigure that proxy while the sandbox is still running:

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.

Recent articles

Running the full server-side Datasette Python app in the browser with service workers and Pyodide - 17th November 2026

Locating the source of a mysterious beep with Claude - 9th November 2026

Hide your slop PR descriptions behind - 9th November 2026

Qwen 3.8 27B on my laptop can interpret model weights, too - 3rd November 2026

This is a link post by Simon Willison, posted on 17th November 2026.

sandboxing 59

security 646

ai 2,328

webassembly 137

generative-ai 2,066

llms 2,030

coding-agents 267

claude-code 136

codex 62

pi 7

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe

Disclosures

Colophon

©

2002

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

Key points and analysis

Article intelligence

EngineersAdvanced

Key points

  • External sandbox pattern: the agent lives outside the sandbox while the code it executes runs inside a dedicated sandbox, isolating risk.
  • Three implementations: external-sandbox-v86 (Alpine Linux in WebAssembly), external-sandbox-container (Apple Containers), and external-sandbox-quicksand (Microsoft's Quicksand library).
  • A uniform localhost API lets Pi, Claude Code, or Codex route code execution to the sandbox.
  • Optional HTTP/HTTPS allow-list proxy and credential replacement mechanism control network access and enable authenticated calls without exposing secrets to the agent.

Highlights and analysis are generated automatically and may contain errors. Check the original source.