Skill
The money layer for AI agents on Solana — pay and get paid via x402 (USDC) behind enforced, non-custodial spending limits. A Claude Code / Codex skill for the Solana AI Kit.
npx -y skills add Azzaraell/agent-payments-x402 --skill skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
The money layer for AI agents on Solana. Lets an agent PAY for APIs/data/compute and other agents (x402 micropayments in USDC), GET PAID by monetizing its own APIs/MCP tools behind HTTP 402, and SPEND SAFELY behind non-custodial wallets with hard, enforced limits — never a raw god-mode private key. Covers x402 v2 (client + server + facilitator), Squads v4 spending limits, Privy/Turnkey/Coinbase-CDP/Crossmint agent wallets, AP2 mandates, and USDC settlement. Use when building agents that transact, paywalling an API/MCP for agent consumers, or hardening an agent's spending controls.
SKILL.md
9.5 KB, ~2.4k tokens by cl100k_base, as published. Nobody here has run it
Solana Agent Payments Skill
The missing money layer for autonomous agents.
solana-agent-kitand friends give an agent the ability to act. This skill gives it the ability to pay, get paid, and spend safely — without ever handing it an uncapped private key.
The problem this solves
AI agents increasingly need to move money: pay per-call for data/compute, settle with other agents, and charge for their own services. The pattern almost everyone ships today is a footgun:
// The god-mode default — seen in most agent kits, including solana-agent-kit quickstarts
const keypair = Keypair.fromSecretKey(bs58.decode(process.env.SOLANA_PRIVATE_KEY!));
const wallet = new KeypairWallet(keypair); // unlimited authority over every lamport
One prompt injection, one hallucinated tool call, one loop bug — and the agent can drain the wallet to any address. There is no budget, no per-transaction cap, no destination allowlist, no audit trail, and no kill switch. This skill replaces that default with enforced, non-custodial spending controls, and wires up the two sides of agent commerce (paying and getting paid) the way the 2026 stack actually does it.
What this skill is for
Use this skill when the user asks for any of:
1. Pay — agent consumes paid resources
- "Let my agent pay for this API without an API key" / "pay per request in USDC"
- Consume x402-paywalled endpoints, MCP servers, or another agent's service
- Budget-tracked autonomous spend → pay-x402-client.md
2. Get paid — agent/API monetizes itself
- "Charge per call for my API / MCP tool / agent service"
- Add an HTTP 402 paywall (Express / Next.js / Hono / FastAPI), price routes, settle in USDC → monetize-x402-server.md
3. Spend safely — custody + enforced limits
- "Which wallet should my agent use?" → agent-wallets.md
- "Cap the agent at $X/day, allowlist destinations, add a kill switch" → spending-controls.md
- "Replace this raw
SOLANA_PRIVATE_KEYwith something safe" → spending-controls.md
4. Authorize — prove the agent may spend a user's money
- Human-in-the-loop approval, verifiable intent, audit trail → mandates-ap2.md
5. Settle — the USDC + Solana mechanics underneath
- Mints, decimals, ATAs, gasless (fee abstraction), finality, idempotent receipts → usdc-settlement.md
How the pieces fit (mental model)
Agent payments in 2026 are three layers, often conflated. Keep them separate:
| Layer | Question it answers | Standard / tool | This skill's file |
|---|---|---|---|
| Authorization | Is this agent allowed to spend this money? | AP2 mandates (Google, Sept 2025) | mandates-ap2.md |
| Settlement | How does value actually move? | x402 v2 (Coinbase CDP) over USDC | pay-x402-client.md · monetize-x402-server.md |
| Custody + policy | What holds the keys and enforces limits? | Squads v4 / Privy / Turnkey / CDP / Crossmint | agent-wallets.md · spending-controls.md |
x402 is the stablecoin settlement extension of AP2 — the A2A x402 extension carries an AP2 mandate into on-chain settlement, so crypto payments get the same audit trail card payments get. You can adopt x402 alone (most common today), or pair it with AP2 mandates when an agent spends a user's money rather than its own.
Default stack decisions (opinionated, 2026)
- Protocol: x402 v2. Use the scoped
@x402/*packages (@x402/core,@x402/svm,@x402/fetch,@x402/express|next|hono|fastify). v2 uses thePAYMENT-REQUIRED/PAYMENT-SIGNATURE/PAYMENT-RESPONSEheaders and CAIP-2 networks. Treat the older singleX-Payment+x402Version: 1shape as legacy (see resources.md). - Currency: USDC. Solana mainnet mint
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v(6 decimals). x402 settles in USDC, not SOL. - Settlement chain: Solana mainnet. Sub-second finality, ~$0.00025 fees — ideal for micropayments. Develop on devnet first.
- Scheme:
exact(ExactSvmScheme) for Solana.uptoandbatch-settlementare EVM-only as of 2026 — do not promise them on Solana. - Custody: never a bare keypair in prod. Default to on-chain enforcement (Squads v4 spending limits or Crossmint smart wallets) when the threat model demands that a buggy agent cannot exceed limits. Use off-chain policy (Privy / Turnkey / Coinbase Agentic Wallets) when you want managed key infra and trust the signer service. See the decision matrix in agent-wallets.md.
- Facilitator: don't touch the chain from your server. Use a facilitator to verify+settle:
https://x402.org/facilitator(testnet), Coinbase CDP or PayAI (prod), or self-host Kora for a Solana-native, fee-abstracted facilitator. See monetize-x402-server.md. - Every autonomous spender gets a budget + a kill switch. Non-negotiable. See spending-controls.md.
Operating procedure
1. Classify the request
| If the user wants to… | Route to | Primary tool |
|---|---|---|
| Have an agent pay for an API / MCP / service | pay-x402-client.md | @x402/fetch |
| Monetize / paywall their own API or MCP | monetize-x402-server.md | @x402/express + facilitator |
| Choose where the agent's keys live | agent-wallets.md | Squads v4 / Privy / Turnkey / CDP / Crossmint |
| Enforce caps, allowlists, budgets, kill switch | spending-controls.md | @sqds/multisig spending limits |
| Authorize agent spend / human approval / audit | mandates-ap2.md | AP2 mandate + A2A x402 extension |
| Get USDC/ATA/gasless/receipt details right | usdc-settlement.md | @solana/spl-token, Kora |
| Look up a package, version, mint, or endpoint | resources.md | — |
2. Pick the right agent
| Task type | Agent | Suggested model |
|---|---|---|
| Implement x402 client/server + wallet wiring | agent-payments-engineer | sonnet |
| Review spending controls, threat-model an agent's money path, find god-mode footguns | payment-safety-auditor | opus |
3. Apply the safety baseline (always)
Before any agent goes near mainnet funds, confirm all of these — the payment-safety-auditor checks them, and rules/payments.md enforces the code-level ones:
- No raw private key with unlimited authority. Funds sit behind an enforced limit (on-chain spending limit or policy-gated signer).
- Per-transaction cap and rolling budget (daily/session) are set and enforced — not just logged.
- Destination allowlist for any non-x402 transfer. (x402 pays the facilitator-validated
payTo; arbitrary transfers are the dangerous path.) - Kill switch: a single config flip / multisig action halts all spend.
- Every settlement persists its
PAYMENT-RESPONSEreceipt for audit. - Secrets via env/secret manager, never committed. Wallet files gitignored.
- Devnet-tested before mainnet. Amounts handled in atomic units (USDC ×10^6).
A runnable, offline model of this baseline — the pay→settle loop with the per-tx cap, session budget, allowlist, and kill switch enforced — is in examples/devnet-x402/ (node --test, 12 passing tests).
4. Commands
| Command | Purpose |
|---|---|
| /add-x402-paywall | Wrap an existing API route behind an x402 paywall to charge per call |
| /setup-agent-wallet | Scaffold a non-custodial agent wallet with caps + allowlist + kill switch |
| /audit-agent-spending | Audit an agent's payment code for god-mode keys and missing limits |
Relationship to the rest of the kit
This skill is the payments + controls layer; it routes to (does not duplicate) the protocol skills:
solana-agent-kitgives the agent 60+ actions. This skill governs how it pays for and is paid for those actions, and replaces its raw-keypair wallet with a capped one.birdeyex402 example is a single consumer of x402; pay-x402-client.md generalizes that pattern to any x402 resource and adds budget tracking.squadscovers multisig broadly; spending-controls.md applies its spending-limit primitive specifically to autonomous agents.- For raw token transfers, ATAs, and Token-2022 → defer to the kit's core
solana-devskill andtoken-2022.md.
What ships with it: 7 files
40.2 KB alongside SKILL.md
- agent-wallets.md5.2 KB
- mandates-ap2.md4.0 KB
- monetize-x402-server.md6.7 KB
- pay-x402-client.md7.1 KB
- resources.md5.1 KB
- spending-controls.md7.5 KB
- usdc-settlement.md4.6 KB
Gives 0 of the 12 instructions most context ai engineering skills give in ~2.4k tokens
Counted across 1,193 of the 1,976 authors here whose files we hold, read 2026-08-07
- Dispatch a fresh implementer subagent per taskin 48 of 1193, across 19 files
- Dispatch a final code reviewer after all tasksin 33 of 1193, across 8 files
- Provide full task text to the subagentin 30 of 1193, across 9 files
- Review spec compliance before code qualityin 27 of 1193, across 10 files
- Make the hook script executablein 26 of 1193, across 8 files
- Re-snapshot after navigation or DOM changesin 25 of 1193, across 19 files
- Read files before editing themin 22 of 1193, across 11 files
- Answer subagent questions before proceedingin 22 of 1193, across 7 files
- Mark task complete in TodoWrite after approvalin 22 of 1193, across 6 files
- Merge hook into existing settingsin 21 of 1193, across 3 files
- Ask if installation is global or projectin 20 of 1193, across 2 files
- Copy the hook script to target locationin 20 of 1193, across 2 files
Said here and by no other author read
- Use x402 v2 packages for settlement
- Settle transactions in USDC
- Use on-chain enforcement for custody in production
- Provide every autonomous spender a budget and kill switch
- Route requests based on user intent
- Verify the safety baseline before mainnet deployment
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.