You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn when a Bash(rtk:*) allow rule is present #4649
A Bash(rtk:*) (or Bash(rtk *)) allow rule in a Claude Code settings file allows every command rtk can run, which is far more than it reads like. rtk init and rtk verify should warn when one is present.
What the rule grants
Agents that write the rtk prefix themselves get a prompt for every such command, and Bash(rtk:*) is the obvious way to silence those prompts. Once #3970 is fixed, the rule keeps granting rtk's own commands (rtk gain, rtk discover) and every command rtk filters, while deny and ask rules for the command behind the prefix still apply. Even so, a filtered command that no ask rule names, such as rtk git push, runs without a prompt, even though the user never allowed git push.
Proposal
When a loaded settings file holds a Bash(...) allow rule that matches every rtk … command, rtk init (install and upgrade) and rtk verify print a warning naming the file and the rule, for example:
warning: Bash(rtk:*) in ~/.claude/settings.json allows every command rtk filters, including `rtk git push`.
Deny and ask rules for those tools still apply. Consider narrower rules such as Bash(rtk git status:*).
The hook itself stays silent: its stdout is the protocol with the host, and a warning on every call would be noise.
Request to warn on overly broad Bash(rtk:*) allow rules in rtk init/verify, since they silently grant all rtk-filtered commands despite deny/ask rules intending to restrict them.
Plan.rtk init (install and upgrade) and rtk verify print a one-line stderr warning naming the rule and the settings file whenever a loaded Bash(...) allow rule reduces to the bare command name — Bash(rtk:*), Bash(rtk *), Bash(rtk), Bash(*rtk*). The hook path (rtk hook <agent>, rtk rewrite) stays silent, as you ask. --dry-run and init --show stay silent too; the warning is an advisory at the point the user can act on it.
Two readings I'd like settled before opening the PR, since the issue says "matches every rtk … command":
Bash(*) — grants every command rtk filters, but it isn't rtk-specific, and "consider narrower rules such as Bash(rtk git status:*)" is misleading advice for someone who deliberately allowed everything. I lean towards not flagging it.
Bash(rtk git:*) — covers rtk git push but not rtk cargo test. The literal wording says it does not match every rtk command, so I lean towards not flagging it either. Flagging it would catch the headline risk but the message would overstate what the rule grants.
A prefix test on the pattern (strip Bash(, ), then */:/whitespace, compare to rtk) gets both readings without a glob matcher, and keeps Bash(rtk git push) — the example the warning itself names — out of the warning.
On the premise:#3970 and #3195 are both still open, so the warning's wording describes the exposure as it stands today rather than after a fix. Happy to hedge the text if you'd rather it read that way.
~80 lines including unit tests for both spellings. Will link the PR here once it's up.
Activity
rtk-wshm-sync-bot commentedon Oct 18, 2026
🔍 Automated Triage
featuremediumSummary
Request to warn on overly broad Bash(rtk:*) allow rules in rtk init/verify, since they silently grant all rtk-filtered commands despite deny/ask rules intending to restrict them.
📁 Relevant files
src/init/mod.rssrc/hook/verify.rssrc/discover/registry.rsSuggested Actions
rtkprefix escapes the host allowlist #3970 (rtk-prefix verdict) and fix(hooks): honor permission rules for already-rtk-prefixed commands #3195 (fix under review) before implementing the warningTriaged automatically by wshm · This is an automated analysis, not a human review.
xiaozou-second commentedon Oct 21, 2026
I'd like to take this one.
Plan.
rtk init(install and upgrade) andrtk verifyprint a one-line stderr warning naming the rule and the settings file whenever a loadedBash(...)allow rule reduces to the bare command name —Bash(rtk:*),Bash(rtk *),Bash(rtk),Bash(*rtk*). The hook path (rtk hook <agent>,rtk rewrite) stays silent, as you ask.--dry-runandinit --showstay silent too; the warning is an advisory at the point the user can act on it.Two readings I'd like settled before opening the PR, since the issue says "matches every
rtk …command":Bash(*)— grants every command rtk filters, but it isn't rtk-specific, and "consider narrower rules such asBash(rtk git status:*)" is misleading advice for someone who deliberately allowed everything. I lean towards not flagging it.Bash(rtk git:*)— coversrtk git pushbut notrtk cargo test. The literal wording says it does not match every rtk command, so I lean towards not flagging it either. Flagging it would catch the headline risk but the message would overstate what the rule grants.A prefix test on the pattern (strip
Bash(,), then*/:/whitespace, compare tortk) gets both readings without a glob matcher, and keepsBash(rtk git push)— the example the warning itself names — out of the warning.On the premise: #3970 and #3195 are both still open, so the warning's wording describes the exposure as it stands today rather than after a fix. Happy to hedge the text if you'd rather it read that way.
~80 lines including unit tests for both spellings. Will link the PR here once it's up.