GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Expose saved permissions (or rule provenance) to server plugins · Issue #61767 · anomalyco/opencode

[FEATURE]: Expose saved permissions (or rule provenance) to server plugins #61767

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: Expose saved permissions (or rule provenance) to server plugins#61767
Copy link

Description

@yandy-r
yandy-r
opened on Nov 4, 2026
Issue body actions

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

Expose saved permissions to server plugins (and/or say where an evaluate allow came from)

Problem. A server plugin that enforces a stricter floor for some agents needs to tell a saved "Always allow" apart from a config-level allow. For example, it may want a config-wide external_directory: allow not to apply to restricted agents, while still honouring an approval the user saved. As of v2.2.5 the plugin can't do that:

  • ctx.permission is Pick<PermissionApi, "list" | "get" | "reply"> + hook + assert. That covers pending requests only. permission.saved.list/update/remove exist only as HTTP endpoints (/api/permission/saved). TUI plugins can read them (data.project.permission.list), but server plugins and headless runs can't.
  • PermissionSaved.add/update/remove publish no bus event, so a plugin can't keep a copy in sync either. Once a user removes a saved approval, a copy goes stale.
  • evaluateInput appends savedRules() after the configured rules and passes only the combined effect to hooks.trigger("permission", "evaluate", …). The event doesn't say which rule matched.

Today the workaround is to create a throwaway child session whose own permissions ask for the action, assert in it, read the effect in your own evaluate hook, force deny so it never prompts, then remove the session. It works, but it costs a session per check, and other plugins' evaluate hooks can affect it.

Proposal (any one of these would do):

  1. Add saved: Pick<PermissionApi["saved"], "list"> to the server plugin PermissionDomain, scoped to ctx.location.project.id.
  2. Publish permission.saved.updated (and/or permission.saved.removed) bus events, so ctx.event.subscribe can track changes.
  3. Add rule provenance to the evaluate event, for example readonly rule?: { source: "agent" | "session" | "saved"; action; resource; effect } for the rule that decided each resource.

Option 3 would also help with #48456 ("Always allow" silently overriding a configured ask), because plugins could then enforce or flag that themselves.

Reacted by Andrey Arsbkv and Nikita Frolov

Activity

  1. opencodejr commented on Nov 4, 2026

    @opencodejr
    opencodejrBot
    on Nov 4, 2026
    Contributor
    More actions

    Thanks for the detailed write-up, @yandy-r! To restate the request: server plugins should be able to tell a saved "Always allow" approval apart from a config-level allow. That could be done by exposing permission.saved.list on the plugin PermissionDomain, by publishing bus events when saved approvals change, or by including the deciding rule's source (agent, session or saved) in the evaluate hook event.

    I checked this against the current code and it matches what you describe. PermissionDomain only includes list, get and reply plus hook and assert. evaluateInput adds the saved rules after the configured ones and passes only the combined effect to the evaluate hook. So beyond your child-session workaround, a plugin can't do this cleanly today. The maintainers will consider which of the three options fits best.

    Related issues:

    • permissions: V2 “Always allow” silently overrides configured “ask” across future project sessions #48456: "Always allow" silently overrides a configured ask. Rule provenance would let plugins detect or enforce this.
    • permissions: allow-always is durable and project-scoped with no opt-out or TUI reset #50600: allow-always approvals are durable and project-scoped, with no opt-out or TUI reset.
    • docs: clarify that permission "always" approvals persist per project #58154: docs request to clarify that "always" approvals persist per project.
    • [FEATURE]: Plugin API: race-safe, single-use permission admission #61645: another plugin API request around permission handling (race-safe, single-use admission).
    • permissions: add time-limited approvals (30m/1h/3h/5h/1d/1w) between once and always #61465: time-limited approvals between once and always.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.