Security middleware for AI agents handling money. Non-custodial crypto wallets and virtual Visa cards with spending limits, whitelists, and human approval.
You have access to ClawVault, a security middleware for AI agents. ClawVault protects TWO spending channels:
Both channels use the same rules engine. Every transaction is validated against user-defined rules. Transactions within rules auto-approve; transactions outside rules require human approval via Telegram or dashboard.
https://api.clawvault.cc
All requests require your API key in the Authorization header:
Authorization: Bearer ${CLAWVAULT_API_KEY}
Get your API key at: https://clawvault.cc/agents
When you need to send USDC to a blockchain address:
POST /v1/payments
Content-Type: application/json
{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "base",
"reason": "Payment for services rendered",
"skill": "transfer"
}
{
"success": true,
"data": {
"id": "pi_abc123",
"status": "pending",
"expiresAt": "2026-02-27T12:00:00Z"
}
}
auto_approved - Payment executed immediately (within rules)pending - Awaiting human approval via Telegram/dashboarddenied - Payment was rejectedexpired - Approval window closed (5 minutes)Before making a payment, check if it will auto-approve or need manual approval:
POST /v1/rules/check
Content-Type: application/json
{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234...",
"chain": "base"
}
{
"success": true,
"data": {
"allowed": true,
"autoApprove": false,
"reason": "Manual mode",
"remainingBudget": { "daily": 450.00 },
"remainingTx": { "daily": 46 }
}
}
If autoApprove: false, tell the user the payment needs their approval.
Check your vault balance and current limits:
GET /v1/vault
{
"success": true,
"data": {
"chain": "base",
"balances": [{ "token": "USDC", "balance": "150.00" }],
"rules": {
"mode": "manual",
"perTxLimit": 500,
"dailyTxMax": 20
}
}
}
Use the Agent Card when you need to pay for:
POST /v1/card/purchase
Content-Type: application/json
{
"amount": 20.00,
"currency": "USD",
"merchant": "OpenAI API",
"merchant_category": "api_services",
"reason": "GPT-4 API credits for research task"
}
{
"success": true,
"data": {
"id": "card_txn_abc123",
"status": "approved",
"card_credentials": {
"number": "4242837419283847",
"exp_month": 3,
"exp_year": 2028,
"cvc": "847"
},
"valid_for_seconds": 300
}
}
{
"success": true,
"data": {
"id": "card_txn_abc123",
"status": "pending_approval",
"reason": "Amount exceeds auto-approve threshold"
}
}
IMPORTANT: Card credentials are temporary and single-use. Use them immediately at the merchant checkout. Never log or store card credentials.
GET /v1/card/balance
{
"success": true,
"data": {
"balance": 450.00,
"currency": "USD",
"spent_today": 50.00,
"spent_this_month": 350.00,
"daily_limit": 500.00,
"monthly_limit": 5000.00
}
}
Before making a purchase, check if it's allowed:
POST /v1/card/check
Content-Type: application/json
{
"amount": 20.00,
"merchant_category": "api_services"
}
{
"success": true,
"data": {
"allowed": true,
"autoApprove": true,
"reason": "Within limits, allowed category"
}
}
GET /v1/payments/{payment_id}
GET /v1/card/transactions/{transaction_id}
GET /v1/transactions?limit=10
GET /v1/card/transactions?limit=10
Use this logic to decide which channel to use:
| Scenario | Use |
|---|---|
| Paying a blockchain address (0x...) | Crypto (/v1/payments) |
| Paying for SaaS subscription | Card (/v1/card/purchase) |
| Paying for API credits | Card (/v1/card/purchase) |
| Paying for cloud services | Card (/v1/card/purchase) |
| Paying for any online service | Card (/v1/card/purchase) |
| Sending money to another person's crypto wallet | Crypto (/v1/payments) |
| DeFi, staking, token swaps | Crypto (/v1/payments) |
Rule of thumb: If it's a blockchain address, use crypto. If it's a company/service, use the card.
When a transaction requires approval:
Always inform the user when approval is required: "This transaction needs your approval. Check your Telegram or ClawVault dashboard."
/v1/card/check to verify it's allowed/v1/card/purchase with merchant="OpenAI API"status: "approved", use the card credentials at checkout immediatelystatus: "pending_approval", tell user: "This purchase needs your approval. Check Telegram or ClawVault dashboard."/v1/rules/check to see if it will auto-approve/v1/payments with the recipient addressstatus: "pending", tell user to approve in TelegramTell the user: "The purchase was denied. Reason: {reason}. Check ClawVault dashboard for details."
Tell the user: "Insufficient card balance. Current balance: ${balance}. The card needs to be funded."
| Code | Meaning | Action |
|---|---|---|
INVALID_KEY | Bad API key | Check your API key |
TIER_LIMIT_EXCEEDED | Monthly limit reached | User needs to upgrade |
INSUFFICIENT_BALANCE | Not enough funds | User needs to deposit (crypto) or fund card |
RULE_VIOLATION | Outside allowed parameters | Check the reason field |
CARD_FROZEN | Card is frozen | User needs to unfreeze in dashboard |
MERCHANT_BLOCKED | Merchant category not allowed | Cannot purchase from this merchant |
CARD_NOT_ACTIVE | Card not set up | User needs to apply for Agent Card |
{
"success": false,
"error": {
"code": "RULE_VIOLATION",
"message": "Exceeds per-transaction limit of $100"
}
}
/v1/rules/check or /v1/card/check before transactionshttps://basescan.org/tx/{txHash}ZIP package — ready to use