Bug: Trusted Commands Wildcard Pattern Matching Failure
Summary
Trusted commands with wildcard patterns (e.g., "ls *") are not being recognized when executing commands that should match the pattern. The system continues to prompt for approval even after the wildcard pattern has been marked as "universally trusted."
Environment
- Operating System: macOS 26.1 (Build 25B5062e)
- Platform: darwin
- Shell: zsh
- Kiro Model: claude-sonnet-4.5
Expected Behavior
When a command pattern like "ls *" is added to the trusted commands list, any command starting with ls followed by any arguments should be automatically approved without prompting the user.
For example, if "ls *" is trusted, these commands should execute without approval prompts:
ls -lals ~/.kiro/settings/ls -lh *.pngls -la /tmp/
Actual Behavior
Despite having "ls *" in the trusted commands list, Kiro continues to prompt for approval on every ls command variation. The wildcard pattern matching is not working as expected.
Steps to Reproduce
- Execute an
lscommand (e.g.,ls -la ~/.kiro/) - When prompted, approve the command and select "Trust universally" with pattern
"ls *" - Execute a different
lscommand variation (e.g.,ls -lh /tmp/) - Observe that Kiro prompts for approval again, despite the wildcard pattern being trusted
Configuration Evidence
Trusted Commands Location
~/Library/Application Support/Kiro/User/settings.json
Other Affected Wildcard Patterns
The issue appears to affect all wildcard patterns, not just ls:
"mv *"- trusted but still prompts"xcodebuild *"- trusted but still prompts"swift *"- trusted but still prompts"chmod *"- trusted but still prompts
Impact
- Severity: Medium
- Frequency: Every command execution that should match a trusted pattern
- User Experience: Significantly degrades workflow efficiency as users must repeatedly approve commands they've already marked as universally trusted
- Workaround: None effective
Root Cause Analysis
The trusted commands feature appears to be performing exact string matching instead of pattern matching. When comparing an executed command against the trusted list, the system is not properly interpreting the * wildcard as "match any characters."
Suggested Fix
Implement proper glob pattern matching or regex matching for trusted commands:
- When a command is executed, iterate through trusted commands
- For patterns containing
*, convert to regex or use glob matching - If the executed command matches any trusted pattern, auto-approve
- Example:
"ls *"should match any command matching regex^ls\\s.*$
Reproduction Rate
100% - occurs every time a command is executed that should match a trusted wildcard pattern
Yeah, came here just to report the same. In my case, it randomly asks me to accept a command, even though the command was marked as trusted with the wildcard symbol (e.g. go test *)
Might be related to #3499
same here wtf
Hi @ttalamo123 , We have implemented significant improvements in recent versions of Kiro. We recommend upgrading to the latest version to benefit from these enhancements. If you continue to experience issues after upgrading, please submit a new issue with detailed information about the problem.