Skip to content

Encrypt stored provider secrets by default (safeStorage is opt-in today) #1715

Closed

Description

@currentbits

electron/secrets.js encrypts stored credentials with Electron safeStorage (Keychain/DPAPI/libsecret), but it is disabled unless SOLENTA_ENABLE_SAFE_STORAGE=1. Provider instance env values (settings.providerInstances[].env, often API keys) are therefore stored in plaintext.

The planned providers page, which invites pasting API keys, makes this a prerequisite.

Scope

  • Turn encryption on by default for secret fields and env values flagged secret
  • Migrate existing plaintext values on first load; keep reads working for both formats
  • Fallback when safeStorage.isEncryptionAvailable() is false (e.g. Linux without libsecret): warn in the UI, don't silently drop keys
  • Find out why it was made opt-in (git log on electron/secrets.js) before flipping the default. There may be a keychain-prompt or re-sign issue (see the stale TCC grant / re-sign history).

Activity

  1. added
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Oct 28, 2026
  2. currentbits commented on Oct 28, 2026

    @currentbits
    OwnerAuthor

    Merged into coder/research-https-cline-bot-and-see-what-fe-775256 (it will ship in the same PR as the #1714 providers page).

    • On by default when app.isPackaged; off for dev runs; SOLENTA_ENABLE_SAFE_STORAGE=1/0 forces either way.
    • Sealed values that can't be opened are kept byte-for-byte and reported as secretStorage.locked; they are never dropped.
    • settings.secretStorage.encryption: on | off | unavailable → "Secrets are stored unencrypted on this machine" note in provider settings.

    Release caveats

    • Prod and Nightly share userData and the "Solenta Safe Storage" keychain item but have different signatures, so each prompts for keychain access once.
    • A build without this change drops enc:v1: values on load. Ship prod and Nightly together.
    • Ad-hoc-signed local packaged builds will prompt; escape hatch SOLENTA_ENABLE_SAFE_STORAGE=0.
    • A locked value can't be cleared by blanking the field (replace it or delete the row). Renaming an MCP server or GitHub host whose secret is locked loses that ciphertext.
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

    plan:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions