Repository navigation
Trials P-59 and P-60: the read tools held to their folder, and a tarball's one redirect to codeload - #532
Conversation
…en both flags On a GitHub Linux runner with bubblewrap and the scrub, as the run job has them, the pinned CLI given --tools Read,Grep,Glob --allowedTools Read,Grep,Glob --permission-mode dontAsk --restricted --setting-sources "" refused every read outside its folder: absolute, .., three links, /proc/self/environ, its parent's environ, /proc/self/cwd, /proc/self/root and the home directory. The folder's own .claude settings did nothing and its CLAUDE.md was not sent. Without the two flags, the same settings ran two hooks and a key helper, opened the outside reads, and Grep read the CLI's own environment. tools/trial_p59_read_confinement.sh runs it in the canary alone, against P-50's stub, which now answers a list of calls from calls.json when one is there and logs markers by name alone; with none it is P-50's stub as it was. The fixture is trials/P-59.json, and the design's section 6 has its row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…59's mutants Asked with no credential, the API answered a tarball of a canary commit 302 to codeload.github.com, under the repo's path and the commit, with no token in the Location; codeload answered it, with no Authorization header, 200, a gzip with no content-length whose tar opens with a pax global header naming the commit. No codeload address over HTTPS redirected; plain HTTP answered 301 to HTTPS. For a commit it does not hold the API still answers 302 and codeload 404. The fixture keeps the archive, for 0138's tests to unpack. P-59's mutants: one for each part of its condition, each flag, and two for the stub's script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The reads' fix round, and the trial run again in the canary: - every call that reaches outside the folder must be an error, an outside file is named for its marker so a listing shows it, and a marker that reaches the model anywhere, not only in a tool result, counts; - every request's tools are judged, not the first one's alone; - the /proc/self/cwd probes go through links, which a path's normalising cannot turn into a file that is not there; Grep and Glob are asked through the links and of the parent's environ too; - each flag is also run alone. --restricted alone held every read; --setting-sources "" alone kept the settings out and held no read, since with the scrub set the allowed tools, named without a path, read anywhere, and Grep read the CLI's own environment; - the stand-in CLI covers a refused inside read, a Task ended early, Bash answered, a write that lands quietly, a tool offered late and a marker sent beside the task, each with a mutant; refusals run in an environment of their own and nothing is left in TMPDIR; - the P-60 test reads each codeload address parsed, the capitals and the branch exchanges, and holds headers to lower case; - the stub's docstring names the Maintainer's decision, not issue 517. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Maintainer's ruling of 2026-11-04: pythonsecurity:S5131 on tools/trial_p50_stub.py is a false positive, waived in code rather than in SonarCloud. The stub answers the pinned CLI on 127.0.0.1 alone, with a json.dumps body sent as application/json. It is set aside for that one rule and that one file, as python:S5332 already is. The stub is not edited: P-59's fixture holds its blob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|



