Skip to main content
This guide walks you through a complete flow: initialize the vault, store a secret, and invoke a capability — all without exposing the secret to calling code. Required reading: Security model (how aivault keeps secrets safe).

Prerequisites

  • The aivault binary installed and on your PATH (see Install)
  • On macOS/Linux, aivaultd installed alongside aivault (used by invoke by default). If you only have aivault, set AIVAULTD_DISABLE=1.
  • An API key for at least one supported provider (e.g. OpenAI)

1) Check vault status

The vault auto-initializes on first run with safe defaults:
  • macOS: uses the system Keychain
  • Other platforms: uses the file provider with a key at ~/.aivault/keys/kek.key (outside the vault directory)
If you prefer a passphrase-protected vault (manual unlock after restart), initialize explicitly:
See Vault lifecycle for all provider options.

2) Store a secret

Because OPENAI_API_KEY matches the built-in registry, this automatically:
  • Pins the secret to the openai provider (it can only be used for OpenAI hosts)
  • Provisions the openai credential
  • Enables all 17 OpenAI capabilities (chat, transcription, embeddings, images, etc.)

3) Browse capabilities

The describe command shows allowed methods, path prefixes, and example invocations.

4) Invoke a capability

The broker validates the request against capability policy, decrypts the secret from the vault, injects the auth header, and proxies the request to api.openai.com. The response is returned with auth-class headers stripped. For structured output:

5) Verify security posture

Secret values are never printed by any command. The audit log records every create, rotate, and invoke event.

What just happened

The calling code (you, a script, an agent) never saw the secret. Even if the calling code were compromised, it could only make requests the capability policy allows — to the hosts the registry defines.

Multi-secret providers

Some providers require multiple secrets (e.g. Trello needs both an API key and a token). The credential auto-provisions once all required secrets are present:

Bulk import

If you have multiple secrets to store:

Isolating test data

To use an isolated vault for testing without touching your real secrets:
Next: Security model If you’re setting this up for an agent-heavy environment, also see: