Skip to content

Make the profile passphrase optional and off by default (ADR-0050) - #67

Open
James-Chapman wants to merge 1 commit into
mainfrom
claude/optional-profile-passphrase
Open

James-Chapman wants to merge 1 commit into
mainfrom
claude/optional-profile-passphrase

Conversation

@James-Chapman

Copy link
Copy Markdown
Contributor

Summary

The profile passphrase (ADR-0006) is now optional and off by default. A new profile opens with no prompt. The stores stay encrypted, and the OS vault wraps the store key. Users can turn the passphrase on or off in Settings, Security.

What changed

  • Store (crates/core/src/store.rs):
    • A new profile writes store-key.v1 (the vault-wrapped bare key) with read-back, and opens with no prompt.
    • A store-key.v1 profile opens with no prompt; the forced upgrade is removed. A store-key.v2 profile still asks for its passphrase.
    • When both key files exist, v2 wins and v1 is deleted, so an interrupted switch leaves the passphrase on.
  • Session: the new set_profile_passphrase(on) asks in the core's window on a thread without a lease. It writes the key file under transition only if the same session is still open. A lock during the prompt drops the answer.
  • Idle lock: off while the profile has no passphrase. The saved setting is kept.
  • Contracts and protocol:
    • SecurityStatus.profilePassphrase
    • SecurityOperation::WaitingForPassphrase
    • SecurityError::{PassphraseRejected, ProfileUnavailable}
    • Call::SetProfilePassphrase { on }
    • The Tauri command and permission. Only the boolean crosses IPC.
  • UI:
    • A "Profile passphrase" panel in Settings, Security.
    • Lock (button, menu, Settings panel, shortcut) and the idle-lock setting show only while the passphrase is on. Unlock is unchanged.
  • Docs:
    • New ADR-0050, with cross-links from ADR-0006 and ADR-0025.
    • README, PRIVACY, development guide and security design updated.

Why it changed

The owner asked on 17 November 2026 for the passphrase to be optional and off by default. The owner chose a vault-only key over plaintext stores, kept existing passphrases with a way to turn them off, and hid Lock while the passphrase is off. ADR-0050 records the trade-off: without a passphrase, a process running as the user can open the profile.

Tests

Updated

  • crates/core/tests/store.rs, session.rs, account.rs: the creation and v1-upgrade cases now cover the new rules.
  • src-tauri/tests/ipc.rs: mock statuses and the capability list.
  • frontend/tests/views.test.mjs: Security buttons and Preferences render calls.

New

  • Store: a new profile writes only v1; turning on and off, including cancel and too many wrong entries; v2 wins over v1.
  • Session: the switch is refused unless the profile is open; a lock during the prompt writes nothing; the idle lock applies only with a passphrase.
  • Serving loop: an end-to-end test of set_profile_passphrase (serve.rs).
  • Contracts and protocol: wire and strict-decoding cases.
  • Frontend: panel text and buttons, wait and error text, the idle-lock select hidden when off, and lockOffered.

Checks run on Windows:

Check Result
cargo test --locked --workspace --exclude persephone-call-worker --all-targets 810 passed, 0 failed, 5 ignored
cargo clippy (same scope, -D warnings) and cargo fmt --check clean
python tools/dev.py frontend --offline 337 passed
python tools/dev.py contracts --offline bindings current

Not run:

  • the call worker (needs libwebrtc; not touched)
  • Linux and macOS
  • live homeservers
  • a manual run of the app with the native prompts

🤖 Generated with Claude Code

A new profile now opens with no prompt. The SQLite stores stay
encrypted with the random store key, which the OS vault alone wraps in
store-key.v1. Profiles with a passphrase (store-key.v2) keep it.

Settings, Security turns the passphrase on or off through the new
set_profile_passphrase command. The core asks for the passphrase in its
own window on a thread without a lease, and writes the key file under
the transition lock only while the same session is still open. When
both key files exist, store-key.v2 wins, so an interrupted switch
leaves the passphrase on.

Lock, the lock shortcut and the idle-lock setting show only while the
passphrase is on, and the core does not run the idle lock without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56785f8e-97a9-4fe5-b2ff-5bb202a5853c
Commits

Reviewing files that changed from the base of the PR and between cfe0194 and 1d75945.

Files ignored due to path filters: 1

  • crates/contracts/generated/contracts.ts is excluded by !**/generated/**
Files selected for processing: 38

  • PRIVACY.md
  • README.md
  • crates/contracts/src/lib.rs
  • crates/contracts/tests/contracts.rs
  • crates/core-protocol/src/lib.rs
  • crates/core/src/credentials.rs
  • crates/core/src/lib.rs
  • crates/core/src/personal.rs
  • crates/core/src/prompt_text.rs
  • crates/core/src/session.rs
  • crates/core/src/store.rs
  • crates/core/tests/account.rs
  • crates/core/tests/serve.rs
  • crates/core/tests/session.rs
  • crates/core/tests/store.rs
  • docs/README.md
  • docs/adr/0006-require-an-unlock-secret-for-the-local-profile.md
  • docs/adr/0025-lock-after-system-idle-time-measured-in-the-core.md
  • docs/adr/0050-make-the-profile-passphrase-optional-and-off-by-default.md
  • docs/adr/index.md
  • docs/architecture/security-design.md
  • docs/development.md
  • frontend/src/Accounts.svelte
  • frontend/src/App.svelte
  • frontend/src/Preferences.svelte
  • frontend/src/Security.svelte
  • frontend/src/bridge/index.ts
  • frontend/src/help.ts
  • frontend/src/preferences.ts
  • frontend/src/securityText.ts
  • frontend/tests/bridge-calls.test.mjs
  • frontend/tests/preferences.test.mjs
  • frontend/tests/views.test.mjs
  • src-tauri/build.rs
  • src-tauri/capabilities/main.json
  • src-tauri/permissions/autogenerated/set_profile_passphrase.toml
  • src-tauri/src/lib.rs
  • src-tauri/tests/ipc.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant