🚧 SanctumAI is in beta. APIs may change before v1.0.
ConceptsVaults

Vaults

A vault is the top-level encrypted container in SanctumAI. It holds credentials, agent identities, policies, and the audit log.

Architecture

Every vault consists of two on-disk components:

FilePurpose
~/.sanctum/vault.sealedEncrypted blob containing the master DEK (data encryption key)
~/.sanctum/vault.dbSQLite database with metadata, agents, policies, and audit entries

The vault uses envelope encryption: a master key encrypts individual data encryption keys (DEKs), and each credential gets its own unique DEK.

Encryption Model

Master Password
      β”‚
      β–Ό (Argon2id KDF)
Passphrase Key
      β”‚
      β–Ό (AES-256-GCM)
Master DEK ──────────────────────────────┐
      β”‚                                  β”‚
      β–Ό (AES-256-GCM)                   β–Ό (AES-256-GCM)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DEK-1    β”‚  β”‚ DEK-2    β”‚  β”‚ DEK-N    β”‚
β”‚ (secret) β”‚  β”‚ (secret) β”‚  β”‚ (secret) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Argon2id derives the passphrase key from your master password (memory-hard, GPU-resistant)
  • AES-256-GCM provides authenticated encryption β€” tampering is detected
  • Each credential’s DEK is unique β€” compromising one doesn’t expose others

Vault States

StateDescription
SealedVault exists but master key is not in memory. No operations possible.
UnlockedMaster password provided, DEK loaded. Full read/write access.
LockedMaster key zeroized from memory. Must unlock again.

The daemon manages vault state. When idle for a configurable period, the vault auto-locks.

macOS Keychain Integration

On macOS, Sanctum can optionally cache the master key in the system Keychain, protected by Touch ID or your login password. This avoids re-entering the master password on every daemon restart.

sanctum init --keychain

File Permissions

All vault files are created with 0600 (owner read/write only). The ~/.sanctum/ directory is 0700.