Skip to content

permissions: add time-limited approvals (30m/1h/3h/5h/1d/1w) between once and always #61465

Open

Description

@elviswong1013

Summary

The permission prompt only offers once, always, and reject. always writes a durable project-scoped allow rule, so allowing a temporary directory (or any one-off path) for a short while forces a choice between "once" (re-prompts on every call) and "forever" (a permanent rule the user must remember to clean up). Add time-limited approvals as a middle ground: 30m, 1h, 3h, 5h, 1d, 1w.

Environment

  • opencode version: 2.0.23
  • OS: Windows 11 (Windows_NT 10.0.26200.9711)
  • Terminal: desktop app (GUI); terminal environment not applicable
  • Shell: C:\WINDOWS\system32\cmd.exe (PowerShell for tooling)
  • Install/channel: release, v2.0.23
  • Active plugins: [email protected], pty-plugin (local), @plannotator/[email protected], [email protected], opencode-tavily, @firecrawl/[email protected], @cheesecodestudio/opencode-tokenscope-v2, local timed-permissions plugin

Reproduction

  1. In a session (or a subagent), read a file outside the project directory, e.g. C:/Users/me/AppData/Local/Temp/opencode/object-counting-002/count-anything/x.png.
  2. The permission prompt appears with only 拒絕 / 永遠允許 / 允許一次 (reject / always / once).

Expected Behavior

The prompt offers a duration: once, 30m, 1h, 3h, 5h, 1d, 1w, always. always can remain, optionally behind a secondary confirmation.

Actual Behavior

Only once / always / reject. always saves a permanent project-scoped allow rule with no expiration or in-flow revocation.

Additional Context

Activity

  1. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @elviswong1013! You'd like the permission prompt to let you approve something for a limited time (30m, 1h, 3h, 5h, 1d, 1w) as a middle ground between Allow once and Always allow, so short-term access, like a temp directory outside the project, doesn't leave a permanent project-wide rule behind.

    Right now v2 offers only once, always and reject, and Always allow saves a permanent rule for the project, so this would be a new feature. As you noted, a plugin can't add options to the built-in prompt, and replies have no way to carry a duration, so this needs a change in OpenCode itself. The maintainers will consider it.

    Related issues:

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