Skip to content

Commit bb981af

Browse files
committed
chore: disable sandbox in triage actions
1 parent e3ef3c2 commit bb981af

2 files changed

Lines changed: 34 additions & 16 deletions

File tree

.github/workflows/review-pr-action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,25 @@ jobs:
6666
# Read-only default token. The agent has no App token in this job.
6767
GH_TOKEN: ${{ github.token }}
6868
GITHUB_EVENT_NUMBER: ${{ inputs.pr_number }}
69-
# Claude Code's Bash sandbox (bwrap) masks `$HOME/.mcp.json` by
70-
# bind-mounting /dev/null over it, creating the target file first.
71-
# The runner's default HOME (/home) is not writable, so that aborts
72-
# with "bwrap: Can't create file at /home/.mcp.json". Point HOME at
73-
# the per-job writable temp dir so the sandbox stays enabled and
74-
# can create its mask target. Kept off the repo checkout (which
75-
# holds the read-only scripts/ dir) on purpose.
76-
HOME: ${{ runner.temp }}
7769
with:
7870
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_TOKEN }}
71+
# Disable Claude Code's Bash sandbox (bubblewrap). On the runner it
72+
# aborts every Bash command during setup with
73+
# "bwrap: Can't mkdir /home/.claude" (and, earlier, .mcp.json): the
74+
# sandbox builds an isolated home under /home inside its own bwrap
75+
# namespace and then cannot create files in it (upstream bug
76+
# anthropics/claude-code#17727). The /home path originates inside
77+
# the sandbox, not from the runner HOME, so no external HOME
78+
# override reaches it -- disabling the sandbox is the only
79+
# workflow-side fix. Isolation for this job is still enforced by:
80+
# the tight --allowedTools allowlist below (only specific
81+
# `bash scripts/*.sh` + Read + Write, no arbitrary Bash), the
82+
# read-only default token with NO App token in this job, the
83+
# `chmod -R a-w scripts` step above, and CLAUDE_CODE_SUBPROCESS_ENV_SCRUB
84+
# (auto-enabled by the action because allowed_non_write_users is set),
85+
# which strips the Anthropic API token from every subprocess env.
86+
settings: |
87+
{ "sandbox": { "enabled": false } }
7988
github_token: ${{ github.token }}
8089
model: claude-sonnet-4-6
8190
# Safe in this job because the job genuinely has no write power.

.github/workflows/triage-issue-action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,25 @@ jobs:
6565
# Read-only default token. The agent has no App token in this job.
6666
GH_TOKEN: ${{ github.token }}
6767
GITHUB_EVENT_NUMBER: ${{ inputs.issue_number }}
68-
# Claude Code's Bash sandbox (bwrap) masks `$HOME/.mcp.json` by
69-
# bind-mounting /dev/null over it, creating the target file first.
70-
# The runner's default HOME (/home) is not writable, so that aborts
71-
# with "bwrap: Can't create file at /home/.mcp.json". Point HOME at
72-
# the per-job writable temp dir so the sandbox stays enabled and
73-
# can create its mask target. Kept off the repo checkout (which
74-
# holds the read-only scripts/ dir) on purpose.
75-
HOME: ${{ runner.temp }}
7668
with:
7769
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_TOKEN }}
70+
# Disable Claude Code's Bash sandbox (bubblewrap). On the runner it
71+
# aborts every Bash command during setup with
72+
# "bwrap: Can't mkdir /home/.claude" (and, earlier, .mcp.json): the
73+
# sandbox builds an isolated home under /home inside its own bwrap
74+
# namespace and then cannot create files in it (upstream bug
75+
# anthropics/claude-code#17727). The /home path originates inside
76+
# the sandbox, not from the runner HOME, so no external HOME
77+
# override reaches it -- disabling the sandbox is the only
78+
# workflow-side fix. Isolation for this job is still enforced by:
79+
# the tight --allowedTools allowlist below (only specific
80+
# `bash scripts/*.sh` + Read + Write, no arbitrary Bash), the
81+
# read-only default token with NO App token in this job, the
82+
# `chmod -R a-w scripts` step above, and CLAUDE_CODE_SUBPROCESS_ENV_SCRUB
83+
# (auto-enabled by the action because allowed_non_write_users is set),
84+
# which strips the Anthropic API token from every subprocess env.
85+
settings: |
86+
{ "sandbox": { "enabled": false } }
7887
github_token: ${{ github.token }}
7988
model: claude-sonnet-4-6
8089
# Safe in this job because the job genuinely has no write power.

0 commit comments

Comments
 (0)