Skip to content

Let review modes run read-only bash (git diff/log/grep) - #596

Merged
yogthos merged 1 commit into
mainfrom
review-mode-allow-bash-inspection
Jul 6, 2026
Merged

Let review modes run read-only bash (git diff/log/grep)#596
yogthos merged 1 commit into
mainfrom
review-mode-allow-bash-inspection

Conversation

@yogthos

@yogthos yogthos commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

review and review-security shipped with deny_tools: [edit, write, apply_patch, bash, webfetch]. A whole-tool bash deny is terminal at PromptDenyPolicy (precedence #1), so it pre-empts the existing default_bash_rules (precedence #5) that already auto-allow git status/log/diff/show and read-only inspection tools. Net effect: a reviewer couldn't even run git diff to see the change it was asked to review — the whole tool was blocked, read-only or not.

Fix

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 like git push/rm/curl → Ask / approval_provider). plan mode keeps its full read-only lock (still denies bash).

No engine change: an initial idea to add a read-only-git carve-out to BuiltinAllowPolicy turned out redundant with default_bash_rules (and violated the documented separation), so it was reverted — only a clarifying comment on the Execute arm remains.

Regression test pins that both review prompts deny the file-mutating tools + webfetch but keep bash. 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 even git commit/cargo build) would need sub-tool deny_tools granularity, which doesn't exist today — a separate decision.

Closes dirge-k265.

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.
@yogthos
yogthos merged commit 97f7b47 into main Jul 6, 2026
25 of 26 checks passed
@yogthos
yogthos deleted the review-mode-allow-bash-inspection branch July 6, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant