Repository navigation
feat(server): encrypt the secret store with a key kept in the OS keyring - #26648
Draft
juliusmarminge wants to merge 1 commit into
Draft
juliusmarminge wants to merge 1 commit into
juliusmarminge wants to merge 1 commit into
Conversation
Secrets in <home>/userdata/secrets were plaintext files. The store can now encrypt them with AES-256-GCM under one random key held in the OS keyring (@napi-rs/keyring). Desktop turns it on by default; standalone servers opt in with --secret-store keyring or T3CODE_SECRET_STORE. The choice persists through a keyring-id file, so CLI commands sharing the home follow it, and --secret-store file decrypts everything and removes the keyring entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Secrets in
<home>/userdata/secretsare plaintext files (mode 0600). A backup, a copied~/.t3, or any process running as the user, agents included, can read relay credentials, signing keys and provider API keys.How
ServerSecretStorecan encrypt each.binwith AES-256-GCM under one random 32-byte key kept in the OS keyring (@napi-rs/keyring, already bundled). The secret name is bound as associated data.create, mtime-based replay-marker pruning,directoryand the secret-request sweeps keep working, and no call site changes. Using one keyring item instead of one per secret avoids ~1,400 churning replay markers in the Keychain.--secret-store keyring|file/T3CODE_SECRET_STORE. Desktop defaults tokeyring; standalone servers keep files unless they opt in.keyring-idfile in the secrets directory. CLI commands that share a home (t3 pair,t3 connect, …) pass no backend and follow it.keyring-idatomically withlink, so the first of two concurrent enablers wins, then encrypts existing plaintext files.--secret-store filedecrypts everything, removeskeyring-idand deletes the keyring entry.SecretStoreKeyringErrorinstead of silently creating new signing keys.Open questions
npx t3owns its Keychain item through thenodebinary, so a Node upgrade brings back an access prompt. That's why the CLI is opt-in.Verification
ServerSecretStore.test.ts: enable → migrate → follow from another process → disable; fallback when the keyring is unavailable; startup failure when the key is lost. Config tests cover the env var and the desktop default.keyring-idwere gone. It also caught thatAsyncEntry.getSecret()returns anumber[]despite itsUint8Arraytyping; the store now normalizes it.vp run check:changedpasses.Model and harness: Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code