webfetch doesn't seem to allow filtering by url in agents/*.md #8788

Closed
opened 2026-02-16 18:10:51 -05:00 by yindo · 2 comments
Owner

Originally created by @khimaros on GitHub (Feb 7, 2026).

Originally assigned to: @thdxr on GitHub.

Description

https://opencode.ai/docs/permissions/#agents

permission:
    webfetch:
        "*": ask
        "https://wikipedia.org/*": allow

it allows any webfetch to occur (not just wikipedia)

Plugins

No response

OpenCode version

1.1.53

Steps to reproduce

  1. configure an agent in ~/.config/opencode/agents/example.md
  2. set the frontmatter described
  3. notice that it fails

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @khimaros on GitHub (Feb 7, 2026). Originally assigned to: @thdxr on GitHub. ### Description https://opencode.ai/docs/permissions/#agents ``` permission: webfetch: "*": ask "https://wikipedia.org/*": allow ``` it allows any webfetch to occur (not just wikipedia) ### Plugins _No response_ ### OpenCode version 1.1.53 ### Steps to reproduce 1. configure an agent in ~/.config/opencode/agents/example.md 2. set the frontmatter described 3. notice that it fails ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bugdocs labels 2026-02-16 18:10:51 -05:00
yindo closed this issue 2026-02-16 18:10:51 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 7, 2026):

This issue might be a duplicate of or related to existing issues. Please check:

  • #9297: docs: Agents page has misleading/incomplete information about tool access (similar documentation issues with agent permissions)
  • #9927: Agent Permission not work as expected (webfetch permissions not working as documented)
  • #8832: opencode not respecting permissions (general permissions not being respected)
  • #6856: Should we actually implement the new granular permissions in .md agent files? (questions about permission syntax in .md files)

These issues discuss related problems with agent permissions and documentation accuracy that may be interconnected with this bug.

@github-actions[bot] commented on GitHub (Feb 7, 2026): This issue might be a duplicate of or related to existing issues. Please check: - #9297: docs: Agents page has misleading/incomplete information about tool access (similar documentation issues with agent permissions) - #9927: Agent Permission not work as expected (webfetch permissions not working as documented) - #8832: opencode not respecting permissions (general permissions not being respected) - #6856: Should we actually implement the new granular permissions in .md agent files? (questions about permission syntax in .md files) These issues discuss related problems with agent permissions and documentation accuracy that may be interconnected with this bug.
Author
Owner

@R44VC0RP commented on GitHub (Feb 7, 2026):

Two separate issues here:

1. permission: vs permissions:

The field is permission: (singular), not permissions:. The docs are correct. See the schema definition in config.ts:705.

2. Webfetch pattern matching not working

This is a real issue and looks like a dupe of #9927. The permission evaluation uses findLast() to find matching rules, so more specific patterns should override wildcards if they come later in the ruleset. But something's not working right.

Your config:

permission:
  webfetch:
    "*": ask
    "https://wikipedia.org/*": allow

Should ask for all URLs except Wikipedia, but you're seeing all webfetch allowed without prompting. This matches the broader permission pattern matching bug in #9927 where wildcard rules aren't being properly overridden by specific patterns.

Closing as duplicate of #9927.

@R44VC0RP commented on GitHub (Feb 7, 2026): Two separate issues here: **1. `permission:` vs `permissions:`** The field is `permission:` (singular), not `permissions:`. The docs are correct. See the schema definition in [config.ts:705](https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/config/config.ts#L705). **2. Webfetch pattern matching not working** This is a real issue and looks like a dupe of #9927. The permission evaluation uses `findLast()` to find matching rules, so more specific patterns should override wildcards if they come later in the ruleset. But something's not working right. Your config: ```yaml permission: webfetch: "*": ask "https://wikipedia.org/*": allow ``` Should ask for all URLs except Wikipedia, but you're seeing all webfetch allowed without prompting. This matches the broader permission pattern matching bug in #9927 where wildcard rules aren't being properly overridden by specific patterns. Closing as duplicate of #9927.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8788