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

  1. Put the catch-all ”*” rule first and the more specific rules after it, because the last matching rule wins.
  2. Check the effective rules with opencode debug config and opencode debug agent <name>.
  3. Run env | grep OPENCODE_PERMISSION: that variable holds inline permission JSON, and a {”*”:“allow”} in it showed up after the project’s deny rules in opencode debug config and overrode them.
  4. Remember that in OpenCode 1 edit covers the edit, write and patch tools.
  5. On OpenCode 2, rules live in an ordered permissions array of { “action”, “resource”, “effect” } objects, bash becomes shell, 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: