OpenCode: The user has specified a rule which prevents you from using this specific tool call.
A rule under `permission` in opencode.json, or in an agent's frontmatter, denied this tool call, so OpenCode rejected it and returned this text plus the relevant rules to the model. The exact message, why OpenCode prints it, and the fix.
Updated November 23, 2026
The message
The user has specified a rule which prevents you from using this specific tool call.
What it means
A rule under permission in opencode.json, or in an agent’s frontmatter, denied this tool call, so OpenCode rejected it and returned this text plus the relevant rules to the model. OpenCode 1 matches rules by pattern and the last matching rule wins, so a catch-all placed after specific rules overrides them; that ordering is behind many ‘permissions not working’ reports. Rules from the OPENCODE_PERMISSION environment variable are merged in too, and can override the file’s rules the same way.
Fix
- Put the catch-all ”*” rule first and the more specific rules after it, because the last matching rule wins.
- Check the effective rules with
opencode debug configandopencode debug agent <name>. - Run
env | grep OPENCODE_PERMISSION: that variable holds inline permission JSON, and a {”*”:“allow”} in it showed up after the project’s deny rules inopencode debug configand overrode them. - Remember that in OpenCode 1
editcovers the edit, write and patch tools. - On OpenCode 2, rules live in an ordered
permissionsarray of { “action”, “resource”, “effect” } objects,bashbecomesshell, and a blocked call reads ‘Permission denied: <action>’.
In an EnvHaven workspace
It can happen anywhere OpenCode runs; the fix above applies in a workspace too.
Where this comes from
From OpenCode’s documentation and issue tracker: