AgentLair Vault — Runtime Credential Storage for Agents
Keep 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: INLINECODE2
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.
Setup: Get an API Key
Self-service, no email required:
CODEBLOCK0
Response:
CODEBLOCK1
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.
When to Use This Skill
Use this skill when:
- - An agent needs to use an API key (Anthropic, OpenAI, Stripe, Slack, etc.)
- A user asks to store, retrieve, rotate, or revoke a credential
- You want to avoid storing secrets in
openclaw.json or environment variables - You're setting up a new agent and need to provision credentials
- A skill needs a third-party token that shouldn't be exposed to the filesystem
Do not use openclaw.json or environment variables for third-party API keys if you can store them in vault instead.
Store a Secret (Setup / Rotation)
Store any secret under a named key. Use descriptive names (anthropic-key, stripe-live, slack-bot-token).
CODEBLOCK2
Response (first store, HTTP 201):
CODEBLOCK3
Response (update / rotation, HTTP 200):
CODEBLOCK4
Key naming rules: 1–128 characters, alphanumeric + _, -, INLINECODE13
Optional metadata object (max 4KB): human-readable context. Not the secret — just labels, service names, expiry hints. Never put secret values in metadata.
Fetch a Secret at Runtime
Retrieve a stored secret by name. The ciphertext field contains the stored value.
CODEBLOCK5
Response:
CODEBLOCK6
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"
List All Secrets
Get metadata for all stored keys (never returns ciphertext/values):
CODEBLOCK8
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"
}
Rotate a Secret
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.
CODEBLOCK10
All agents fetching GET /v1/vault/anthropic-key automatically get the new value on their next call — no config changes, no restarts.
Revoke a Secret
Delete a key and all its versions:
CODEBLOCK11
Response:
CODEBLOCK12
Delete a specific version only:
curl -s -X DELETE "https://agentlair.dev/v1/vault/anthropic-key?version=1" \
-H "Authorization: Bearer $AGENTLAIR_API_KEY"
Free Tier Limits
| Limit | Value |
|---|
| Keys per account | 10 |
| Versions per key |
3 (oldest pruned automatically) |
| Max value size | 16 KB |
| API requests per day | 100 |
Example Session
User: "Store my Stripe API key in the vault and then use it to check my balance"
Agent actions:
- 1. Store the Stripe key in vault:
CODEBLOCK14
- 2. Fetch the key at runtime:
CODEBLOCK15
- 3. Use it:
CODEBLOCK16
- 4. Confirm to user: "Stripe key stored in vault as
stripe-live. Current balance retrieved."
Why Vault Instead of openclaw.json
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:
- - Only
AGENTLAIR_API_KEY is in your environment. Everything else is fetched at runtime. - No credentials on disk.
grep -r "sk-" ~/.openclaw/ finds nothing. - Audit trail. Every credential fetch is logged. Unexpected access at 3am is visible.
- Rotation without restarts. Rotate once in vault — every agent gets the new value immediately.
- Scoped access. One AGENTLAIRAPIKEY can't read another account's keys.
The blast radius of a compromised skill drops from "all credentials on the machine" to "one rate-limited API key with an audit log."
Client-Side Encryption (Optional)
For secrets you don't want AgentLair to see in plaintext, encrypt before storing:
CODEBLOCK17
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.
Trust & Security
Notes
- - The vault stores values as opaque blobs — AgentLair never interprets the content
- Version history retained up to tier limit (3 versions free, 100 paid) — oldest pruned automatically
- Recovery: register a recovery email via
POST /v1/vault/recovery-email to access vault contents if you lose your API key - Built by AgentLair — infrastructure for autonomous agents
AgentLair Vault — 代理运行时凭据存储
将凭据移出~/.openclaw/openclaw.json。将其存储在AgentLair Vault中。在运行时获取。通过一次API调用即可轮换。
基础URL: https://agentlair.dev
认证: Authorization: Bearer $AGENTLAIRAPIKEY
代理持有的是保险库令牌,而非凭据本身。 只有AGENTLAIRAPIKEY存在于环境中——其他所有内容均通过经过审计、限速的API在运行时获取。
设置:获取API密钥
自助服务,无需邮箱:
bash
curl -s -X POST https://agentlair.dev/v1/auth/keys \
-H Content-Type: application/json \
-d {}
响应:
json
{apikey: allive..., accountid: acc..., tier: free, createdat: ...}
将apikey作为AGENTLAIRAPI_KEY存储在环境中。这是唯一需要放在环境或配置文件中的凭据。
何时使用此技能
在以下情况下使用此技能:
- - 代理需要使用API密钥(Anthropic、OpenAI、Stripe、Slack等)
- 用户要求存储、检索、轮换或撤销凭据
- 您希望避免在openclaw.json或环境变量中存储密钥
- 您正在设置新代理并需要配置凭据
- 某个技能需要不应暴露给文件系统的第三方令牌
不要使用openclaw.json或环境变量存储第三方API密钥——如果可以将它们存储在保险库中。
存储密钥(设置/轮换)
在命名键下存储任何密钥。使用描述性名称(anthropic-key、stripe-live、slack-bot-token)。
bash
curl -s -X PUT https://agentlair.dev/v1/vault/anthropic-key \
-H Authorization: Bearer $AGENTLAIRAPIKEY \
-H Content-Type: application/json \
-d {ciphertext: sk-ant-YOUR-KEY-HERE, metadata: {label: Anthropic API key, service: anthropic}}
响应(首次存储,HTTP 201):
json
{
key: anthropic-key,
stored: true,
version: 1,
created_at: 2026-03-27T...,
updated_at: 2026-03-27T...
}
响应(更新/轮换,HTTP 200):
json
{
key: anthropic-key,
stored: true,
version: 2,
created_at: 2026-03-27T...,
updated_at: 2026-03-27T...
}
键命名规则: 1–128个字符,字母数字 + _、-、.
可选的metadata对象(最大4KB):人类可读的上下文。不是密钥——只是标签、服务名称、过期提示。切勿将密钥值放入元数据。
在运行时获取密钥
按名称检索存储的密钥。ciphertext字段包含存储的值。
bash
curl -s https://agentlair.dev/v1/vault/anthropic-key \
-H Authorization: Bearer $AGENTLAIRAPIKEY
响应:
json
{
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...
}
使用ciphertext(或value——两者返回相同内容)字段作为凭据。
检索特定版本:
bash
curl -s https://agentlair.dev/v1/vault/anthropic-key?version=1 \
-H Authorization: Bearer $AGENTLAIRAPIKEY
列出所有密钥
获取所有存储键的元数据(从不返回密文/值):
bash
curl -s https://agentlair.dev/v1/vault/ \
-H Authorization: Bearer $AGENTLAIRAPIKEY
响应:
json
{
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
}
轮换密钥
轮换是使用新值进行PUT操作。创建新版本。旧版本会被保留(免费层级最多3个版本)以便回滚。
bash
curl -s -X PUT https://agentlair.dev/v1/vault/anthropic-key \
-H Authorization: Bearer $AGENTLAIRAPIKEY \
-H Content-Type: application/json \
-d {ciphertext: sk-ant-NEW-ROTATED-KEY, metadata: {label: Anthropic API key, rotated_at: 2026-03-27}}
所有执行GET /v1/vault/anthropic-key的代理将在下次调用时自动获取新值——无需配置更改,无需重启。
撤销密钥
删除一个键及其所有版本:
bash
curl -s -X DELETE https://agentlair.dev/v1/vault/anthropic-key \
-H Authorization: Bearer $AGENTLAIRAPIKEY
响应:
json
{key: anthropic-key, deleted: true, versions_removed: 2}
仅删除特定版本:
bash
curl -s -X DELETE https://agentlair.dev/v1/vault/anthropic-key?version=1 \
-H Authorization: Bearer $AGENTLAIRAPIKEY
免费层级限制
3(自动修剪最旧版本) |
| 最大值大小 | 16 KB |
| 每日API请求数 | 100 |
示例会话
用户: 将我的Stripe API密钥存储在保险库中,然后用它检查我的余额
代理操作:
- 1. 将Stripe密钥存储在保险库中:
bash
curl -s -X PUT https://agentlair.dev/v1/vault/stripe-live \
-H Authorization: Bearer $AGENTLAIR
APIKEY \
-H Content-Type: application/json \
-d {ciphertext: sk
liveUSER
PROVIDEDKEY, metadata: {label: Stripe live key, service: stripe}}
- 2. 在运行时获取密钥:
bash
STRIPE_KEY=$(curl -s https://agentlair.dev/v1/vault/stripe-live \
-H Authorization: Bearer $AGENTLAIR
APIKEY | grep -o ciphertext:[^]* | cut -d -f4)
- 3. 使用它:
bash
curl -s https://api.stripe.com/v1/balance \
-H Authorization: Bearer $STRIPE_KEY
- 4. 向用户确认:Stripe密钥已作为stripe-live存储在保险库中。已检索当前余额。
为什么使用Vault而不是openclaw.json
OpenClaw的默认凭据存储(~/.openclaw/openclaw.json)将API密钥以明文形式放在磁盘上。在您的代理上运行的恶意ClawHub技能可以读取其中的所有内容——以及~/.aws/、~/.ssh/和代理进程中的任何环境变量。
使用AgentLair Vault:
- - 只有AGENTLAIRAPIKEY在您的环境中。 其他所有内容都在运行时获取。
- 磁盘上没有凭据。 grep -r sk- ~/.openclaw/找不到任何内容。
- 审计追踪。 每次凭据获取都会被记录。凌晨3点的意外访问可见。
- 无需重启即可轮换。 在保险库中轮换一次——每个代理立即获取新值。
- 作用域访问。 一个AGENTLAIRAPIKEY无法读取另一个账户的密钥。
受损技能的爆炸半径从机器上的所有凭据降至