Skip to content

Feature: Add "Save Permanently" option to permission prompts #10863

Closed

Description

@ErcinDedeoglu

Summary

When a permission prompt appears, add a 4th option to save the approved pattern directly to opencode.json instead of just session memory.

Current Behavior

┌─────────────────────────────────────┐
│ Allow `git status`?                 │
│                                     │
│ [Once]  [Always]  [Reject]          │
└─────────────────────────────────────┘
  • Once → Approve this request only
  • Always → Approve pattern for this session (lost on restart)
  • Reject → Deny

Proposed Behavior

┌─────────────────────────────────────┐
│ Allow `git status`?                 │
│                                     │
│ [Once]  [Session]  [Permanent]  [No]│
└─────────────────────────────────────┘
  • Once → Approve this request only
  • Session → Approve pattern for this session (current "Always" behavior)
  • Permanent → Save pattern to opencode.json (persists across restarts)
  • No → Deny

Why This Matters

Currently, users must manually edit opencode.json to add permanent permission patterns:

{
  "permission": {
    "bash": {
      "*": "ask",
      "git status *": "allow"
    }
  }
}

This is tedious and error-prone. The UI already knows the pattern (it shows it during "Always" confirmation) - it just needs to write it to the config file.

Use Case

  1. User runs OpenCode with "permission": "ask"
  2. Agent tries to run git status
  3. User approves with "Permanent"
  4. Pattern "git status *": "allow" is appended to opencode.json
  5. Next session - no prompt needed for git status

Implementation Notes

  • The pattern is already computed (shown in the "Always" confirmation dialog)
  • Just needs to append to opencode.json under permission.bash (or relevant tool)
  • Should handle nested permission objects gracefully
  • Could use jq or native JSON manipulation

Related

This feature is for granular, incremental permission building - not full YOLO mode.

Activity

  1. github-actions commented on Jan 27, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if this doesn't address your specific case.

  2. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 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