Key hierarchy
Key providers
aivault supports four key providers. Choose one when initializing the vault.macOS Keychain (default on macOS)
Passphrase
Environment variable
File
Auto-initialization
On first run,aivault status (or any command that needs the vault) auto-initializes with safe defaults:
- macOS (canonical install): uses macOS Keychain with service
aivault(and falls back to the file provider if Keychain is unavailable) - Other platforms (canonical install): uses the file provider with a key at
~/.aivault/keys/kek.key(outside the vault directory) - When
AIVAULT_DIRis set: uses the file provider with a key at$AIVAULT_DIR/kek.key(useful for isolated tests)
Secret lifecycle
| Event | What happens |
|---|---|
| Create | Secret value encrypted, DEK wrapped, metadata stored, audit event logged |
| Read | Metadata returned (value never returned to caller) |
| Rotate | New value encrypted with new DEK, old DEK discarded, audit event logged |
| Delete | Secret record removed, audit event logged |
| Attach/detach group | Secret’s group membership updated for isolation |
Associated data (AAD)
Each encrypted secret includes authenticated associated data (AAD v2+):- Secret ID
- Scope (global / workspace / group)
- Pinned provider (if registry-matched)