Skip to content

Feature request: global permission cache & supervisor-mode for cross-workspace approvals #30227

@ezadEzanee

Description

@ezadEzanee

Problem

When a user approves a permission (e.g., read, edit, bash, external_directory) in one workspace and selects "Always", that approval does not carry over to other workspaces. The same prompt reappears even for identical paths/commands, creating friction.

Similarly, there is no mechanism for opencode to learn from past approvals — if a user has consistently approved access to ~/.config/opencode/** across multiple sessions, a "supervisor" mode could auto-approve matching patterns based on history.

Proposed Solutions

1. Global Permission Cache

Persist "Always" approvals to a global file (e.g., ~/.config/opencode/permissions.json) rather than scoping them per-workspace. When a permission prompt fires, matching entries in this cache would auto-approve without prompting.

2. Supervisor Mode

A configurable mode where opencode references past approval history to make decisions:

  • Track all approval/deny choices with context (path pattern, command pattern, timestamp)
  • When a new permission request matches a pattern that was approved N times consecutively in the past, auto-approve
  • Expose sensitivity: number of consecutive approvals required before auto-approving, or a confidence threshold
  • Allow the user to review and flush the history

Expected Behavior

{
  "permission": {
    "supervisor": {
      "enabled": true,
      "history_file": "~/.config/opencode/permission-history.json",
      "auto_approve_after": 3,
      "patterns": {
        "external_directory": {
          "~/.config/opencode/**": "auto"
        }
      }
    }
  }
}

Use Case

  • I approve read ~/.config/opencode/** in workspace A (always)
  • I open workspace B — same approval is auto-granted from the global cache
  • After seeing me approve read ~/.ssh/config 3 times across sessions, supervisor mode begins auto-approving it without prompting

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions