Request flow
Every proxied request follows this pipeline:Component map
| Component | Location | Responsibility |
|---|---|---|
| Vault | src/vault/ | Encrypted secret storage, key providers, audit log |
| Broker | src/broker/ | Request validation, auth injection, upstream execution |
| Registry | registry/, src/registry.rs | Built-in provider definitions (compiled into binary) |
| CLI | src/cli.rs, src/app.rs | User-facing command interface |
| Daemon | src/daemon.rs, src/bin/aivaultd.rs | Background process for secret isolation |
Key design decisions
Host derived from policy, not caller. The upstream host is never taken from the caller’s request. It’s derived from the capability’s allow-list. This prevents SSRF and exfiltration through crafted requests. Auth headers are broker-owned. Callers cannot supply or override auth-class headers (authorization, x-api-key, etc.). The broker injects them after policy validation.
Registry compiled into binary. Provider definitions are embedded at build time from the registry/ directory. This prevents runtime forgery of provider definitions.
Single host per capability. Each capability allow-list targets exactly one host (Core conformance). This simplifies policy reasoning and prevents cross-host confusion.
Secret pinning. Secrets with names matching a registry provider’s vaultSecrets are immutably pinned to that provider. A pinned OPENAI_API_KEY can only be used for api.openai.com.