Secure Smart Accounts
That Guard Your Agents.

Set spending policies, manage merchant allowlists, escrow every payment, and resolve disputes. All on-chain with Solana x402.

Scroll to Explore

How x402 Payment Works

Every payment your agent makes passes through x402warden before reaching the merchant.

1. Your agent requests a service

2. Service returns HTTP 402 with price + merchant address

3. x402warden checks your spending policy on-chain

4. If allowed, USDC moves to escrow (not directly to merchant)

5. Request retried with payment proof, service responds with data

6. 5-min dispute window to get a refund if the service failed

7. After window closes, funds released to merchant

Developer Experience

Integrate in 3 Steps

Works with any AI agent, any language, any framework.

01

Fund Your Wallet

Get free devnet SOL and USDC from Solana and Circle faucets.

$ solana airdrop 2
02

Create Agent Account

Deploy an on-chain smart account that enforces your spending rules.

$ npx x402warden init --agent-id 0
03

Set Spending Policies

Define per-call limits, daily caps, merchant allowlists, and dispute windows.

$ npx x402warden policy --max-per-call 5000000

Choose Your Integration Path

Path A

CLI — Direct Command

Your agent calls x402warden pay as a subprocess. Returns JSON to stdout, parseable by any language.

$ npx x402warden pay https://api.example.com/research
{
  "status": "paid",
  "txSignature": "4fW...ABCD",
  "amountPaid": 5000000,
  "body": { ... }
}
PythonNode.jsRustGo
Path B

HTTP Proxy — Zero Changes

Start a local proxy. Your agent's HTTP requests go through it. 402 payments are handled automatically — your agent doesn't know it's paying.

# Start the proxy
$ npx x402warden-proxy --port 4020

# Your agent code — no changes needed
client = httpx.Client(proxy="http://localhost:4020")
response = client.get("http://api.example.com/data")
curlhttpxfetchany HTTP client
npm package

MCP Server for AI Agents

Give your AI agent native x402 payment capabilities. Works with Claude, GPT, and any MCP-compatible client.

Install
v0.1.2
$ npm install -g x402warden-mcp
Configuration

Add to .mcp.json

Drop this into your project's .mcp.json and your AI agent gains x402 payment tools automatically.

{
  "mcpServers": {
    "x402warden": {
      "command": "npx",
      "args": [
        "-y", "x402warden-mcp"
      ],
      "env": {
        "SOLANA_KEYPAIR_PATH": "./keypair.json",
        "AGENT_ID": "0"
      }
    }
  }
}
6 Tools

What Your Agent Gets

Full on-chain wallet management through natural language. No SDK code required.

x402_payPay an x402 service and return the response
x402_balanceCheck SOL and USDC balances
x402_statusView agent account and policy on-chain
x402_initCreate a new agent account
x402_set_policySet spending limits and rules
x402_settleSettle payment after dispute window