anomalyco / anomalyco/opencode
Approving "always" on a compound bash command grants a rule for every command in it
@jlongster is already working on this.
Since Aug 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.