.polpo/vault.enc. It lets agents securely access API keys, OAuth tokens, SMTP credentials, and other secrets at runtime without exposing them in plaintext config files.
How it works
Credentials are stored as AES-256-GCM encrypted JSON. The file format is a binary blob:The decrypted structure is
Record<agentName, Record<serviceName, VaultEntry>>. Each agent can only access its own entries via vault tools.Encryption key resolution
The vault key is resolved in order:POLPO_VAULT_KEY environment variable
Set
POLPO_VAULT_KEY to a hex-encoded 32-byte key (64 hex characters). This takes priority and is recommended for CI/CD and production deployments.VaultEntry types
Each entry in the vault has atype, an optional label, and a credentials map.
| Type | Use case | Typical credential fields |
|---|---|---|
smtp | Email sending | host, port, user, pass |
imap | Email reading | host, port, user, pass |
oauth | OAuth tokens | client_id, client_secret, refresh_token |
api_key | Third-party API keys | apiKey (or any key name) |
login | Username/password pairs | username, password |
custom | Anything else | Any key-value pairs |
Environment variable references
Credential values can be literals or${ENV_VAR} references that are resolved at runtime:
vault_get, the ${SMTP_PASSWORD} placeholder is replaced with the value of the SMTP_PASSWORD environment variable.
VaultStore API
TheVaultStore class provides programmatic access when building custom integrations:
| Method | Signature | Description |
|---|---|---|
get | get(agent, service) | Retrieve a single entry |
set | set(agent, service, entry) | Create or update an entry |
remove | remove(agent, service) | Delete an entry |
list | list(agent) | List service names for an agent |
getAllForAgent | getAllForAgent(agent) | Retrieve all entries for an agent |
Agent vault tools
Agents access the vault through two built-in tools that are always available when avault.enc file exists in the project:
| Tool | Description |
|---|---|
vault_get | Retrieve credentials for a specific service |
vault_list | List available service names for the calling agent |
Agents can only access their own vault entries. An agent named
back-office cannot read entries belonging to researcher. The orchestrator has read access to all entries.Examples
- SMTP credentials
- API key
- OAuth
CLI setup
Thepolpo agent onboard command includes an interactive vault setup flow that walks you through adding credentials for the agent being onboarded.
Git safety
Safe to commit
.polpo/vault.enc — encrypted, opaque without the key.Must be gitignored
~/.polpo/vault.key — the decryption key. Add it to your global gitignore..gitignore should include: