Skip to content

feat: support granular (object) syntax for webfetch permission #24041

Closed

Description

@RobWu

Summary

The webfetch permission does not support the granular object syntax that other permissions like bash, edit, and skill support. Using an object with URL patterns causes a ConfigInvalidError.

Current behavior

This config is rejected with Invalid input permission:

"permission": {
  "webfetch": {
    "https://opencode.ai/docs*": "allow"
  }
}

Only the simple string form works:

"permission": {
  "webfetch": "allow"
}

Expected behavior

The object syntax should work for webfetch, matching against the fetched URL — consistent with how bash matches commands and edit matches file paths:

"permission": {
  "webfetch": {
    "*": "ask",
    "https://opencode.ai/docs*": "allow",
    "https://docs.nestjs.com/*": "allow"
  }
}

Why this matters

Without granular control, users must choose between allowing all URL fetches or being prompted for every single one. Being able to allowlist trusted documentation domains while keeping "ask" as the default would improve the workflow significantly.

References

  • The permissions docs list webfetch as matching URLs: webfetch — fetching a URL (matches the URL), which implies granular support should work.
  • lsp is explicitly documented as "currently non-granular" — webfetch has no such note.

Environment

  • OpenCode version: latest (via opencode-ai npm package)
  • OS: macOS

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 23, 2026
  2. github-actions commented on Apr 23, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The title should start with [FEATURE]: for feature requests (e.g. [FEATURE]: support granular (object) syntax for webfetch permission)
    • The issue does not appear to use the Feature Request template, which requires a verification checkbox confirming the feature hasn't been suggested before

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions