Skip to content

[FEATURE]: Let plugins check permissions without prompting #64787

Open

Description

@iamichi

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

Let plugins check whether an action is already allowed without asking the user to approve it.

For example, a plugin might need to decide whether it can share information from a session. If sharing would need approval, the plugin can leave the information out. Just checking should never open an approval prompt.

The plugin API's permission.assert opens a prompt when the current rules require approval. OpenCode already has an internal check that answers this question without creating a request. Could the server plugin API expose that check as permission.allows in both the Effect and Promise APIs, so plugins can use the session's current permission rules?

Activity

  1. opencodejr commented on Nov 19, 2026

    @opencodejr
    Contributor

    Thanks for the detailed request, @iamichi!

    To restate it: you'd like server plugins to get ctx.permission.allows(input) in both the Effect and Promise APIs. It would forward to the existing core check and return a yes/no answer without opening an approval request, with both ask and deny counting as no.

    The code I read matches your description:

    • Core already has Permission.allows in packages/core/src/permission.ts. Its doc comment says: "True only when the rules already allow the request; never asks the user."
    • The plugin PermissionDomain in packages/plugin/src/effect/permission.ts exposes list, get, reply, hook and assert. The doc comment on assert says it prompts the user and waits for the reply when approval is required.

    Since the method is missing from the plugin API itself, a plugin can't work around this. Maintainers will consider the request.

    Related:

  2. added
    area/plugins
    type/feature
    version/v2
    on Nov 19, 2026
  3. changed the title [-][FEATURE]: Expose the non-prompting permission check to server plugins[/-] [+][FEATURE]: Let plugins check permissions without prompting[/+] on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginstype/featureversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions