Skip to content

[FEATURE]: Wire the permission.ask plugin hook #19469

Closed as not planned
Closed as not planned

Description

@jacobprall

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The permission.ask hook is declared in the Hooks interface (@opencode-ai/plugin) but never triggered from the permission engine. Plugins that implement permission.ask are silently ignored.

Wiring it would let plugins auto-allow or auto-deny permission requests before prompting the user — useful for governance sidecars, policy engines, and MCP integrations that manage permissions externally.

Proposed behavior:

  • Built-in ruleset evaluation stays unchanged (deny short-circuits, allow passes).
  • When rules evaluate to "ask", fire Plugin.trigger("permission.ask", ...) after the request enters the pending queue.
  • If the plugin sets status:"allow" → resolve immediately, no prompt.
  • If the plugin sets status:"deny" → throw DeniedError, no prompt.
  • If the plugin leaves status:"ask" or throws → normal prompt flow.

Small change (~40 lines in permission/index.ts), zero regressions on existing tests.

Activity

  1. added a commit that references this issue on Mar 27, 2026
    ad26368
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 27, 2026
  3. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

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

  4. jbro commented on Apr 13, 2026

    @jbro

    Filed #22311, exposing ask() on tool.execute.before so plugins can initiate permission requests from the pre-tool hook. Complementary to this issue. Have a branch ready if it's wanted?

  5. assigned and unassigned on Apr 26, 2026
  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions