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
Use Case:
This type of control lets users opt-in with a safe set of verified commands, reducing risk from unknown scenarios and making adoption in stable workflows much safer. This would be mutually exclusive with exclude_commands.
Feature request: add include_commands whitelist mode as an alternative to the existing exclude_commands blacklist, so only explicitly listed commands are filtered by rtk.
Triaged automatically by wshm · This is an automated analysis, not a human review.
Hi! I'd like to work on this issue if it's still available.
I'll first review the existing "exclude_commands" implementation and command filtering flow, then propose and implement support for "include_commands" as a mutually exclusive whitelist mode. I'll also add/update tests covering the new behavior and configuration validation.
Please let me know if there are any design considerations or edge cases you'd like me to keep in mind before I start.
Same need here, from the opposite direction: the set of commands I want rewritten is much smaller than the set I want left alone.
rtk go test is a clear win and I want to keep it. find is the opposite — the agent writes -exec, -not, and other compound predicates that rtk find does not accept, so the command fails before it runs. The same goes for a few other tools I have not hit yet, and that is the point: I cannot enumerate what to exclude, because I do not know what the agent will type next week. I can enumerate what to include — it is one or two entries.
exclude_commands cannot express this today (rtk 0.44.0):
patterns are literal command prefixes matched on a token boundary (git, go test, ./gradlew), so gradlew does not match ./gradlew build;
regex applies only when the pattern starts with ^ — git|go, (git|go), and g* match nothing;
exclude_commands = ["^.*$"] does disable every rewrite, so the only way to get a whitelist today is to turn everything off and wrap the hook in a script that calls rtk rewrite for the commands I want.
That wrapper works, but the allowlist then lives outside rtk, in a hook script I maintain myself.
The list is not static either. rtk go test only earns its keep while go test prints a line per package, and there is an open proposal to stop doing that: golang/go#64576 (comment). If that lands, rtk go becomes noise and I want to drop that one entry without auditing what my exclusions now let through.
Activity
pszymkowiak commentedon Jun 3, 2026
🔍 Automated Triage
featuremediumSummary
Feature request: add
include_commandswhitelist mode as an alternative to the existingexclude_commandsblacklist, so only explicitly listed commands are filtered by rtk.Triaged automatically by wshm · This is an automated analysis, not a human review.
[-]支持命令过滤“白名单”模式:只过滤指定命令,其它全部直通[/-][+]Add whitelist mode for command filtering[/+]jdgajjar commentedon Jun 3, 2026
Hi! I'd like to work on this issue if it's still available.
I'll first review the existing "exclude_commands" implementation and command filtering flow, then propose and implement support for "include_commands" as a mutually exclusive whitelist mode. I'll also add/update tests covering the new behavior and configuration validation.
Please let me know if there are any design considerations or edge cases you'd like me to keep in mind before I start.
jdgajjar commentedon Jun 5, 2026
Hi! The CLA has been signed and the PR is ready for review. Please let me know if any changes are needed. Thank you!
wauxhall commentedon Jul 1, 2026
Any updates on this?
vlsi commentedon Aug 16, 2026
Same need here, from the opposite direction: the set of commands I want rewritten is much smaller than the set I want left alone.
rtk go testis a clear win and I want to keep it.findis the opposite — the agent writes-exec,-not, and other compound predicates thatrtk finddoes not accept, so the command fails before it runs. The same goes for a few other tools I have not hit yet, and that is the point: I cannot enumerate what to exclude, because I do not know what the agent will type next week. I can enumerate what to include — it is one or two entries.exclude_commandscannot express this today (rtk 0.44.0):git,go test,./gradlew), sogradlewdoes not match./gradlew build;^—git|go,(git|go), andg*match nothing;exclude_commands = ["^.*$"]does disable every rewrite, so the only way to get a whitelist today is to turn everything off and wrap the hook in a script that callsrtk rewritefor the commands I want.That wrapper works, but the allowlist then lives outside rtk, in a hook script I maintain myself.
The list is not static either.
rtk go testonly earns its keep whilego testprints a line per package, and there is an open proposal to stop doing that: golang/go#64576 (comment). If that lands,rtk gobecomes noise and I want to drop that one entry without auditing what my exclusions now let through.