Skip to content

Clean room: wall the headless run in with --restricted and the shell sandbox - #422

Merged
allens merged 2 commits into
mainfrom
cleanroom/session-sandbox
Oct 16, 2026
Merged

allens merged 2 commits into
mainfrom
cleanroom/session-sandbox

Conversation

@allens

@allens allens commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Walls the headless clean-room run in, instead of relying on the brief and the transcript audit alone.

Each build now writes session-settings.json beside the clean room, where the session can't reach it to loosen it (sessionSettings). It also prints the run command for its role and platform (runCommand).

What the walls do

  • --restricted confines the file tools to the clean room, plus a backup's fixtures through --add-dir. It loads no user settings, so a user-level additionalDirectories can no longer make a folder in home a working directory of the session.
  • The shell sandbox, on Linux, WSL and macOS, blocks reads of the home folder outside those directories. It also blocks every host but *.amazonaws.com, for every command and every program the session runs. Windows has no shell sandbox, so there the brief and the audit remain the guard.
  • The classifier note. --restricted also drops the user's autoMode.environment, so the settings name the bucket themselves. Without that, a backup's closing empty is refused.
  • The tool list. --tools names what past runs used, because --restricted drops every command tool it doesn't name.

Tested

In WSL, with Sonnet 5.5 sessions:

  • A real backup build. The fixtures were readable by Read and by the shell, and boto3 reached the bucket. The settings file, ~ and pypi.org were all refused.
  • The user's extra working directory. It was readable without --restricted and refused with it.
  • Emptying a probe prefix in the backup bucket went through with no classifier denials.

npm test passes, and so do format, lint and typecheck.

Not yet run: macOS, and a Windows build with the new command.

🤖 Generated with Claude Code

…sandbox

Each build now writes session-settings.json beside the clean room, and
prints the run command for its role and platform, which passes it with
--settings.

- --restricted confines the file tools to the clean room (and a backup's
  fixtures, via --add-dir) and loads no user settings. A user-level
  permissions.additionalDirectories had made a folder in home a working
  directory of every clean-room session.
- On Linux, WSL and macOS, Claude Code's shell sandbox blocks reads of the
  home folder outside those directories, and any host but
  *.amazonaws.com, for every command and every program the session runs.
  Windows has no shell sandbox, so there the brief and the audit remain
  the guard.
- --restricted also drops the user's autoMode.environment, so the
  settings name the bucket to the classifier, or a backup's closing empty
  is refused.
- --tools names what past runs used, since --restricted drops every
  command tool it doesn't name.

Measured in WSL with Sonnet 5.5 sessions:
- A real backup build: the fixtures were readable by Read and the shell,
  boto3 reached the bucket, and the settings file, pypi.org and home were
  all refused.
- The user's extra working directory: readable without --restricted,
  refused with it.
- Emptying a probe prefix in the backup bucket: no classifier denials.

Not yet run: macOS, and a Windows build with the new command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@allens-claude-reviewer allens-claude-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review (/code-review high, Opus 5.5): nine findings, most severe first. The first two would stop a run on a platform this PR hasn't tested.

Comment thread scripts/cleanroom/cleanroom.mjs
Comment thread scripts/cleanroom/cleanroom.mjs
Comment thread scripts/cleanroom/cleanroom.mjs Outdated
Comment thread scripts/cleanroom/cleanroom.mjs
Comment thread scripts/cleanroom/README.md Outdated
Comment thread scripts/cleanroom/cleanroom.mjs
Comment thread scripts/cleanroom/cleanroom.mjs
Comment thread scripts/cleanroom/build-backup-cleanroom.mjs
Comment thread scripts/cleanroom/cleanroom.mjs Outdated
- ENVIRONMENT.md (off Windows) says requests leave only through the
  proxy HTTPS_PROXY names: a program that ignores the proxy variables
  can't connect at all under strictAllowlist.
- The backup handover says to install boto3 outside the home folder,
  which the sandbox hides.
- Windows runs get PowerShell and no Bash, which is Git Bash there and
  ruled out by the brief.
- The WebFetch/WebSearch deny list is gone: a probe showed --restricted
  with this --tools list already leaves the session no web tools.
- The settings comment no longer claims the file is out of reach on
  Windows; the code comments keep only the traps, and the README the
  reasoning; the build's listing names session-settings.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@allens
allens merged commit d54b483 into main Oct 16, 2026
12 checks passed
@allens
allens deleted the cleanroom/session-sandbox branch October 16, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant