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
[FEATURE]: Support regex in permissions configuration #11397
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature Request: Regex Support for Permissions Configuration
Summary
Permissions currently support only simple wildcards. Adding regex support would reduce repetitive rules and prevent unnecessary permission prompts, especially when the LLM varies argument order.
Problems
Repetition: Git commands require many separate wildcard entries.
Argument reordering: Commands like kubectl -n default get ... still trigger approval request even when kubectl get * is allowed. In my vscode copilot extension, I have a regex that takes care of this, so any - or -- arguments are completely ignored, while allowing the regex (get|describe|config|logs|api-resources|explain|cluster-info|top|debug|events|diff). This allows commands like kubectl -n myns -o json get pod mypod to run without asking for approval. My entire kubectl configuration is a single line regex in my vscode copilot configuration.
Both issues share the core problem: simple wildcard patterns are insufficient for complex permission rules. Your regex approach would directly address these limitations.
Feel free to ignore if your use case differs from these existing requests.
Confirming this is somewhat of a blocker when migrating from Kiro to OpenCode. Regex expressions in Kiro's permissions configuration provide both reduced rule verbosity and maintained security without trading off either.
Migration Pain Points
When converting a Kiro configuration with regex-based permissions to OpenCode wildcards, the constraints are stark:
Security regression: Wildcards (*, ?) cannot express the safety constraints that regex enforces. A pattern like "*git commit*--no-gpg-sign*" to deny unsafe git operations becomes impossible to express safely—wildcards would match arbitrary prefixes and allow shell injection vectors.
Argument position sensitivity: Commands with flags in any position (e.g., kubectl -n ns get pods vs kubectl get -n ns pods) require separate wildcard rules. Regex handles this trivially with optional argument groups; wildcards force explicit enumeration or dangerous blanket permissions.
Pipe chain control: Regex can enforce that piping is only allowed to specific safe commands (head, grep, jq, etc.). Wildcards cannot distinguish between kubectl get | grep (safe) and kubectl get | xargs rm -rf (dangerous).
Activity
github-actions commentedon Jan 31, 2026
This issue might be a duplicate of existing issues. Please check:
Both issues share the core problem: simple wildcard patterns are insufficient for complex permission rules. Your regex approach would directly address these limitations.
Feel free to ignore if your use case differs from these existing requests.
broboa commentedon Feb 2, 2026
Confirming this is somewhat of a blocker when migrating from Kiro to OpenCode. Regex expressions in Kiro's permissions configuration provide both reduced rule verbosity and maintained security without trading off either.
Migration Pain Points
When converting a Kiro configuration with regex-based permissions to OpenCode wildcards, the constraints are stark:
Security regression: Wildcards (
*,?) cannot express the safety constraints that regex enforces. A pattern like"*git commit*--no-gpg-sign*"to deny unsafe git operations becomes impossible to express safely—wildcards would match arbitrary prefixes and allow shell injection vectors.Argument position sensitivity: Commands with flags in any position (e.g.,
kubectl -n ns get podsvskubectl get -n ns pods) require separate wildcard rules. Regex handles this trivially with optional argument groups; wildcards force explicit enumeration or dangerous blanket permissions.Pipe chain control: Regex can enforce that piping is only allowed to specific safe commands (head, grep, jq, etc.). Wildcards cannot distinguish between
kubectl get | grep(safe) andkubectl get | xargs rm -rf(dangerous).Example: kubectl Configuration
Kiro (single regex):
OpenCode wildcards (requires ~30+ rules or accepts security degradation):
Regex support would eliminate this migration friction and restore the security model that made Kiro configurations maintainable.
JtMotoX commentedon Feb 3, 2026
Created PR #11908
github-actions commentedon Apr 5, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
NicolasWebDev commentedon Jun 16, 2026
I understand @JtMotoX that the PR was never merged, right?