Description
When configuring bash permissions with specific deny rules and a catch-all *: ask, the deny rules are not being applied. Commands that should be blocked are either passing silently or falling through to ask depending on rule order.
Plugins
None
OpenCode version
1.15.7
Steps to reproduce
- Set the following config in
opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"bash": {
"*": "ask",
"git checkout": "deny",
"git checkout *": "deny"
}
}
}
- Ask the agent to run:
git checkout -- path_file_here
- The command executes without any prompt or denial.
Expected behavior:
The command should be blocked (deny) since git checkout * should match git checkout -- backend/db/schema.py.
Actual behavior:
- With
*: ask first and deny rules after → commands pass silently with no prompt
- With deny rules first and
*: ask last → commands trigger ask instead of deny, meaning *: ask wins over the specific deny rules
In both cases the deny rules are effectively ignored. The only workaround found is putting *: ask last, which protects against accidental execution but doesn't actually block commands as deny.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows PowerShell
Description
When configuring
bashpermissions with specificdenyrules and a catch-all*: ask, thedenyrules are not being applied. Commands that should be blocked are either passing silently or falling through toaskdepending on rule order.Plugins
None
OpenCode version
1.15.7
Steps to reproduce
opencode.json:{ "$schema": "https://opencode.ai/config.json", "permission": { "bash": { "*": "ask", "git checkout": "deny", "git checkout *": "deny" } } }git checkout -- path_file_hereExpected behavior:
The command should be blocked (
deny) sincegit checkout *should matchgit checkout -- backend/db/schema.py.Actual behavior:
*: askfirst and deny rules after → commands pass silently with no prompt*: asklast → commands triggeraskinstead ofdeny, meaning*: askwins over the specific deny rulesIn both cases the
denyrules are effectively ignored. The only workaround found is putting*: asklast, which protects against accidental execution but doesn't actually block commands asdeny.Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows PowerShell