Skip to content

ADR-0009: Sandboxes use the container CLI, and checks run in a fresh container

  • Status: Accepted
  • Date: 2026-12-01

Context

v0.6 lets agents do real work on a computer (SPEC-014). That work must be isolated from the user's machine and the network, and its result must be checked in a way the agent cannot influence. Options for isolation: run commands directly on the host (unsafe), a Python sandbox (too weak for shell commands), containers, or virtual machines (strongest, but heavy and platform-specific).

Decision

  • Use containers, driven through the docker (or podman) command-line program with argument lists, not a Python SDK. Docker Desktop and Podman work on Linux, macOS and Windows, and no new Python dependency is needed.
  • Lock the container down by default: no network, non-root, no capabilities, read-only root, small writable /work and /tmp, CPU, memory, process and time caps, and nothing shared from the host. v0.6 has no switch to loosen these.
  • When the agent is done, stop everything it started (its commands run as their own user), copy out its /work folder, remove its container, and run the checks in a new container that starts from those files. The checks are copied in only then.

Consequences

  • Users need Docker or Podman installed and running to use sandbox worlds; everything else in AgentPlay keeps working without it. doctor says whether it is ready.
  • An agent cannot read the checks, edit them, or leave a background process that changes files while they run.
  • Containers share the host's kernel: they are a strong boundary for honest mistakes and ordinary misbehaviour, not a guarantee against a determined attacker with a kernel exploit. The docs say to use a virtual machine for agents that are not trusted at all.
  • Starting containers takes a second or two per run, which is small next to model calls.
  • Tests that need a real runtime run in a Linux CI job with Docker; the rest use a fake runtime.