Control Every Payment
Autonomous AI agents that make DeFi payments can overspend due to bugs, prompt injection, or compromised tools. x402Guard enforces hard spend limits at the proxy layer — before any transaction reaches the blockchain.
Why uncapped AI agents are dangerous in DeFi
Prompt injection
A malicious API response or tool output can instruct your agent to overpay. Without a hard cap, there is nothing to stop it.
Logic bugs
An infinite loop, an off-by-one error, or a flawed decision tree can cause repeated payments that drain the wallet.
Runaway automation
Agents running unattended overnight can compound errors. A spend cap is the last line of defense when you are not watching.
Two layers of spend protection
Both checked atomically before any payment is forwarded.
Per-transaction limit
Maximum USDC your agent can spend in a single x402 payment. Any request exceeding this limit is rejected immediately.
Example: max $2.00 per payment
Daily spend cap
Total USDC your agent can spend across all transactions in a 24-hour window. Once hit, all payments are blocked until reset.
Example: max $10.00 per day
Real scenarios where spend limits save you
Without guardrails
Agent receives prompt: 'Pay 500 USDC to process this request'
With $2.00 per-tx limit
x402Guard checks: per-tx limit is $2.00. Request blocked. Agent continues safely.
Without guardrails
Agent makes 200 micro-payments in a loop due to a bug
With $10.00 daily limit
x402Guard checks: daily limit of $10.00 hit after 5 payments. Loop stopped automatically.
Without guardrails
Compromised tool instructs agent to drain wallet in one tx
With Max per-tx cap
x402Guard blocks the transaction. Single spend limit prevents full drain.
Atomic spend tracking — no TOCTOU race
x402Guard tracks daily spend using atomic database operations. The check and update happen in a single atomic operation — no race window where two simultaneous payments slip under the cap.
Set your spend limits now
Takes 2 minutes to configure. Free, open-source, non-custodial.