Install
openclaw skills install agentlair-vaultStore and fetch credentials securely at runtime via AgentLair Vault REST API. Use when an agent needs to read an API key, store a secret, rotate credentials, or avoid putting secrets in openclaw.json. Credentials stay in the vault — only the AGENTLAIR_API_KEY lives in your environment. Use instead of environment variables or openclaw.json for third-party API keys, tokens, and secrets.
openclaw skills install agentlair-vaultKeep credentials out of ~/.openclaw/openclaw.json. Store them in AgentLair Vault. Fetch them at runtime. Rotate with one API call.
Base URL: https://agentlair.dev
Auth: Authorization: Bearer $AGENTLAIR_API_KEY
The agent holds a vault token. Not the credential itself. Only AGENTLAIR_API_KEY lives in the environment — everything else is fetched at runtime through an audited, rate-limited API.
Self-service, no email required:
curl -s -X POST https://agentlair.dev/v1/auth/keys \
-H "Content-Type: application/json" \
-d '{}'
Response:
{"api_key": "al_live_...", "account_id": "acc_...", "tier": "free", "created_at": "..."}
Store api_key as AGENTLAIR_API_KEY in your environment. This is the only credential that needs to be in your environment or config file.
Use this skill when:
openclaw.json or environment variablesDo not use openclaw.json or environment variables for third-party API keys if you can store them in vault instead.
Store any secret under a named key. Use descriptive names (anthropic-key, stripe-live, slack-bot-token).
curl -s -X PUT "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ciphertext": "sk-ant-YOUR-KEY-HERE", "metadata": {"label": "Anthropic API key", "service": "anthropic"}}'
Response (first store, HTTP 201):
{
"key": "anthropic-key",
"stored": true,
"version": 1,
"created_at": "2026-03-27T...",
"updated_at": "2026-03-27T..."
}
Response (update / rotation, HTTP 200):
{
"key": "anthropic-key",
"stored": true,
"version": 2,
"created_at": "2026-03-27T...",
"updated_at": "2026-03-27T..."
}
Key naming rules: 1–128 characters, alphanumeric + _, -, .
Optional metadata object (max 4KB): human-readable context. Not the secret — just labels, service names, expiry hints. Never put secret values in metadata.
Retrieve a stored secret by name. The ciphertext field contains the stored value.
curl -s "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Response:
{
"key": "anthropic-key",
"ciphertext": "sk-ant-YOUR-KEY-HERE",
"value": "sk-ant-YOUR-KEY-HERE",
"metadata": {"label": "Anthropic API key", "service": "anthropic"},
"version": 1,
"latest_version": 1,
"created_at": "2026-03-27T...",
"updated_at": "2026-03-27T..."
}
Use the ciphertext (or value — both return the same thing) field as the credential.
To retrieve a specific version:
curl -s "https://agentlair.dev/v1/vault/anthropic-key?version=1" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Get metadata for all stored keys (never returns ciphertext/values):
curl -s "https://agentlair.dev/v1/vault/" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Response:
{
"keys": [
{
"key": "anthropic-key",
"version": 1,
"metadata": {"label": "Anthropic API key"},
"created_at": "2026-03-27T...",
"updated_at": "2026-03-27T..."
}
],
"count": 1,
"limit": 10,
"tier": "free"
}
Rotation is a PUT with the new value. Creates a new version. The old version is retained (up to 3 versions on free tier) for rollback.
curl -s -X PUT "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ciphertext": "sk-ant-NEW-ROTATED-KEY", "metadata": {"label": "Anthropic API key", "rotated_at": "2026-03-27"}}'
All agents fetching GET /v1/vault/anthropic-key automatically get the new value on their next call — no config changes, no restarts.
Delete a key and all its versions:
curl -s -X DELETE "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Response:
{"key": "anthropic-key", "deleted": true, "versions_removed": 2}
Delete a specific version only:
curl -s -X DELETE "https://agentlair.dev/v1/vault/anthropic-key?version=1" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
| Limit | Value |
|---|---|
| Keys per account | 10 |
| Versions per key | 3 (oldest pruned automatically) |
| Max value size | 16 KB |
| API requests per day | 100 |
User: "Store my Stripe API key in the vault and then use it to check my balance"
Agent actions:
curl -s -X PUT "https://agentlair.dev/v1/vault/stripe-live" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ciphertext": "sk_live_USER_PROVIDED_KEY", "metadata": {"label": "Stripe live key", "service": "stripe"}}'
STRIPE_KEY=$(curl -s "https://agentlair.dev/v1/vault/stripe-live" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" | grep -o '"ciphertext":"[^"]*"' | cut -d'"' -f4)
curl -s "https://api.stripe.com/v1/balance" \
-H "Authorization: Bearer $STRIPE_KEY"
stripe-live. Current balance retrieved."OpenClaw's default credential storage (~/.openclaw/openclaw.json) puts API keys on disk in plaintext. A malicious ClawHub skill running on your agent can read everything there — plus ~/.aws/, ~/.ssh/, and any environment variables in the agent's process.
With AgentLair Vault:
AGENTLAIR_API_KEY is in your environment. Everything else is fetched at runtime.grep -r "sk-" ~/.openclaw/ finds nothing.The blast radius of a compromised skill drops from "all credentials on the machine" to "one rate-limited API key with an audit log."
For secrets you don't want AgentLair to see in plaintext, encrypt before storing:
# Encrypt locally before storing
SECRET="sk-ant-YOUR-KEY"
ENCRYPTED=$(echo -n "$SECRET" | openssl enc -aes-256-cbc -base64 -k "$LOCAL_PASSPHRASE")
curl -s -X PUT "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"ciphertext\": \"$ENCRYPTED\", \"metadata\": {\"encrypted\": \"aes-256-cbc\", \"label\": \"Anthropic API key\"}}"
# Decrypt when fetching
CIPHERTEXT=$(curl -s "https://agentlair.dev/v1/vault/anthropic-key" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY" | grep -o '"ciphertext":"[^"]*"' | cut -d'"' -f4)
PLAINTEXT=$(echo "$CIPHERTEXT" | openssl enc -aes-256-cbc -d -base64 -k "$LOCAL_PASSPHRASE")
Use this when zero-knowledge storage is required. $LOCAL_PASSPHRASE never leaves your environment.
The agentlair-vault-crypto library provides TypeScript helpers for client-side encryption/decryption with AES-256 and key derivation.
POST /v1/vault/recovery-email to access vault contents if you lose your API key