Clean Room: a sandbox per agent
The Clean Room box of the hire and edit form (Claude Code agents only) runs the agent in a Docker container holding a copy of the project and the agent's own files, nothing else of your machine. Design: docs/clean-room-spec.md. Tested against real Docker with the stand-in agent, and by RSO and SIMSUP, real Claude Code consoles of the room that builds gonogo (What was not verified).
Needs
- Docker running (
docker versionsucceeds). - An image with Claude Code:
docker build -t ghcr.io/ulm0/gonogo .from a clone builds the default;GONOGO_CLEANROOM_IMAGEnames another. - A working directory inside a git repository.
The form and each start refuse with the reason when one is missing.
What it does
- The copy: at first start gonogo makes a git worktree
~/.gonogo/cleanroom/<name>on a new branchgonogo/<name>fromHEAD(uncommitted changes are not in it). The agent starts in the matching subfolder. gonogo never removes the worktree or branch. - The container:
docker run --rm -i -t --init --name gonogo-<name>-<hash>as your user, with--cap-drop ALL --security-opt no-new-privileges(no capability; setuid gains none; inside gonogo's own container it shares the network namespace, soNET_RAWorNET_ADMINwould reach it).claude,git,gh,npm installwork as before. gonogo runsdocker rm -fafter it ends and before every start. - Mounted at the same paths: only the worktree (its
.gitfile read-only) and~/.gonogo/agents/<name>/. Claude's home isagents/<name>/cleanroom-home/; your~/.claudeis not shared. - Passed by name (never on the command line): the agent's token and, if set,
CLAUDE_CODE_OAUTH_TOKENandANTHROPIC_API_KEY(asGONOGO_API_KEY); nothing else from gonogo's environment. - The console panel shows the branch and worktree under a
CLEAN ROOMchip.
The way back
git does not work inside the container. Commit and merge gonogo/<name> yourself:
git -C ~/.gonogo/cleanroom/<name> add -A && git -C ~/.gonogo/cleanroom/<name> commit -m ...
Run git at the worktree's top (as above) or from your repository, never from a subfolder of the worktree: the agent can plant a .git folder there that makes git run a program on your machine. Read the diff before you merge.
Reaching gonogo
- Hook and tool URLs use
host.docker.internal(--add-host host.docker.internal:host-gateway); the server accepts thatHoston those endpoints only. - gonogo must listen where the container can connect. Docker Desktop: the name reaches the host's loopback (per Docker's docs, not tried). Linux or VM: start with
--host 0.0.0.0(read Security first). - With gonogo itself in a container, set
GONOGO_CLEANROOM_NETWORK=container:<name>: the agent gets--network container:<name>and shares gonogo's network, wherehost.docker.internalis127.0.0.1.
Limits
- The box applies at the next start. A Clean Room console cannot be renamed (untick the box in the same edit to rename).
- Propellant does not count its tokens. Payload MCP servers run inside the container; skill folders are not visible there. The room's Payload defaults never reach it; only its own Payload does.
- Risk: Claude Code 2.1.325 refuses HTTP hooks to private addresses, and
host.docker.internalusually is one; hooks then do not arrive and the console does not follow the agent's work. Unproven either way (see the spec). WithGONOGO_CLEANROOM_NETWORKthe name is127.0.0.1, which Claude Code allows (not tried with a realclaude).
gonogo in a container (compose)
compose.yaml mounts the host's Docker socket, so Clean Room containers start on the host's Docker next to gonogo's (not Docker in Docker). The socket is root on the host for every agent in the container: see Docker.
GONOGO_DATA(absolute path, no path colon) andDOCKER_GIDare required by every compose command; without a shell put both in the stack's environment. The data folder (state/,claude/,projects/,home/) belongs to uid 1000 and is mounted at its own path, because the host's Docker resolves-vpaths on the host. Otherwise a start refuses withgonogo's home ... is not mounted into the container ... from the same path of the host. "The host" is where the daemon runs (a Lima or Docker Desktop VM counts).GONOGO_CLEANROOM_NETWORK=container:self(orcontainer:<name>) starts each Clean Room in gonogo's network and hosts file;extra_hostsmapshost.docker.internalto127.0.0.1(accepted for the hook and tool endpoints only). A Clean Room there reaches any port the container listens on, including a loopback server another agent started. Recreating gonogo's container breaks it: restart the console. Other networks are refused.group_addgives the user the socket's group; Docker Desktop may need anotherDOCKER_GIDor0(not tried). The image's/stateand/projectsvolumes are unused here (docker compose down -vremoves the two empty ones). The default Clean Room image isghcr.io/ulm0/gonogo.