External sandboxes for coding agents

Exploring a new design pattern that keeps coding agents safe by running their generated code in an isolated external sandbox.

2 min read

Diagram showing the external sandbox architecture, separating the coding agent from the isolated Linux VM and proxy network controls.
Architecture diagram illustrating how a coding agent communicates with an isolated Linux VM sandbox via a controlled local server.

Running coding agents safely remains a significant challenge, especially when experimenting with local models that might make mistakes or fall victim to prompt injection attacks where malicious instructions override the original prompt. To address this, a new approach isolates the code execution from the agent itself.

Key facts

AI Assistant used
Claude Opus 4.8

The external sandbox pattern

The core idea is to separate the agent from the environment where its code actually runs. The agent lives outside the sandbox, while any code it generates runs inside a dedicated, isolated environment. To make this practical, three different sandbox server implementations have been released, all sharing the same local application programming interface or API, which allows software systems to communicate with each other.

Available implementations

Each implementation uses a different technology stack to achieve isolation:

  • external-sandbox-v86 runs a Node.js server that uses v86 to run Alpine Linux inside WebAssembly.
  • external-sandbox-container runs a Python web server using Alpine Linux inside an Apple Containers instance.
  • external-sandbox-quicksand runs a Python web server using Microsoft Quicksand, which bundles QEMU and Alpine Linux into a single Python package.

Developers can configure tools like Pi, Claude Code, or Codex to direct their execution calls to any of these sandboxes.

Network controls and credentials

Safety features go beyond basic isolation. The sandboxes include an optional HTTP and HTTPS allow-list proxy, letting developers control precisely which external hosts the agent code can reach. Additionally, a credential replacement mechanism allows authenticated application programming interface calls to occur without sharing sensitive secrets directly with the agent.

Source: Original announcement

Worth a read?

Report

Comments