Feature Request: Secret/Incognito Mode for Session Privacy #8869

Open
opened 2026-02-16 18:11:03 -05:00 by yindo · 2 comments
Owner

Originally created by @jutalik on GitHub (Feb 8, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

When conversations are stored locally on disk (~/.local/share/opencode/storage/), there is a risk of sensitive information being exposed if the device is sold, lost, or accessed by unauthorized users. Session data may contain API keys, credentials, proprietary code, and other sensitive information discussed during development.

Request: Add a "Secret Mode" (or Incognito Mode) that prevents conversation sessions from being persisted to disk.

Motivation

  • Device resale/disposal: Users may forget to wipe session data before selling or disposing of their machines
  • Device loss/theft: Locally stored conversation history becomes immediately accessible
  • Shared workstations: Multiple users on the same machine could access each other's session history
  • Compliance: Some organizations require that sensitive development conversations are not persisted

Current Behavior

All conversations are automatically saved to ~/.local/share/opencode/storage/ with no way to disable persistence. Users can delete sessions after the fact (Ctrl+D in TUI), but there is no way to prevent saving in the first place.

Proposed Solutions

Any of the following would address this concern (in order of preference):

1. CLI Flag: --ephemeral or --incognito

opencode --ephemeral

Sessions run with this flag are kept in memory only and never written to disk.

2. Config Option: session.persist

{
  "session": {
    "persist": false
  }
}

3. Environment Variable

OPENCODE_EPHEMERAL=true opencode

4. TUI Command: /incognito

Toggle incognito mode within a running session — new messages after toggling are not persisted.

Additional Context

  • The existing Ctrl+D delete is a mitigation but not a prevention — data is still written to disk temporarily
  • Similar tools (web browsers, messaging apps) offer incognito/secret modes for exactly this reason
  • Even brief disk writes can be recovered with forensic tools, so in-memory-only mode is preferred
Originally created by @jutalik on GitHub (Feb 8, 2026). Originally assigned to: @thdxr on GitHub. ## Summary When conversations are stored locally on disk (`~/.local/share/opencode/storage/`), there is a risk of sensitive information being exposed if the device is sold, lost, or accessed by unauthorized users. Session data may contain API keys, credentials, proprietary code, and other sensitive information discussed during development. **Request**: Add a "Secret Mode" (or Incognito Mode) that prevents conversation sessions from being persisted to disk. ## Motivation - **Device resale/disposal**: Users may forget to wipe session data before selling or disposing of their machines - **Device loss/theft**: Locally stored conversation history becomes immediately accessible - **Shared workstations**: Multiple users on the same machine could access each other's session history - **Compliance**: Some organizations require that sensitive development conversations are not persisted ## Current Behavior All conversations are automatically saved to `~/.local/share/opencode/storage/` with no way to disable persistence. Users can delete sessions after the fact (`Ctrl+D` in TUI), but there is no way to prevent saving in the first place. ## Proposed Solutions Any of the following would address this concern (in order of preference): ### 1. CLI Flag: `--ephemeral` or `--incognito` ```bash opencode --ephemeral ``` Sessions run with this flag are kept in memory only and never written to disk. ### 2. Config Option: `session.persist` ```json { "session": { "persist": false } } ``` ### 3. Environment Variable ```bash OPENCODE_EPHEMERAL=true opencode ``` ### 4. TUI Command: `/incognito` Toggle incognito mode within a running session — new messages after toggling are not persisted. ## Additional Context - The existing `Ctrl+D` delete is a mitigation but not a prevention — data is still written to disk temporarily - Similar tools (web browsers, messaging apps) offer incognito/secret modes for exactly this reason - Even brief disk writes can be recovered with forensic tools, so in-memory-only mode is preferred
Author
Owner

@github-actions[bot] commented on GitHub (Feb 8, 2026):

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

  • #10416: OpenCode is not private by default? - Discusses privacy concerns about session data and local storage
  • #459: Privacy and Data Collection Clarification Request - Addresses broader privacy and data storage documentation concerns
  • #4961: Feature Request: Zero-Trust Architecture for Environment Variable Security - Related security request about preventing sensitive data transmission/storage
  • #7982: There is a security issue with the share function - Raises concerns about data security and sharing

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue might be a duplicate of existing issues. Please check: - #10416: OpenCode is not private by default? - Discusses privacy concerns about session data and local storage - #459: Privacy and Data Collection Clarification Request - Addresses broader privacy and data storage documentation concerns - #4961: Feature Request: Zero-Trust Architecture for Environment Variable Security - Related security request about preventing sensitive data transmission/storage - #7982: There is a security issue with the share function - Raises concerns about data security and sharing Feel free to ignore if none of these address your specific case.
Author
Owner

@tredondo commented on GitHub (Feb 8, 2026):

there is a risk of sensitive information being exposed if the device is sold, lost, or accessed by unauthorized users.

I think the first two concerns are outside the scope of OpenCode, and better addressed by wiping and full disk encryption (along with many other concerns that encryption at rest would address).

@tredondo commented on GitHub (Feb 8, 2026): > there is a risk of sensitive information being exposed if the device is **sold, lost**, or accessed by unauthorized users. I think the first two concerns are outside the scope of OpenCode, and better addressed by wiping and full disk encryption (along with many other concerns that encryption at rest would address).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8869