Repository navigation
Clean room: wall the headless run in with --restricted and the shell sandbox - #422
Merged
Merged
Conversation
…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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Walls the headless clean-room run in, instead of relying on the brief and the transcript audit alone.
Each build now writes
session-settings.jsonbeside 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
--restrictedconfines the file tools to the clean room, plus a backup's fixtures through--add-dir. It loads no user settings, so a user-leveladditionalDirectoriescan no longer make a folder in home a working directory of the session.*.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.--restrictedalso drops the user'sautoMode.environment, so the settings name the bucket themselves. Without that, a backup's closing empty is refused.--toolsnames what past runs used, because--restricteddrops every command tool it doesn't name.Tested
In WSL, with Sonnet 5.5 sessions:
~andpypi.orgwere all refused.--restrictedand refused with it.npm testpasses, and so do format, lint and typecheck.Not yet run: macOS, and a Windows build with the new command.
🤖 Generated with Claude Code