Skip to content

Encrypt stored provider credentials at rest (Electron safeStorage) #543

Closed

Description

@currentbits

Source: research round 30. A grep of electron/ shows no use of safeStorage, encryptString, or keychain APIs, which means provider tokens and account credentials are almost certainly sitting in plaintext in the store file. Meanwhile the ecosystem is moving the other way: today's Show HN was a data-protection keychain library for Electron apps, Orca uses Keychain-backed device tokens for pairing, and intentic keeps credentials inside capabilities the agent never sees.

For a local-first product, plaintext-at-rest is the weak point in the story: the whole pitch is "your machine is the trust boundary," and any process that can read the userData directory currently owns every provider account. This is also squarely in the threat model of #128's family (loopback squatting) and the ClawHavoc lesson (malicious skills read config dirs).

Scope:

  • Encrypt all stored secrets (provider tokens, AHP/pairing tokens, MCP OAuth credentials) with Electron safeStorage.encryptString before writing to disk; decrypt only in the main process at point of use.
  • Key management is OS-native: Keychain on macOS, DPAPI on Windows, libsecret on Linux. Handle the headless-Linux no-libsecret case with a loud warning, not silent plaintext.
  • Migration: on first run after upgrade, encrypt existing plaintext entries in place; log the migration count.
  • Audit companion to Governance layer: per-agent permission matrix, OS sandbox profiles, audit trail #262: the audit trail records when a credential was decrypted for injection (pairs with Secret placeholders: orchestrator substitutes real values, agents never see them #289's substitution log).
  • Non-goal: encrypting transcripts/memory (separate question, bigger blast radius).

Activity

  1. added
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Aug 18, 2026
  2. currentbits commented on Aug 22, 2026

    @currentbits
    OwnerAuthor

    Landed on main in the 2026-08-22 backlog merge (2d33d30..bf7c4dc, released as nightly nightly-202608220926-bf7c4dc).

    Evidence on main: electron/secrets.js; settings sealed in the JSON payload only

    The branch had been finished for a while but was never merged; verification after landing: typecheck clean, vite build ok, core 38/38, renderer 1468/1468, memory 204/204, electron 1848/1848.

  3. added
    plan:done
    and removed
    plan:doing
    on Aug 22, 2026
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:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions