[PR #8392] docs: update permissions documentation with wildcard and rule evaluation #12724

Open
opened 2026-02-16 18:17:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8392

State: open
Merged: No


Updated permission patterns and defaults in documentation.

What does this PR do?

This pull request updates the documentation for configuring permissions in OpenCode.

Clarified permission configuration docs:

  • Added wildcard examples for permission names and patterns
  • Explained rule evaluation order (last matching rule wins) with placement warnings
  • Expanded defaults section with explicit config and clearer behavior notes

How did you verify your code works?

No code changes. I used https://mdxjs.com/playground/ and github preview for the changes to confirm formatting.

Further Discussion (Why)

I was trying to dig into the docs to understand permissions because I felt that the doc wasn't clear enough and OpenCode felt like it was doing too much without asking.
There is actually a mistake in the docs saying that .env reads are "deny" but the code does not match and has "ask". This could be a bug, but this documentation reflects the current state of the code. Wildcard matching for tool name was also not really documented well.

Default permissions - packages/opencode/src/agent/agent.ts:47-65
Wildcard matching - packages/opencode/src/util/wildcard.ts:4-17
Rule evaluation order - packages/opencode/src/permission/next.ts:223-225

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8392 **State:** open **Merged:** No --- Updated permission patterns and defaults in documentation. ### What does this PR do? This pull request updates the documentation for configuring permissions in OpenCode. Clarified permission configuration docs: - Added wildcard examples for permission names and patterns - Explained rule evaluation order (last matching rule wins) with placement warnings - Expanded defaults section with explicit config and clearer behavior notes ### How did you verify your code works? No code changes. I used https://mdxjs.com/playground/ and github preview for the changes to confirm formatting. ### Further Discussion (Why) I was trying to dig into the docs to understand permissions because I felt that the doc wasn't clear enough and OpenCode felt like it was doing too much without asking. There is actually a mistake in the docs saying that .env reads are "deny" but the code does not match and has "ask". This could be a bug, but this documentation reflects the current state of the code. Wildcard matching for tool name was also not really documented well. Default permissions - packages/opencode/src/agent/agent.ts:47-65 Wildcard matching - packages/opencode/src/util/wildcard.ts:4-17 Rule evaluation order - packages/opencode/src/permission/next.ts:223-225
yindo added the pull-request label 2026-02-16 18:17:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12724