ADR: Coding lanes run in a sandbox on WickedAwsome
Status: accepted, 2026-12-01, at 1.0.5.244. Committed from inside the sandbox by its first lane, the canary; from this version a TheYard coding lane the dispatcher starts runs in a locked container instead of on the box itself.
Reading list
Read on 30 November and 1 December 2026.
- ADR: One traffic cop for main: a lane pushes
ready/<lane>-<sha8> and the cop numbers it; the sandbox changes who pushes, not how a version lands.
- ADR: Commits on main are signed in the promote job: what the promote job holds while it runs a commit's own scripts.
- anthropics/claude-code,
.devcontainer at 4bac1f5489fbef3c7c769d55e16cce2ea06d9e3c: a non-root user and a firewall inside the container. The first was taken; the firewall was not (Decision 3).
- Milan Jovanovic, "Claude Code in a sandbox", a LinkedIn post: the one that started this.
In plain words
Claude writes most of this site's code, in sessions a dispatcher starts on one machine at home, WickedAwsome. Until this version each session ran as the machine's own user, so it could read everything that user can: the Azure sign-in for the whole subscription, the GitHub sign-in with write rights to every repository, the site's admin key and the job hunt's mail and storage secrets. Nothing had gone wrong. But a session that reads a hostile web page or installs a hostile package can be told to do things, and the only limit was what that user could reach.
Now a coding session runs in a fresh container that holds one copy of this repository and a few files it was given, as a user with no rights, on a network whose only way out is a proxy that lets through seven named hosts. It holds no Azure sign-in, no GitHub token and no git credential. When it is ready to ship, it leaves its commit in a folder, and a small program on the host checks it and pushes it.
What that is worth: a developer gets an AI coding setup where the worst a confused or hijacked session can do is spend its own model time and write a commit that still has to pass the gate; the organization gets the same speed with the keys kept out of the room.
Context
- Every lane was root on the box, measured 30 November. Docker ran as the root daemon and the box's user was in the docker group, which is root on that machine. Rootless Docker replaced it on 1 December: the root daemon is disabled and the user is out of the group.
- A write credential in the container would have been a path to every secret. The gate runs each pushed
ready/** branch from that branch's own workflow file, so a token that can push could also push a workflow that names any repository secret.
- A firewall inside the container was weaker than it looked. An address allowlist lets through every site that shares a CDN address with npm, open DNS is a way out, and it needs NET_ADMIN and sudo in the container. Under rootless Docker it was also unproven on this kernel.
- The share every prompt reads, J:, cannot be mounted into a rootless container (it is a FUSE mount only its user can read), and much of it is job hunt material that has no business in a public repository's commits.
Decision
- Rootless Docker, a fresh container a lane. The dispatcher runs a sandboxed item through
sandbox_run.py, which clones this repository fresh, starts the container with --cap-drop ALL, no-new-privileges, a pid and memory limit, no Docker socket, no host network and no published port, as uid 1000 inside (a sub-id that has rights outside only on the lane's own copies, given by ACL), and exits with the session's own exit code.
- No credential inside. No Azure CLI, no gh, no sqlpackage, no ssh client, no git credential. The repository is public, so it fetches over HTTPS with none. The only secret passed in is the Claude session's own token, by name, never written down.
- The network is closed outside the container. Each lane gets an internal Docker network with no route out, and one squid proxy on it that allows CONNECT to port 443 of the hosts below, matched by name before any lookup, and refuses any name that resolves into a private, shared, link-local or loopback range. Every request, allowed or refused, is logged and kept with the lane's notes. There is no DNS inside: a name the proxy does not allow is never looked up.
- The host does the four things that need a sign-in, through one relay with fixed actions. Push one commit as
ready/<lane>-<sha8> and open the gate's pull request; read the cop's status, the gate run and main for that lane's commits; fetch a red gate's log; publish a schema change to a target pinned on the host. Each request's names, shas, paths and sizes are checked against fixed patterns; the relay runs no script from the repository and no git inside the lane's workspace. It refuses a commit that touches .github/ (but for raising the byte budget numbers in .github/byte-budgets.json, which a test reads and no workflow runs; a new record's menu entry needs one), a gitlink, more than one commit on main, or another lane's branch name.
- The lane sees copies, not the share. A short extract of the rules, its own notes folder read-write, and the files its prompt names under the mentor and tools folders, read-only. A file whose name holds key, secret, token, password or credential is never copied, whatever names it; every named path that was not copied is listed for the lane with its reason. The dispatcher's own state for the lane (the files it restarts a lane from) is never visible inside.
- A switch, read at every start.
"sandbox": "off" | "canary" | "on" in the dispatcher's policy. off is the old start exactly; canary sandboxes only an item marked Sandbox: yes; on sandboxes every TheYard coding item except a heal, an item that needs the box's browser, and one that says Sandbox: no - <reason>. A sandboxed item whose sandbox does not start waits and is retried; it never falls back to the host.
Consequences
- What stops being true: that a coding session can read the box's keys. Proved on 1 December by a script that runs a throwaway lane and checks each wall from inside it: 35 checks, 35 passed. The gate's suites on SQLite ran on the host and inside with the proxy enforcing, from one commit, with the same counts: 1,756, 727 and 3,073 .NET tests, 969 Vitest tests and 425 browser tests, none failed. The list of hosts was read off the proxy's log of two full runs, and everything else they asked for (the browser's own background calls, telemetry, Azure's metadata address) was refused without a test noticing.
- What stays open, said plainly. The gate. A lane's commit is tested by the gate, so its code runs there: the Cosmos DB job signs in to Azure as the deploy identity, and the promote job holds the promote token while it runs a script from the commit. The sandbox does not close that; a proposal to give the ready-branch gate a read-only identity waits for a decision. The session's own token is inside the container, so a hostile package there could copy it; its reach is the plan's usage. A listed host is not proof against misuse of that host: GitHub and the package registries accept uploads from anyone with an account, and the container holds none. The schema relay is proved with a stand-in sqlpackage only; its first real use is a later lane's. What a lane writes in its notes still reaches the operator's daily card.
- The cost: two images and one clone a running lane on the box's disk; nothing new in Azure. An image build took three to five minutes on 1 December.
Where it sits
Outside the rings: the machine the code is written on, not the code. It serves least privilege at the edge of the development loop: each lane gets what its one task needs and the host keeps the rest. A change to the gate's identities, or a need the relay does not cover, is what would change it.
Files
The sandbox's definition lives on the box, not in this repository: the Dockerfile and proxy, sandbox_run.py and relay.py, their tests and the walls script. This repository holds what a sandboxed lane works by:
CLAUDE.md, Shipping, "From the sandbox": the steps a sandboxed lane ships by, through the relay.
.github/byte-budgets.json: the one file under .github/ the relay lets a lane change, and only by raising its byte numbers.
Enforced by
Not machine-checked. Held by review.