Description
If a bash permission prompt covers a compound command, answering "always" installs a separate allow rule for each command in it, not just for the one you think you are approving.
Approving git status && rm -rf ./tmp installs git status * and also rm *. The second one matches any later rm, including rm -rf /, so the next destructive rm runs without a prompt.
The widening itself is reasonable for a single command, since git status to git status * is the intended behaviour. The problem is that it is applied per command while the approval is per prompt, so one click produces several grants.
Plugins
None
OpenCode version
1.18.11
Steps to reproduce
- Add { "permission": { "bash": "ask" } } to opencode.json. Bash is "allow" by default, so the prompt will not appear otherwise.
- Ask the agent to run: git status && rm -rf ./tmp
- On the permission prompt, choose "always".
- Ask the agent to run: rm -rf ./some-other-dir
- It runs with no prompt, because the
rm * rule from step 3 matches it.
Screenshot and/or share link
No response
Operating System
Ubuntu 26.04
Terminal
GNOME Terminal (Ubuntu default)
Description
If a bash permission prompt covers a compound command, answering "always" installs a separate allow rule for each command in it, not just for the one you think you are approving.
Approving
git status && rm -rf ./tmpinstallsgit status *and alsorm *. The second one matches any laterrm, includingrm -rf /, so the next destructivermruns without a prompt.The widening itself is reasonable for a single command, since
git statustogit status *is the intended behaviour. The problem is that it is applied per command while the approval is per prompt, so one click produces several grants.Plugins
None
OpenCode version
1.18.11
Steps to reproduce
rm *rule from step 3 matches it.Screenshot and/or share link
No response
Operating System
Ubuntu 26.04
Terminal
GNOME Terminal (Ubuntu default)