[FEATURE] Support wildcards for piped bash commands in permissions
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Problem
The current permission system doesn't support granting
permission to piped bash commands without being either too
specific or too general.
## Current Behavior
"Bash(tail:*)"- Only matchestailcommands without pipes"Bash(tail * | grep *)"- Not supported (wildcards in middle
of commands)
"Bash(tail -50 file.txt | grep pattern)"- Too specific,
must list every exact command
"Bash"- Too general, grants all bash access
Proposed Solution
## Desired Behavior
Support permission patterns like:
"Bash(tail:* | *)"- Allow any tail command piped to
anything
"Bash(* | grep:*)"- Allow any command piped to grep"Bash(tail:* | grep:*)"- Allow tail piped to grep
specifically
## Proposed Solution
Extend the permission syntax to support pipe operators with
wildcards, allowing granular control over compound commands
while maintaining security.
Alternative Solutions
- "Bash(tail | grep )" - Rejected by settings validation with error: "Wildcards in the middle of commands are not supported"
- "Bash(tail | )" - Same validation error (wildcards in middle not supported)
- "Bash(cat | grep )" - Same validation error
- "Bash(grep | )" - Same validation error
- "Bash(tail:*)" (prefix matching) - Already in config, but doesn't work for piped commands. The permission system treats tail -50 file.txt | grep pattern as a different command type
than tail -50 file.txt
- Exact command string: "Bash(tail -50 /tmp/test-output.log | grep -A 20 \"failed\\|passed\")" - Would work but too specific, doesn't help with command variations
- "Bash" (unrestricted) - Would work but too permissive, grants all bash access
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
## Use Case
Inspecting test output with commands like tail -50 requires
/tmp/test-output.log | grep -A 20 "failed\|passed"
clicking "Allow" every time, but granting full "Bash"
permission is too permissive.
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