sanctum-core
Pure, synchronous credential vault library for AI agent infrastructure.
No daemon. No sockets. No async runtime. Just embed it in your Rust application.
Quick Start
use ;
// Initialize a new vault
let vault = init?;
// Store a credential
vault.store?;
// Retrieve it
let secret = vault.retrieve?;
// List all credentials
let creds = vault.list_credentials?;
// Query the audit log
let entries = vault.audit_log?;
Opening an Existing Vault
let vault = open?;
vault.unlock?;
let secret = vault.retrieve?;
Policy Enforcement
use ;
let vault = init?;
// Add a policy
let policy = Policy ;
vault.add_policy?;
// Policy is checked automatically on retrieve
let secret = vault.retrieve?;
Thread Safety
Vault is Send + Sync — share it across threads with Arc:
use Arc;
let vault = new;
let v = clone;
spawn;
Features
- AES-256-GCM encryption with scrypt key derivation
- Hash-chained audit log — tamper-evident by design
- Glob-based policy engine with rate limiting
- SQLite metadata + binary sealed vault for secrets
- Zero-copy secret handling with zeroize-on-drop
Architecture
The Vault facade composes three subsystems:
| Layer | Purpose |
|---|---|
VaultStore |
SQLite metadata + SealedVault encrypted storage |
PolicyEngine |
Glob-based access control with rate limiting |
AuditLogger |
Hash-chained, tamper-evident audit entries |
License
See repository root for license information.