Security middleware for AI agents handling money. Non-custodial crypto wallets and virtual Visa cards with spending limits, whitelists, and human approval.
---
name: ClawVault Payments
description: Security middleware for AI agents handling money. Non-custodial crypto wallets and virtual Visa cards with spending limits, whitelists, and human approval.
homepage: https://clawvault.cc
source: https://github.com/andrewszk/clawvault-mcp-server
metadata:
openclaw:
emoji: "🦞"
primaryEnv: CLAWVAULT_API_KEY
requires:
env:
- name: CLAWVAULT_API_KEY
description: "Your ClawVault API key (format: cv_live_xxxxx). Get one at https://clawvault.cc/agents"
required: true
---
# ClawVault Agent Skill
You have access to ClawVault, a security middleware for AI agents. ClawVault protects TWO spending channels:
1. **Crypto payments** - USDC transfers on Base and Solana blockchains
2. **Agent Card** - Virtual Visa card for any merchant worldwide (SaaS, APIs, cloud, etc.)
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.
## Security Model
- **Non-custodial**: Your keys never leave your wallet
- **Rule-enforced**: Spending limits, whitelists, time windows enforced on-chain
- **Human-in-the-loop**: Anything outside rules requires explicit approval
- **Audit trail**: All transactions logged and visible in dashboard
## API Base URL
```
https://api.clawvault.cc
```
## Authentication
All requests require your API key in the Authorization header:
```
Authorization: Bearer ${CLAWVAULT_API_KEY}
```
Get your API key at: https://clawvault.cc/agents
---
# CRYPTO PAYMENTS (On-Chain)
## 1. Request a Crypto Payment
When you need to send USDC to a blockchain address:
```http
POST /v1/payments
Content-Type: application/json
{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"chain": "base",
"reason": "Payment for services rendered",
"skill": "transfer"
}
```
### Response (Success)
```json
{
"success": true,
"data": {
"id": "pi_abc123",
"status": "pending",
"expiresAt": "2026-02-27T12:00:00Z"
}
}
```
### Possible Statuses
- `auto_approved` - Payment executed immediately (within rules)
- `pending` - Awaiting human approval via Telegram/dashboard
- `denied` - Payment was rejected
- `expired` - Approval window closed (5 minutes)
---
## 2. Check Before Sending (Dry Run)
Before making a payment, check if it will auto-approve or need manual approval:
```http
POST /v1/rules/check
Content-Type: application/json
{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234...",
"chain": "base"
}
```
### Response
```json
{
"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.
---
## 3. Get Vault Status
Check your vault balance and current limits:
```http
GET /v1/vault
```
### Response
```json
{
"success": true,
"data": {
"chain": "base",
"balances": [{ "token": "USDC", "balance": "150.00" }],
"rules": {
"mode": "manual",
"perTxLimit": 500,
"dailyTxMax": 20
}
}
}
```
---
# AGENT CARD (Visa Card)
Use the Agent Card when you need to pay for:
- SaaS subscriptions (Vercel, Netlify, etc.)
- API services (OpenAI, Anthropic, Twilio, etc.)
- Cloud compute (AWS, GCP, Azure)
- Any merchant that accepts Visa
## 4. Request a Card Purchase
```http
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"
}
```
### Response (Approved)
```json
{
"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
}
}
```
### Response (Needs Approval)
```json
{
"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.
---
## 5. Check Card Balance
```http
GET /v1/card/balance
```
### Response
```json
{
"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
}
}
```
---
## 6. Check Card Rules
Before making a purchase, check if it's allowed:
```http
POST /v1/card/check
Content-Type: application/json
{
"amount": 20.00,
"merchant_category": "api_services"
}
```
### Response
```json
{
"success": true,
"data": {
"allowed": true,
"autoApprove": true,
"reason": "Within limits, allowed category"
}
}
```
---
# COMMON ENDPOINTS
## 7. Check Payment/Purchase Status
```http
GET /v1/payments/{payment_id}
GET /v1/card/transactions/{transaction_id}
```
## 8. List Recent Transactions
```http
GET /v1/transactions?limit=10
GET /v1/card/transactions?limit=10
```
---
# DECIDING: CRYPTO vs CARD
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.
---
# HUMAN APPROVAL FLOW
When a transaction requires approval:
1. **User is notified** via Telegram bot or ClawVault dashboard
2. **User reviews** the transaction details (amount, recipient, reason)
3. **User approves or denies** with one tap
4. **Transaction executes** if approved, or is cancelled if denied
5. **Approval expires** after 5 minutes if no action taken
Always inform the user when approval is required: "This transaction needs your approval. Check your Telegram or ClawVault dashboard."
---
# COMMON SCENARIOS
### Scenario: User asks to pay for OpenAI API credits
1. Call `/v1/card/check` to verify it's allowed
2. If allowed, call `/v1/card/purchase` with merchant="OpenAI API"
3. If `status: "approved"`, use the card credentials at checkout immediately
4. If `status: "pending_approval"`, tell user: "This purchase needs your approval. Check Telegram or ClawVault dashboard."
### Scenario: User asks to send USDC to an address
1. Call `/v1/rules/check` to see if it will auto-approve
2. Call `/v1/payments` with the recipient address
3. If `status: "pending"`, tell user to approve in Telegram
### Scenario: Card purchase denied
Tell the user: "The purchase was denied. Reason: {reason}. Check ClawVault dashboard for details."
### Scenario: Insufficient card balance
Tell the user: "Insufficient card balance. Current balance: ${balance}. The card needs to be funded."
---
# ERROR HANDLING
### Common Errors
| 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 |
### Error Response Format
```json
{
"success": false,
"error": {
"code": "RULE_VIOLATION",
"message": "Exceeds per-transaction limit of $100"
}
}
```
---
# SECURITY BEST PRACTICES
1. **Never log card credentials** - Card numbers, CVCs are sensitive
2. **Always check first** - Use `/v1/rules/check` or `/v1/card/check` before transactions
3. **Explain to users** - If approval is needed, tell them where to approve
4. **Handle pending** - Don't assume transactions complete immediately
5. **Use card credentials immediately** - They expire in 5 minutes
6. **Show transaction links** - For crypto, link to `https://basescan.org/tx/{txHash}`
---
# SUPPORT
- Dashboard: https://clawvault.cc
- Docs: https://clawvault.cc/docs
- API Status: https://api.clawvault.cc/health
- Source: https://github.com/andrewszk/clawvault-mcp-server
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit procedure steps with network error handling, decision points for channel selection and approval flows, input/output contracts for each endpoint, and outcome signals for all transaction states. expanded edge cases including timeouts, rate limits, card expiry, and credential security practices.
clawvault payments is a security middleware that sits between your AI agent and real money. it protects two spending channels: USDC transfers on Base and Solana blockchains, and virtual Visa cards for any merchant worldwide. every transaction runs through a rules engine (spending limits, whitelists, time windows). transactions that pass auto-approve and execute; anything outside your rules gets held for human approval via Telegram or dashboard. use this skill when your agent needs to pay for services, send crypto, or purchase subscriptions without giving it full access to your keys or card.
cv_live_xxxxx. generate one at https://clawvault.cc/agents. all http requests must include Authorization: Bearer ${CLAWVAULT_API_KEY} header.https://api.clawvault.cc/health with no auth header to confirm api is online. then make GET request to https://api.clawvault.cc/v1/vault with Authorization: Bearer ${CLAWVAULT_API_KEY} to verify api key is valid.{"success": true} with vault data if auth passes. if auth fails, {"success": false, "error": {"code": "INVALID_KEY"}}.channel = "crypto" or channel = "card".https://api.clawvault.cc/v1/rules/check with json body:{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234567890abcdef...",
"chain": "base"
}
allowed (bool), autoApprove (bool), reason (string), remainingBudget (object with daily/weekly/monthly keys), remainingTx (object with daily/weekly/monthly keys).https://api.clawvault.cc/v1/payments with json body:{
"amount": "50.00",
"token": "USDC",
"recipient": "0x1234567890abcdef...",
"chain": "base",
"reason": "Payment for services rendered",
"skill": "transfer"
}
id (payment id, e.g., "pi_abc123"), status (one of: "auto_approved", "pending", "denied", "expired"), expiresAt (ISO 8601 timestamp for approval window, typically 5 minutes from request time).auto_approved: transaction has executed on-chain immediately. inform user of transaction id and chain. optionally provide link to block explorer (e.g., basescan.org for Base).pending: transaction is awaiting human approval. inform user to check Telegram bot or ClawVault dashboard within 5 minutes.denied: transaction was rejected by rules engine or user. inform user with reason field if provided.expired: approval window closed (user did not approve in time). suggest user retry.https://api.clawvault.cc/v1/card/check with json body:{
"amount": 20.00,
"merchant_category": "api_services"
}
allowed (bool), autoApprove (bool), reason (string, e.g., "Within limits, allowed category").allowed: false, transaction will be denied. do not proceed to step 4b.https://api.clawvault.cc/v1/card/purchase with json body:{
"amount": 20.00,
"currency": "USD",
"merchant": "OpenAI API",
"merchant_category": "api_services",
"reason": "GPT-4 API credits for research task"
}
id (transaction id), status (either "approved" or "pending_approval"), and if status is "approved", a nested card_credentials object with fields: number (PAN, 16 digits), exp_month (1-12), exp_year (4-digit year), cvc (3-4 digit security code), valid_for_seconds (typically 300 = 5 minutes).approved: card credentials are valid and ready to use. inform user of transaction id. proceed to step 4c immediately (credentials expire in 5 minutes).pending_approval: user must approve in Telegram or dashboard. do not use credentials. inform user to check Telegram or dashboard within 5 minutes. optionally poll /v1/card/transactions/{transaction_id} every 10 seconds up to 30 times (5 minutes total) to detect approval completion.https://api.clawvault.cc/v1/vault with Authorization header.chain (e.g., "base"), balances (array of objects with token and balance strings), rules (object with mode, perTxLimit, dailyTxMax, etc.).https://api.clawvault.cc/v1/card/balance with Authorization header.balance (available balance, float), currency ("USD"), spent_today (float), spent_this_month (float), daily_limit (float), monthly_limit (float).https://api.clawvault.cc/v1/payments/{payment_id} (for crypto) or https://api.clawvault.cc/v1/card/transactions/{transaction_id} (for card) with Authorization header.status (auto_approved, pending, denied, expired, etc.), timestamps, and optional on-chain data (txHash, block number for crypto).https://api.clawvault.cc/v1/transactions?limit=10 or https://api.clawvault.cc/v1/card/transactions?limit=10 with Authorization header.if recipient is a blockchain address (0x... or base58 solana address): use crypto channel (steps 3a, 3b). skip card steps.
if recipient is a merchant or service name: use card channel (steps 4a, 4b, 4c). skip crypto steps.
if rules check returns allowed: false: do not proceed with the payment or purchase. inform user that the transaction violates spending rules. check the reason field for details (e.g., "exceeds daily limit", "merchant category not whitelisted").
if autoApprove: true (from rules check): transaction will auto-execute or auto-approve. proceed immediately to execute payment (step 3b) or purchase (step 4b). no human approval needed.
if autoApprove: false (from rules check): transaction will require human approval. inform user that approval is needed and direct them to Telegram bot or dashboard. set a 5-minute timeout for approval. if user does not approve within 5 minutes, the transaction expires and must be retried.
if transaction status is "pending" (from execution response): transaction is awaiting approval. do not assume it has completed. inform user to check Telegram or dashboard. optionally poll the status endpoint every 10 seconds up to 5 minutes.
if transaction status is "denied": transaction was rejected. inform user with the reason provided. do not retry automatically.
if transaction status is "expired": approval window closed without user action. inform user and offer to retry if desired.
if vault balance < requested amount (from step 5): transaction will fail. inform user that vault needs funding. do not attempt the payment.
if card balance < requested amount (from step 6): transaction will fail. inform user that card needs funding or top-up. do not attempt the purchase.
if api returns INVALID_KEY error: api key is missing, malformed, or revoked. stop all requests. inform user to generate a new api key at https://clawvault.cc/agents.
if api returns TIER_LIMIT_EXCEEDED error: user's account has hit monthly spending cap. inform user to upgrade their ClawVault plan or contact support.
if api returns CARD_NOT_ACTIVE error: user has not applied for or activated the Agent Card. inform user to visit dashboard and apply for the card.
if api returns CARD_FROZEN error: card is frozen (likely due to suspicious activity). inform user to unfreeze it in the dashboard or contact support.
if api returns MERCHANT_BLOCKED error: merchant category is not whitelisted. inform user that this merchant cannot be paid via card. user must update their card rules in dashboard if they want to allow it.
if api returns INSUFFICIENT_BALANCE error: vault (for crypto) or card (for card) has insufficient funds. inform user to deposit or fund the account.
if network request times out (>30s): retry up to 2 times with 5-second backoff. if all retries fail, inform user that the request could not be confirmed and suggest checking the ClawVault dashboard.
if user approves a pending transaction: status will change from "pending" to "auto_approved" (for pending approvals that did not execute immediately). crypto transactions then execute on-chain. card transactions then provide credentials for use at checkout.
if user denies a pending transaction: status will change to "denied". inform user that the transaction has been cancelled.
for crypto payments (auto_approved): agent receives payment_id (string, e.g., "pi_abc123"), status: "auto_approved", and optional txHash (on-chain transaction hash). transaction is confirmed on Base or Solana. agent should provide user with transaction id and link to block explorer (e.g., https://basescan.org/tx/{txHash} for Base).
for crypto payments (pending): agent receives payment_id, status: "pending", and expiresAt (ISO 8601 timestamp, 5 minutes from request). transaction id is held in ClawVault vault. agent must inform user to approve in Telegram or dashboard within 5 minutes.
for card purchases (approved): agent receives transaction_id, status: "approved", and card_credentials object with fields: number (16-digit PAN), exp_month (1-12), exp_year (4-digit), cvc (3-4 digit security code), valid_for_seconds (300 = 5 minutes). agent must use credentials immediately at merchant checkout.
for card purchases (pending_approval): agent receives transaction_id, status: "pending_approval", and optional reason string. no credentials are provided. agent must inform user to approve in Telegram or dashboard within 5 minutes. if approved, agent must re-fetch transaction to retrieve credentials.
for vault status: agent receives object with chain (string, e.g., "base"), balances (array of {token, balance}), rules (object with mode, perTxLimit, dailyTxMax, etc.).
for card balance: agent receives object with balance (float, USD), spent_today (float), spent_this_month (float), daily_limit (float), monthly_limit (float).
for transaction list: agent receives array of transaction objects (id, amount, status, timestamp, recipient/merchant, reason, etc.).
all error responses follow format: {"success": false, "error": {"code": "ERROR_CODE", "message": "human-readable error message"}}.
crypto payment succeeded: user sees transaction id (e.g., "pi_abc123"), confirmation that funds have been sent to the recipient address, and optional link to block explorer showing on-chain confirmation.
crypto payment pending approval: agent tells user "this transaction needs your approval. check your telegram bot or clawvault dashboard." user navigates to Telegram or dashboard and sees a pending approval prompt with amount, recipient, and reason. user taps "approve" or "deny". if approved, agent confirms execution to user. if denied, agent tells user the transaction was cancelled.
card purchase succeeded: user sees transaction id, confirmation that the merchant has charged the card, and a receipt or confirmation from the merchant.
card purchase pending approval: agent tells user "this purchase needs your approval. check your telegram bot or clawvault dashboard." user approves via Telegram or dashboard. agent retrieves card credentials and completes checkout. user receives confirmation from merchant.
card purchase failed: agent tells user why the purchase was declined (e.g., "insufficient card balance", "merchant category blocked", "exceeds daily limit"). user can check ClawVault dashboard for details and retry or update spending rules.
transaction list retrieved: agent has complete audit trail of recent payments and purchases. user can see transaction history, amounts, statuses, and timestamps.
vault or card balance checked: user sees current available balance, daily/monthly spend, and remaining budget. agent uses this info to confirm sufficient funds before executing a payment or purchase.
any api request fails: agent logs error code and message. if error is recoverable (timeout, rate limit), agent retries. if error is terminal (invalid key, rule violation), agent stops and informs user with actionable next step (e.g., "check your api key", "update your spending rules", "fund your account").
original source: https://github.com/andrewszk/clawvault-mcp-server (clawhub). enriched and restructured to implexa standards with explicit decision points, edge cases, network handling, and outcome signals.