Repository navigation
fix(ci): turn the read runner's sandbox off only for ci-context - #17029
Conversation
The three run-claude-cli legs in pr-run-activity-read.yml set sandbox: "false" for every read activity. Only a prepare: ci-context skill gets bare Bash that may reach hosts beyond GitHub, so the legs now turn the sandbox off for that mode alone and keep run-claude-cli's default sandbox for every other read activity. A test pins the input on each leg, and the read runner contract says which legs run sandboxed. Closes #14740 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ndbox Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis 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. |
|
claude-review reviewed Code review: PR #17029, turn the read runner's sandbox off only for ci-contextNo findings. I read every hunk of the 4 changed files: the changelog fragment, What changed. All three
The new test evaluates each leg's expression with the shared evaluator in
Docs. Step 3 of the legs in Closing issue. The PR says Scope. Whether the sandbox is a sound security control (egress allowlist, how deny rules merge, how Spend. The change only affects runtime behaviour of lane runs; it adds no billed resource and no new spend. Loosened-check verdict: fail (no wrapper-supplied value; default used); patterns: 0. Nothing in the diff loosens a check: the sandbox is narrowed and a test is added. Verifier dropped 0 of 0 candidates. |
|
claude-security-review reviewed Security review: no issues foundI read all four changed files in full: the changelog fragment, What changed. Before this PR, all three Trust-control check. This narrows a control and widens nothing:
The The new test fails if a literal Spend. This adds no billable resources or paid-plan changes, so no cost hold applies. critical-findings: 0 |
Refs: #14740
Summary
pr-run-activity-read.ymlsetsandbox: "false"on all threerun-claude-clilegs (API key, OAuth token, fallback token), so every read activity ran Bash with no network limit. Now each leg turns the sandbox off only when the activity's prepare mode isci-context. Every other read activity runs run-claude-cli's default sandbox, which allows Bash network togithub.comandapi.github.com(see Risks for a documented widening byWebFetch(domain:...)rules). This tightens a control. No permission or deny rule changes.Fix
.github/workflows/pr-run-activity-read.yml: on all three legs,sandbox: ${{ steps.config.outputs.prepare == 'ci-context' && 'false' || 'true' }}. The line is identical on each leg, so Lane follow-ups: the automation-shape pass and six behaviour-preserving items #16966's credential-leg reusable can lift it as one expression. run-claude-cli'ssandboxinput takestrue,falseor empty, withtrueas the default (action.yml,sandboxinput). The comment above each line cites ci-workflows#1060 and notes that ci-context reads untrusted CI log text.credential-legs.test.mjs: a new test evaluates each leg'ssandboxexpression for every prepare mode this file runs (ci-context,review-threads,dependency-review,merge-base, none). It also fails if a literalsandbox: "false"comes back.docs/conventions/pr-pipeline/pr-run-activity.md, step 3 of the read runner's legs, now says which legs run sandboxed. No doc said the read activities ran with the sandbox off, so that refinement criterion needed no edit. Apr-pipelinepatch fragment records the change.install-subprocess-isolation: ${{ steps.config.outputs.kind == 'skill' }}, and only a skill reaches the legs.The two statements Done-when asks for
legEnvsets the key for the CLI, then turns the scrub on unconditionally:lane.cjs:466if (leg.leg === "api-key") env.ANTHROPIC_API_KEY = leg.value;andlane.cjs:468env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB = "1";. This is the pin all three legs use.ANTHROPIC_API_KEYas "Removes it" (env vars: What the subprocess environment scrub removes, read 2026-11-18). The same table keepsGITHUB_TOKENandGH_TOKEN, and run-claude-cli's steps set neither.setup-runner-isolation/action.yml:18-20as setting the scrub. That file only installs the bubblewrap and socat the scrub needs; run-claude-cli sets it.setup-runner-isolationlimit egress? No..github/actions/setup-runner-isolation/action.yml:22-72, bubblewrap and socat through apt, plus the AppArmor user-namespace sysctl) and "Remove sudo and docker access" (:77-92). Neither touches the network.lane.cjs:175network: { allowedDomains: ["github.com", "api.github.com"] },. The CLI gets those settings only whensandboxis notfalse(lane.cjs:494). So after this change, a ci-context leg's Bash still has no egress limit. Every other read activity's Bash goes through the sandbox's allowlist, which the local probe below measured as GitHub only.:49-67for this; on main those lines are inside the install loop.Verification
lane.cjsdoes: the same sandbox settings JSON, the scrub on,dontAsk,--restricted. It asked whether the read runner's--disallowedToolsdeny rules (Read(./.git/**),Edit(./.git/**), anEditdeny on a state directory) stop a wrapper script's file access once the sandbox is on. That is the shape the issue lane'sgit-readand the review-threads tool's write under.lane/feedback/state/rely on. Results:.git(git rev-parse HEAD) and wrote the denied directory.api.github.com, andexample.comwas refused withdeny network-outbound example.com:443, so the sandbox was active.WebFetch(domain:*)also allowed (--allowedTools, the form the issue lane'sweb-access: anystages),example.comwas still refused.claude-code scrub-mode stubs(.env,package.jsonand others, added to.git/info/exclude). They come from the scrub, not the sandbox, and they were there before this change.node --test --test-concurrency=4 .github/scripts/pr-run-activity-read/credential-legs.test.mjs: 10 pass, 0 fail, including the new test.actionlint .github/workflows/pr-run-activity-read.yml: no findings.scripts/check-affected.sh: 14 passed, 5 skipped, 0 failed. The first run failedchangelog-fragments; thepr-pipelinefragment fixed it..github/actions/resolve-config/callers.test.mjs. It importsajvfrom resolve-config's own dependencies, which are not installed in this checkout. It holds no assertion on this file'ssandboxinput. CI runs it.Install the skill's dependencies). A sandbox that cannot start fails the leg red (run-claude-clifailIfUnavailable), so a break shows as a failed run.Risks
The local probe ran Claude Code 2.1.327, and the legs run
cli-version: latest. On two points the probe and the sandboxing page (read 2026-11-18) disagree, and a later release could follow the docs:ReadandEditdeny rules: Block access to specific files or directories" and says "Paths and domains from both sandbox settings and permission rules are merged into the final sandbox configuration" (section "Permission rules"). If that applies to--disallowedToolsrules, two things fail red under the sandbox: the issue lane'sgit-read(the runner deniesRead(./.git/**)), and the review-threads tool's write of its replies file under.lane/feedback/state/(denied to the file tools). Either one fails the leg visibly. Neither weakens a control.WebFetch(domain:...)allow rules widening the network allowlist. The page says Claude Code "also pre-allows domains fromWebFetch(domain:...)allow rules" and honors a bare*(section "Hosts outside your allowed domains"). If that applies to--allowedToolsrules, the network limit widens to the activity's web-access hosts. For the issue lane (resolve-issue,web-access: domains: any,docs/conventions/pr-pipeline.yaml:428-430), that means any host. That is no wider than today'ssandbox: "false", and the file-write limits still apply.Remaining
.github/workflows/pr-run-activity-read.ymlat the merge commit into melodic-software/pr-pipeline-sandbox and runscripts/lanes/check-sync.sh <merge sha>there. Turn the Claude Code sandbox off only for the ci-context read activity #14740 stays open until that resync lands.Related
.github/workflows/pr-run-activity-read.ymlas a SYNCED path (scripts/lanes/check-sync.sh). No workflow there runs that check, and resyncs are hand-opened PRs, the last being ci: resync from claude-code-plugins at 80e02823 pr-pipeline-sandbox#373. No automation does the resync under Remaining.🤖 Generated with Claude Code