Refs #537. Trials P-59 and P-60, both pass. They are the evidence for the design in which the review Role reads a pull request's head. That design's record, 0138, is not in this pull request.
P-60: a commit's tarball is one redirect to codeload
The Maintainer approved "Tarball, allow codeload" on 2026-11-04. P-60 records what that redirect is, with every request made without a credential against the public canary:
GET /repos/{canary}/tarball/{sha}, following no redirecthttps://codeload.github.com/{owner}/{repo}/legacy.tar.gz/{sha}, with no token in the Locationapplication/x-gzip, 4,337 bytes, with nocontent-length. The tar opens with a pax global header whose comment is the whole commit sha, then one folder holding only directories and regular filesWhat 0138 takes from this:
content-length.The fixture keeps the archive's bytes in base64, so 0138's tests can unpack exactly what GitHub served.
Owed: what codeload's Location holds for a private repo read with an App's token. A live Run on a private head waits on it; the eval doesn't, because its cases' repo is public.
P-59: the read tools alone, held to their folder
The question. On a GitHub Linux runner, with bubblewrap and the subprocess scrub set as the run job sets them, is the pinned CLI (2.1.306), given only the read tools, held to its working folder?
.claudesettings,CLAUDE.mdorAGENTS.mdtake effect?How it ran. In the canary, run 41772353972, after the reads' fix round, with no secret and no model: a stand-in model, P-50's stub, ran on the runner itself. The CLI was installed by its checksum, as the run job installs it, and no sysctl was changed. The run before the fix round, 41756788469, also passed; it is kept in the fixture and superseded.
The configuration a review Run would be given:
--restrictedalone--setting-sources ""alone.., three links,/proc/self/cwdthrough links,/proc/self/root, the home directory, by Read, Grep and Glob/proc/self/environand the parent's environ, by ReadapiKeyHelperCLAUDE.mdandAGENTS.mdsent to the modelThe verdict is decided by the engine configuration alone; the other three are recorded.
What the four configurations show:
--restrictedis what confines the reads.--setting-sources ""alone holds no read. With the scrub set, the CLI forces the permission mode back to its default, and the allowed tools, named without a path, then read anywhere.The trial's other findings:
/procreads, since a Mac has no/proc.What this pull request changes. Every row below that mentions P-59 is new.
tools/trial_p59_read_confinement.shtools/trial_p50_stub.pycalls.jsonstands where the stub runs, it answers those calls in turn, and logs the tools it offered and the markers each result held, by name only. Without that file it behaves exactly as P-50's stub did, and itscheck_repoallowlist is unchangedtrials/P-59.json/home, the second superseded by the fix round, and the third the trial's run; that run's job, the three files as they ran, the log, and the analysis. Each file the canary ran has the same git blob as the file intools/tests/test_tools.pyReadConfinementTrial: a stand-in CLI that holds the reads to the folder under--restricted, and keeps the settings out under either flag, as the pinned CLI did, plus flags that make each part of the condition fail on its own. One test covers the stub's scripted mode, and one re-reads the fixture's analysis from its logtrials/P-60.jsontrials/AGENTS.mdtrials/AGENTS.mdP-59's rules with the test that holds each. A test re-reads P-60: the one redirect, codeload's answer with no Authorization header, the tar's pax comment and its members, and no redirect from codeload over HTTPStools/mutants.pyGrounding. No rule in
sim/grounding.pyasks this trial, so nothing is grounded.Canary, undone. The branch
trial/p-59is deleted. The three runs stay, as P-50's and P-51's did; their logs hold no secret, and the redactor removed one line, line 93.Removed from the fixture:
exchanges[1,3,5,6,7,8,9].request.headers.authorization, and line 93 of the log inexchanges[10].response.body.Verify
make verifypassed locally at710400a9. At5dd3c9ea, the fix round's head, it passed too.5dd3c9ea,make checkspassed, and so didReadConfinementTrialand both fixture tests.python3 -m tools.mutants tools/trial_p59_read_confinement.sh tools/trial_p50_stub.pykilled 19 of 19.checksand its 8 mutant shards.Reads
Argon, Muse Wonder Full, the Claude review and the security pass all read
490a36d. Every finding was fixed in5dd3c9ea, in part where its disposition says so, apart from one not changed. The fix round was not read again.490a36d490a36d490a36d490a36dtests/test_tools.py:5272is Truetests/test_tools.py:5314tests/test_tools.py:7973tests/test_tools.py:8041tests/test_tools.py:8065trials/P-59.json:5tests/test_tools.py:5264tests/test_tools.py:5267tests/test_tools.py:5293tests/test_tools.py:7966tests/test_tools.py:7983trials/P-59.json:5trials/P-60.json:46tools/trial_p59_read_confinement.sh:240tools/trial_p59_read_confinement.sh:245tools/trial_p59_read_confinement.sh:236tools/trial_p59_read_confinement.sh:245tools/trial_p50_stub.py:9tools/trial_p59_read_confinement.sh:186tools/trial_p59_read_confinement.sh:236tools/trial_p59_read_confinement.sh:240tools/trial_p59_read_confinement.sh:240tools/trial_p59_read_confinement.sh:243Bots:
5dd3c9ea. Each address is parsed withurllib.parseand its host compared whole.tools/trial_p50_stub.py:161: not a vulnerability. The stub answers JSON,Content-Type: application/json, on 127.0.0.1, to the CLI under trial. No browser reads it, and the content is the trial's own calls, which the script writes. The gate is not required. Marking it safe in Sonar is the Maintainer's to do.🤖 Generated with Claude Code