Skip to content

Turn the Claude Code sandbox off only for the ci-context read activity #14740

Closed

Description

@kyle-sexton

.github/workflows/pr-run-activity-read.yml sets sandbox: "false" on every read activity's run-claude-cli leg, at lines 1756, 1816 and 1866 as of b0a0df2. The stated reason, given under the opt-out decision in melodic-software/ci-workflows#1060, is that a ci-context skill gets bare Bash (collect-base-activity/action.yml around lines 507-513, allowed+=(Bash Edit Write Agent)) and may run npm ci or a test suite that reaches hosts beyond GitHub.

That opt-out also covers the read activities that do not need Bash beyond the sandbox. Meanwhile ci-context reads CI log content, which is untrusted text. With the sandbox off, prompt-injected log text could use Bash to reach any host. The claude-security-review lane raised this as IMPORTANT on melodic-software/pr-pipeline-sandbox#325 (thread).

Mitigations in place: the lanes run only for trusted authors' same-repository PRs, and WebFetch and WebSearch stay denied.

Done when

  • sandbox: "false" applies only to the activity whose skill needs hosts beyond GitHub (prepare: ci-context), and every other read activity runs with the default sandbox.
  • The PR states two things and cites the line for each: whether the subprocess env scrub keeps the Claude API key out of the Bash child, and whether setup-runner-isolation limits egress.
  • Afterwards, pr-pipeline-sandbox resyncs the workflow.

Activity

  1. added theissue type on Nov 9, 2026
  2. added
    needs-triage
    on Nov 9, 2026
  3. github-actions commented on Nov 9, 2026

    @github-actions
    Contributor

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Understood: in pr-run-activity-read.yml, the three run-claude-cli legs set sandbox: "false" for every read activity. You want that opt-out only where prepare: ci-context applies, with the default sandbox everywhere else. You also want the PR to state two things: whether the env scrub keeps the API key out of the Bash child, and whether setup-runner-isolation limits egress.

    The body and the refinement comment already give exact done-when criteria, so nothing is missing from the reporter. The mitigations you list (trusted authors only, WebFetch and WebSearch denied) make this hardening work, not an open high-severity hole. The workflow file is protected, so a builder session needs to take it. I found no open duplicate and no merged PR that already covers it. #14250 and #14286 are related: they changed the sandbox default and made a sandbox that cannot start fail the leg.

    Automated triage. A maintainer reviews it.

  4. added
    area: security
    on Nov 9, 2026
  5. melodic-automation-lanes commented on Nov 9, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: its body or a criterion names .github/workflows/pr-run-activity-read.yml, which the issue lane cannot push (patch-protected-path); a builder session takes it. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. melodic-automation-lanes commented on Nov 9, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: In pr-run-activity-read.yml, the three run-claude-cli legs set sandbox to false only when the activity's prepare mode is ci-context, and every other read activity uses the default sandbox.

    Acceptance criteria

    • In .github/workflows/pr-run-activity-read.yml, the sandbox input of all three run-claude-cli legs (API key, subscription token, fallback token; now lines 1756, 1816, 1866) is an expression that gives "false" only when steps.config.outputs.prepare == 'ci-context' and otherwise the default sandbox value.
    • No leg still sets a literal sandbox: "false"; grep for it in the workflow finds none.
    • The comment above each sandbox line says the opt-out applies only to prepare: ci-context, citing melodic-software/ci-workflows#​1060 and that ci-context reads untrusted CI log text.
    • The workflow still parses as valid YAML and passes the repository's workflow lint (actionlint/zizmor) if one is configured.
    • The PR description states whether the subprocess env scrub (CLAUDE_CODE_SUBPROCESS_ENV_SCRUB) keeps the Claude API key out of the Bash child, citing the file and line that set it.
    • The PR description states whether setup-runner-isolation limits egress, citing .github/actions/setup-runner-isolation/action.yml:49-67, which only removes sudo and docker access and sets no network allowlist.
    • Any workflow contract doc that says the read activities run with the sandbox off (for example docs/conventions/pr-pipeline/pr-run-activity.md) is updated to match.

    External state: none

    Dependencies

    • Resyncing the workflow into melodic-software/pr-pipeline-sandbox happens in that repository after this merges, so it is a follow-up and not part of this PR.
    • Other read activities must still work under the default sandbox. The recent pin bumps (#​14250, #​14286) made a sandbox that cannot start fail the leg, so a broken activity will show up as a failed run.

    Related work

    Sources read

    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/workflows/pr-run-activity-read.yml:1753-1756: first leg (api-key) sets sandbox "false" with the ci-workflows#​1060 comment; the same pattern repeats at 1813-1816 and 1863-1866.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/workflows/pr-run-activity-read.yml:1005-1017: ci-context, review-threads, dependency-review and merge-base are this file's prepare modes, so steps.config.outputs.prepare can tell ci-context apart.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/workflows/pr-run-activity-read.yml:1399-1403: the Isolate the runner step installs subprocess isolation only for kind == 'skill'.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/actions/setup-runner-isolation/action.yml:18-20: without CLAUDE_CODE_SUBPROCESS_ENV_SCRUB every Bash child inherits the OAuth token, and the scrub needs bubblewrap and socat.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/actions/setup-runner-isolation/action.yml:49-67: the action only removes sudo and docker access and sets no network egress limit.

    Automated refinement by the lanes App. Intake triages the issue again with it.

  7. added
    host-run
    on Nov 9, 2026
  8. kyle-sexton commented on Nov 18, 2026

    @kyle-sexton
    MemberAuthor

    Closing as completed. All three Done-when items have landed:

    1. Sandbox off only for ci-context. #17029 (merge commit c1a4cd8972023e0fe480f5584f620edbe2b8c067) changes all three run-claude-cli legs in .github/workflows/pr-run-activity-read.yml to sandbox: ${{ steps.config.outputs.prepare == 'ci-context' && 'false' || 'true' }}. Every other read activity now runs with the default sandbox. A new test in credential-legs.test.mjs evaluates the expression for each prepare mode and fails if a literal sandbox: "false" comes back.
    2. The two statements, each with its line cited. The fix(ci): turn the read runner's sandbox off only for ci-context #17029 body answers both, citing the lines at the ci-workflows pin. The env scrub does keep ANTHROPIC_API_KEY out of the Bash child on every leg (run-claude-cli/lane.cjs:466 and :468, plus the Claude Code env-vars scrub table). setup-runner-isolation does not limit egress; only run-claude-cli's sandbox settings do (lane.cjs:175, applied unless sandbox is false, :494).
    3. pr-pipeline-sandbox resync. melodic-software/pr-pipeline-sandbox#384 copies every SYNCED path, pr-run-activity-read.yml included, from claude-code-plugins at c1a4cd89, the fix(ci): turn the read runner's sandbox off only for ci-context #17029 merge commit. It merged through the sandbox merge queue as 4fb700257283679fd993eff3f904aeb5cb78806f.

    How it was checked:

    Left out:

  9. removed
    host-run
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: securityneeds-triage

    Type

    Fields

    Work status

    confirmed

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions