
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.
Architecture
Non-custodial by design. Private keys stay isolated inside the agent runtime while SpendOS enforces off-chain policy checks.
Your agent holds its own private key. When an x402 payment challenge (HTTP 402) is received, the agent prepares the payment payload on-device.
Agent queries /v1/spend/check. SpendOS acquires a row-level mutex lock, evaluates rolling caps, and issues an atomic 2-minute reservation hold.
Payment is submitted to the facilitator. Agent reports receipt: paid captures the reservation; failed or expired immediately releases the hold.
Engine Capabilities
Built specifically for high-throughput AI agent fleets calling pay-per-request endpoints and autonomous tools.
Agents enroll with a single public address and single-use pairing code. SpendOS never stores, handles, or requests agent private keys.
Continuous rolling expenditure windows protect against calendar month-boundary exploits and runaway loops across multiple days.
One-click emergency controls instantly reject all subsequent authorization requests across every worker node without restarting the agent.
Restrict payments to verified service providers or specific recipient addresses to prevent agent prompt-injection drain attacks.
Automated background scanner monitors Base USDC transfer events and Solana balances to reconcile on-chain reality with reported receipts.
Every limit adjustment, allowlist tweak, and killswitch activation is immutably recorded with version snapshots and actor identity.
Integration
Wrap standard HTTP fetch with x402-aa-wallet. All requests automatically perform pre-flight policy checks and submit post-payment receipts seamlessly.
maxAmountUsd seatbelt if policy server is unreachable.// 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) }
);