ci: scope claude review/mention bots to read-only git tools#1069
Conversation
|
@claude, please take a look |
|
Claude finished @shane-moore's task in 3m 14s —— View job Review
No actionable issues found. The change is narrow, well-scoped, and the design choices match the stated rationale. A few observations (non-blocking): 1. Allowlist is the primary defense; the deny list is genuinely belt-and-suspenders. Claude Code's Bash permissions are deny-by-default — anything not in 2. Asymmetry between the two workflows is intentional and consistent.
Both end up read-only by construction. Worth being aware that the mentions bot now has no 3. 4. LGTM. |
The claude-mentions bot ran with no tool allowlist, and neither bot had git read tools. Add an explicit allowlist so both bots can orient with read-only git (diff/show/log/merge-base/rev-parse/grep/status): - claude-pr-review: extend the existing allowlist with read-only git. - claude-mentions: introduce an allowlist (Glob/Grep/LS/Read, the comment + inline-comment + CI MCP tools, read-only git) and an explicit disallowedTools deny for Edit/Write and git write/push, keeping the mention bot strictly read-only. The inline-comment tool is included so the bot can follow review.md's "use inline comments" instruction instead of stalling on a denied tool.
fc1b05f to
fe3fd1c
Compare
|
Thanks @claude, this matches my read overall.
|
|
Claude finished @shane-moore's task in 1m 32s —— View job ReplyAcknowledging the corrections — all four points land. 1. You're right that the deny list is load-bearing in tag mode, not belt-and-suspenders. I was reasoning from stock Claude Code semantics (deny-by-default for Bash, no implicit 2. Keeping 3. Dropping the path-pinned 4. Diagnostic plan — agreed. This PR closes the visible mismatch between the LGTM.
|
Problem, Evidence, and Context (Required)
claude-mentionsworkflow did not declare its own tool allowlist, and the action-generated allowlist did not include read-only git inspection commands. The PR-review bot also lacked those read-only git tools. The sharedreview.mdprompt expects the bot to orient against the diff, so missing git access can cause denied tool calls and turn churn; a recent follow-up review job exhausted its budget and exited withReached maximum number of turns (50).Change Overview (Required)
claude-pr-review: extend the existing allowlist with read-only git (status/diff/show/log/rev-parse/merge-base/grep).claude-mentions: introduce an allowlist (Glob/Grep/LS/Read, the comment + inline-comment + CI MCP tools, read-only git) and an explicit--disallowedToolsdeny for file edits and commit-producing git operations (Edit/MultiEdit/Write/NotebookEdit,git add/commit/rm).review.md's "use inline comments" instruction instead of stalling on a denied tool.--max-turns 50, the model, and the prompt-loading step.Risks, Trade-offs, and Mitigations (Required)
claude-mentionsalso restricts it to the listed tools. Mitigated by including the inline + sticky comment tools so it retains a working output path.claude-mentionsremains review-oriented: it can inspect code and comment, but cannot edit files or create commits. The action's version-pinned push wrapper is not explicitly denied to avoid a brittle path-specific entry; with edits and commits denied, there should be nothing new to push.Validation (Required)
pull_request_target/mention workflows load from the default branch, so this can only be exercised once merged tostable. First real test is an@claudemention post-merge.Rollback (Required for behavior or runtime changes; optional otherwise)