RFC: Credential vault: threat model, data model and boundaries

Aperta
#218 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust, tauri

Direzione di ricerca

Read docs/guide/security.md, then inspect crates/secret-store/src/fill.rs, crates/builtin-tools/src/fill_secret.rs, and the named tests to ground the proposal in current behavior. Draft docs/design/credential-vault.md with decisions for proposal questions 1–5, compatibility and rollback, and the requested threat model and leak-channel checklist. Done when maintainers agree to the document, rejected alternatives are recorded, and the linked follow-up issues reflect its decisions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: daemon area: security enhancement help wanted needs design

size: L · first-timer: no

Security-sensitive: changes in this area need a maintainer review, and please comment before starting so we can agree on the design. This is an RFC-first issue: the first deliverable is a written proposal and a threat model, not code. Found a vulnerability? Do not file it here: see SECURITY.md.

Summary

Design a credential vault: a place where the user stores things a bot needs in order to work on their behalf (a website login, an API key, a TOTP seed, an SSH key, a secure note), which the bot can use but whose values are never sent to the model. The first deliverable is a design document with a threat model (docs/design/credential-vault.md); the issues linked below build on it.

Why it matters

Today the only ways to give a bot a password are to paste it into the chat (it then goes to the model provider and into the chat history) or to let the bot type something the user already knows. Users who want a bot to log in to a site, call an API or use git over SSH need a path where the secret stays on their machine and the model only ever sees a name and a result. A vault also makes the existing protections visible and manageable instead of an API-only feature.

Current state (the foundation already exists)

This is not a green-field design. Verified against the code:

  • Fill secrets. crates/secret-store/src/fill.rs stores an owner-defined value under fill/<name> in the normal secret store, plus metadata (exact allowed web origins, allowed desktop programs, standing grants) in fill-secrets.json. The metadata file holds names and allow-lists only, never values (FillSecretInfo: name, origins, programs, has_value, updated_at_ms). A name in a reserved namespace (composio, mcp, provider names, ...) is refused.
  • Model-facing side. crates/builtin-tools/src/fill_secret.rs implements the secret parameter of browser_fill, desktop_type and desktop_set_value and the secrets_list tool. The model names a secret; the value is read only inside the tool call, after approval and after the live origin check, held in memory, wiped on drop, and every string that leaves the module is scrubbed of the value and its encodings (Redactor, secret_variants in crates/secret-store/src/redact.rs). Tests: crates/builtin-tools/src/fill_secret_tests.rs, crates/agent-core/src/tests/fill_secret.rs.
  • Owner-only management. /v1/fill-secrets and /v1/fill-grants (crates/daemon-api/src/fill_routes.rs) are owner-only (crates/daemon-api/src/owner.rs), write an audit record before each change, and never return a value; see crates/daemon-api/src/tests/fill_secrets.rs.
  • Approval and egress. Typing a secret asks every time, except for a standing grant for exactly "this secret on this origin" (browser_fill only today). A run that has read untrusted content still gets the ask (crates/agent-core/src/taint.rs, crates/permission-engine/src/egress.rs).
  • Storage backends. OS keychain or an encrypted file (crates/secret-store/src/keyring_store.rs, file.rs: Argon2id key derivation, ChaCha20-Poly1305), chosen in open.rs.
  • Documented behaviour and limits. docs/guide/security.md, section "Secrets the assistant may type (fill secrets)". It says the Settings screen for these is "a separate, later change", and lists what is not covered (a password pasted into chat, memory not excluded from crash dumps or swap).

What is missing is everything around it: there is no UI (the desktop client has no calls to these routes), entries are a single string with no structure (no username/password pair, TOTP, SSH key), no per-bot scoping (the metadata has no bot field), autofill is "the model names the field" rather than field roles detected below the model, only management and standing-grant use are audited (not each approved use) and there is no viewer, there is no import or encrypted export, and the leak guarantees are tested for the current paths only.

Proposal and suggested approach

Deliverable 1, a design document (a PR adding docs/design/credential-vault.md) that decides:

  1. Scope and vocabulary. Does the vault evolve "fill secrets" (recommended: keep fill/<name> and fill-secrets.json compatible, add a versioned metadata schema and a forward-only migration) or replace them? One word for users: "vault entry".
  2. Entry types and which fields are secret: login (site + username + password; is the username shown to the model?), API key, TOTP seed, SSH key, secure note. Card-like data (card numbers, CVV) is either explicitly out of scope or heavily caveated; recommend out of scope, with the reasoning.
  3. Rules per entry: which bots may use it, which exact origins and programs, ask every time versus remembered (and for how long), and what a "remembered" choice can never cover.
  4. How the value gets used without the model seeing it: the model gets a name and a result code; the daemon resolves the value after the approval and the live check. For TOTP, decide whether the code is typed only (recommended default) or may be returned to the model per entry, since a 30-second code is still a credential.
  5. Backend and unlock: keychain versus encrypted file, how a headless host unlocks (the passphrase environment variable today), what happens when the backend is unavailable.
  6. Threat model (a section of the same document). Assets, actors and trust boundaries: the model provider, a prompt-injected page or mail, a malicious skill or MCP server, a paired device, another local process, someone with the disk. Explicit non-goals (a process running as the user can already read what the user can read; this is not an OS sandbox) and a leak-channel checklist that every follow-up must prove: events and the SSE stream, run journal, logs, approval cards, screenshots and live view, accessibility trees and page snapshots, memory and knowledge stores, chat history, Telegram and other channels, MCP server mode, exports and backups, clipboard, crash dumps and swap.
  7. Compatibility, migration and rollback of existing fill/ entries.
  8. How the work is sliced into the issues listed below, and which parts need a maintainer decision.

Acceptance criteria

  • Design document merged, with the maintainers' agreement recorded in this issue and an explicit list of rejected alternatives.
  • The threat model names every actor and channel above, says which are in and out of scope, and maps each in-scope channel to a test in the leak-test suite issue.
  • Each follow-up issue below is updated to match the decisions (naming, schema, what is out of scope).

Out of scope

Implementation (see the linked issues), a browser extension, syncing the vault between devices or to a cloud, being a general-purpose password manager, and storing payment cards.

Breakdown (blocked until this design is agreed)

Each of these links back here and says what it is blocked on:

  • #219 (L) Vault entry types and per-entry rules: login, API key, TOTP, SSH key, note
  • #221 (M) Settings: manage vault entries per bot and per site (can start against the current routes)
  • #222 (M) Vault audit log: record every use and show it in the app
  • #223 (L) Autofill logins by field role in the browser and desktop apps, with scrubbing (needs #219)
  • #224 (L) Vault import (CSV, Bitwarden, KeePass) and encrypted export (needs #219; coordinate with #197)
  • #220 (M) Vault leak-test suite: prove values never reach the model, logs or screenshots (can start now; every other issue adds cases)

How to get started

Read docs/guide/security.md ("Secrets the assistant may type"), then crates/secret-store/src/fill.rs, crates/builtin-tools/src/fill_secret.rs and the tests named above. Comment here with an outline of the document and your answers to questions 1 to 5.

Lingua principale
Rust
Stelle
0
Fork
1
Merge medio
6h 54m
PR unite (30g)
152

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di emreocell/Praxi-Bot

Tutte le issue di emreocell/Praxi-Bot

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.