Skip to content

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

Closed as not planned
Closed as not planned

Description

@jbro

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 tool.execute.before hook can inspect and mutate tool args, or block execution by throwing, but it can't defer to the user for approval.

Without this, plugins that implement policy engines have no way to do "stop and ask", only hard-block or silent-allow.

Plugin-defined tools already get ask() via ToolContext, so the precedent exists.

The fix is small: pass ask on the hook's input object at the three trigger sites in prompt.ts, and extend the type in packages/plugin/src/index.ts.

Related to #19469 and #7006 but distinct, those wire the permission.ask hook to intercept existing permission checks; this exposes ask() on tool.execute.before so plugins can initiate permission requests.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Apr 13, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 13, 2026
  3. github-actions commented on Apr 13, 2026

    @github-actions
    Contributor

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

    If your request is distinct (exposing ask() on tool.execute.before rather than wiring permission.ask itself), please clarify the difference from the issues above so maintainers can assess whether a separate issue is needed.

  4. jbro commented on Apr 13, 2026

    @jbro
    Author

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

    If your request is distinct (exposing ask() on tool.execute.before rather than wiring permission.ask itself), please clarify the difference from the issues above so maintainers can assess whether a separate issue is needed.

    This is distinct. #19469 and #7006 are about wiring the permission.ask hook so plugins can intercept existing permission checks. This is about exposing ask() on tool.execute.before so plugins can initiate new permission requests from the pre-tool interceptor. They're complementary.

  5. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 4, 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