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
Approving "always" on a compound bash command grants a rule for every command in it #40158
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.
Activity
github-actions commentedon Oct 2, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.