Trial P-26 (fail): the CLI's sandbox limits connections, but a tool reads the parent's environment

Merged
DO
3d ago
+1409-2

Trial P-26, by #188: can the model CLI's sandbox stop a tool reading the parent process's environment, and limit where it connects? It limits connections, but it does not hide the environment. The trial fails.

How it ran

The Maintainer ran tools/trial_p26_sandbox.sh at 2.1.306 at his own terminal on 2026-10-21, on the login of decision 0033. The script asks one Task twice under the sandbox settings a Run would be given:

  • the sandbox on, failing if it cannot start;
  • no command let out of it;
  • one allowed host.

The model had the shell alone, allowed one command: the script's own probe. The CLI held two fresh markers, one under a name nothing reads and one under ANTHROPIC_CUSTOM_HEADERS, a name on the CLI's credential list. Neither value is written anywhere.

What it showed

PartPlain (the sandbox alone)Scrubbed (the sandbox and CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1)
Allowed host, through the sandbox's proxy200200
Denied host, through the proxyrefused at CONNECT, 403refused at CONNECT, 403
Either host, around the proxynot reached: the name did not resolvenot reached
A write outside the work directoryrefusedrefused
The marker under a name nothing reads, in the tool's shellpresentpresent
The marker under a name on the credential listpresentabsent
A process above the tool, read by psnot read: the sandbox would not run ps (exit 126)not read

So connections are limited, but the sandbox passes the CLI's environment to the tool. With the scrub, the listed marker was gone and the unlisted one stayed. Not tried: the model credential's own name (planting it would replace the login), a Linux runner's /proc, and the files of the CLI's configuration directory.

What changes

  • trials/P-26.json. The answers keep no model text and the redaction removed nothing. The pass condition is at the script's top, committed before the run.
  • The design.
    • §6's P-26 row records the fail.
    • §4.9's first row says what the run showed and what was not tried, and what #188's "if no" asks: the first and third layers carry the weight, and no Run has a shell or network tool until P-26 passes.
  • The test. test_the_sandbox_limits_connections_and_passes_the_environment computes the fail from the script's own record.
  • The script, tools/trial_p26_sandbox.sh, is on this branch with its stand-in tests and eleven mutants. It was reviewed for security before the Maintainer ran it.

Owed, outside this pull request. #188's "if no" asks that #194's Done-when gain "no shell and no network tool for any Run, until P-26 passes". A comment on #194 asks its owner to add it.

Reviews and verification

  • make verify passed in the worktree, with history, at SIM_SEEDS=40.

  • A fresh Claude review with a security pass on 99428ab found no blocker and three majors. All are fixed in the fix round:

    • §4.9 claimed more than the run showed, and added a rule no check holds. It now says what was and was not tried.
    • #194's line was owed, and is now asked for on #194.
    • "That name alone" did not fit a three-line drop.

    Its minors are fixed too: the ps wording, the session's own words named, and the test recomputing each part from the record.

    • For a rerun, not changed here: the script counts an unread ancestors file as hidden. Here that did not change the verdict, since the environment itself was not hidden.
  • Muse: not run (the Maintainer, 2026-10-20: Kernel/hook only).

Closes #188.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added validation of sandbox environment isolation, filesystem and network restrictions, refusal behavior, output redaction, and cleanup.
  • Documentation
    • Documented the sandbox trial and its results. Network restrictions and filesystem confinement worked, but neither configuration fully hid the parent environment, so the trial failed.
  • Chores
    • Added checks that stop the trial when required setup conditions are not met.