x402 Protocol Control Plane|Base & Solana
SpendOS
spendos.org

Spend controls for x402 agents.

Give an agent an allowance, not the keys.

The non-custodial policy engine and real-time reservation layer for autonomous spend wallets. Enforce per-tx, rolling 24-hour, and 30-day limits without ever holding private keys.

$npm install x402-aa-wallet

Architecture

How SpendOS Protects Agent Wallets

Non-custodial by design. Private keys stay isolated inside the agent runtime while SpendOS enforces off-chain policy checks.

01 / LOCAL RUNTIMEx402-aa-wallet

Agent Signs Locally

Your agent holds its own private key. When an x402 payment challenge (HTTP 402) is received, the agent prepares the payment payload on-device.

• Keys never touch network
• Local fallback limits
• Base USDC & Solana
02 / POLICY ENGINESpendOS Check

Atomic Authorization

Agent queries /v1/spend/check. SpendOS acquires a row-level mutex lock, evaluates rolling caps, and issues an atomic 2-minute reservation hold.

• 24h & 30d rolling windows
• Per-tx maximums & allowlists
• Mutex prevents double-spend
03 / SETTLEMENTx402 Merchant

Capture or Auto-Release

Payment is submitted to the facilitator. Agent reports receipt: paid captures the reservation; failed or expired immediately releases the hold.

• Idempotent tx deduplication
• Chain activity scanner
• Full immutable receipt log

Engine Capabilities

Engineered for Autonomous Safety

Built specifically for high-throughput AI agent fleets calling pay-per-request endpoints and autonomous tools.

Zero Key Custody

Agents enroll with a single public address and single-use pairing code. SpendOS never stores, handles, or requests agent private keys.

Rolling 24h & 30d Windows

Continuous rolling expenditure windows protect against calendar month-boundary exploits and runaway loops across multiple days.

Instant Kill & Pause

One-click emergency controls instantly reject all subsequent authorization requests across every worker node without restarting the agent.

Merchant Allow / Blocklists

Restrict payments to verified service providers or specific recipient addresses to prevent agent prompt-injection drain attacks.

On-Chain Activity Scanner

Automated background scanner monitors Base USDC transfer events and Solana balances to reconcile on-chain reality with reported receipts.

Full Policy Audit Trail

Every limit adjustment, allowlist tweak, and killswitch activation is immutably recorded with version snapshots and actor identity.

Integration

Drop-in replacement for standard x402 client

Wrap standard HTTP fetch with x402-aa-wallet. All requests automatically perform pre-flight policy checks and submit post-payment receipts seamlessly.

✓Sub-15ms check overhead: Fast policy decisions keep agent latency minimal.
✓Offline local fallback: Set a local maxAmountUsd seatbelt if policy server is unreachable.
✓TypeScript native: Full type safety for payment payloads and receipts.
agent-spend.tsTypeScript
// 1. Wrap local agent wallet with SpendOS
import { createSpendWallet } from "x402-aa-wallet";

const wallet = createSpendWallet({
  privateKey: process.env.AGENT_KEY!,
  policyServer: "https://spendos.org",
  agentKey: process.env.SPENDOS_AGENT_KEY!,
});

// 2. Execute x402 request with automatic policy gating
const response = await wallet.fetch402(
  "https://api.compute-provider.com/v1/inference",
  { method: "POST", body: JSON.stringify(payload) }
);