Let review modes run read-only bash (git diff/log/grep) - #596
Merged
Conversation
review and review-security carried deny_tools:[…, bash, …], and a whole-tool bash deny is terminal at PromptDenyPolicy (precedence #1) — so it pre-empted the default_bash_rules that already auto-allow git status/log/diff/show and read-only inspection. The reviewer couldn't even see the diff it was asked to review. Drop bash from both review prompts' deny_tools. Read-only git and the other pre-trusted commands now flow through the normal engine (default rules → allow; effectful commands → Ask/approval_provider); plan mode keeps its full read-only lock. No engine change — an initial BuiltinAllow read-only-git carve-out was redundant with default_bash_rules and dropped; only a clarifying comment remains. Regression test pins that both review prompts deny the file-mutating tools + webfetch but keep bash.
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.
Problem
reviewandreview-securityshipped withdeny_tools: [edit, write, apply_patch, bash, webfetch]. A whole-toolbashdeny is terminal atPromptDenyPolicy(precedence #1), so it pre-empts the existingdefault_bash_rules(precedence #5) that already auto-allowgit status/log/diff/showand read-only inspection tools. Net effect: a reviewer couldn't even rungit diffto see the change it was asked to review — the whole tool was blocked, read-only or not.Fix
Drop
bashfrom both review prompts'deny_tools. Read-only git and the other pre-trusted commands now flow through the normal engine (default rules → allow; effectful commands likegit push/rm/curl→ Ask /approval_provider).planmode keeps its full read-only lock (still denies bash).No engine change: an initial idea to add a read-only-git carve-out to
BuiltinAllowPolicyturned out redundant withdefault_bash_rules(and violated the documented separation), so it was reverted — only a clarifying comment on theExecutearm remains.Regression test pins that both review prompts deny the file-mutating tools +
webfetchbut keepbash. Docs updated.Caveat
Because review now inherits the shared
default_bash_rules, it also permits the other pre-trusted commands there —cargo/make/test runners and local git writes (git add/git commit). Those are non-destructive and recoverable, and effectful/out-of-tree commands still prompt. Making review strictly read-only at the permission layer (blocking evengit commit/cargo build) would need sub-tooldeny_toolsgranularity, which doesn't exist today — a separate decision.Closes dirge-k265.