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

Open
opened 2026-02-16 18:08:08 -05:00 by yindo · 1 comment
Owner

Originally created by @ErcinDedeoglu on GitHub (Jan 27, 2026).

Originally assigned to: @thdxr on GitHub.

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

  • #1813 - YOLO mode (all-or-nothing, different use case)
  • #9070 - YOLO mode implementation (skip ALL prompts)

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

Originally created by @ErcinDedeoglu on GitHub (Jan 27, 2026). Originally assigned to: @thdxr on GitHub. ## 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: ```json { "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 - #1813 - YOLO mode (all-or-nothing, different use case) - #9070 - YOLO mode implementation (skip ALL prompts) This feature is for **granular, incremental** permission building - not full YOLO mode.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

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

  • #10753: Persist 'always' permission approvals to disk - This issue is almost identical, requesting persistent storage of permission approvals. The key difference is that #10753 mentions code to save to disk already exists but is commented out, while this issue proposes a UI approach with a "Permanent" button option.

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

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #10753: Persist 'always' permission approvals to disk - This issue is almost identical, requesting persistent storage of permission approvals. The key difference is that #10753 mentions code to save to disk already exists but is commented out, while this issue proposes a UI approach with a "Permanent" button option. Feel free to ignore if this doesn't address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7753