Restore read-only shell to PR review (grep, cat, head, tail)#30
Merged
Conversation
The review's `--allowedTools` was added in 834a453 to grant git commands for PR analysis, but `--allowedTools` is an exclusive whitelist: setting it silently dropped the general Bash the action allowed by default, so `grep`, `cat`, and friends are now denied. That was a side effect of the flag, not a deliberate restriction — the commit's intent was to enable analysis, not lock it down. Sonnet 5 still reaches for `grep` (including `git show | grep`) to verify findings across files, and each denied call burns a review turn plus a retry. Add the read-only inspection commands back to the allow-list so those calls run instead of being denied. Builds, tests, installs, edits, and network stay unlisted and therefore still denied, so the blast radius is unchanged — these commands only re-expose what the Read and Grep tools already permit. Also drops the now-contradictory "don't use shell grep" steer from the prompt, since shell grep is allowed again.
jaysonv0341
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The review's
--allowedToolswas added in 834a453 (#12) to grant git commands for PR analysis — the commit describes it as "grants Claude access to git commands," and before it there was no--allowedToolsat all, so the action ran on its permissive default set (which includes general Bash). But--allowedToolsis an exclusive whitelist: the moment it's set, everything not listed is denied. So that change silently droppedgrep,cat, and general Bash. The denial was a side effect of the flag's semantics, not a deliberate least-privilege decision.The cost shows up now that reviews run on Sonnet 5: it still reaches for shell
grep(includinggit show … | grepto search a specific blob version) when verifying findings across files, and each denied call burns a review turn plus a retry. On repos with a tightmax_turnsthat waste contributes toerror_max_turnsfailures.This adds the read-only inspection commands back to the allow-list (
grep,cat,head,tail,wc) so those calls execute instead of being denied.sedandfindare intentionally left out (sed -ican write;find /can walk the whole filesystem). Builds, tests, installs, file edits, and network remain unlisted and therefore still denied — the blast radius is unchanged, since these commands only re-expose what theReadandGreptools already permit over the same checkout. The prompt's now-contradictory "don't use shell grep" steer is dropped to match.Ticket
N/A — ad hoc infra fix, not tied to a ticket.
Type of Change
Testing Done
Changes only the review workflow's allow-list and prompt (no functional or schema change). Reproducing failing reviews locally with the restricted tool-set showed Sonnet 5 making shell
grepcalls that the current allow-list denies (matching thepermission_denials_countin those runs); the added commands remove that denial class. Will confirm on live PR reviews by watching denial counts drop.Checklist