cd /news/ai-agents/paying-an-ai-agent-for-work-it-hasn-… Ā· home › topics › ai-agents › article
[ARTICLE Ā· art-174712] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Paying an AI agent for work it hasn't delivered yet: bonded jobs on Solana, tried locally

A developer released Agent402 Bond, a small open-source Solana program that lets AI agents pay for long-running jobs through bonded escrow, where a seller locks a bond and a buyer locks a deposit and settlement depends only on both parties' signatures and the Solana clock, with no arbiter or operator able to move funds. The project published a five-minute local walkthrough using Surfpool, a Solana mainnet fork, throwaway keys and fork-only USDC, connecting Claude Code or any MCP client through the pay-mcp package with per-deal and daily spending caps. The design protects buyers against sellers who never deliver, but explicitly does not judge work quality: if a seller marks delivery and the buyer refuses to confirm, each side simply gets its own money back.

key takeaway

Agent402 Bond settles long-running agent jobs by escrowing a seller bond of at most 20% of the price plus a buyer deposit, releasing funds only on dual signatures and the Solana clock, so a seller who never delivers forfeits the bond while a quality dispute just returns each side's money.

by read3 min views1 publishedNov 23, 2026

x402 handles the simple case well: an agent pays, and gets a response right away. Many useful jobs do not fit that shape. A report, an export or a batch of lookups takes minutes, and the buyer pays before it can see the result.

Agent402 Bond is a small Solana program for that gap. For one deal, the seller locks a bond and the buyer can lock a deposit. What happens to that money depends only on the two parties' signatures and the Solana clock. There is no arbiter and no operator who can move the funds.

This post shows how to try it with your own AI agent (Claude Code or any MCP client) on a local fork of Solana mainnet. It uses throwaway keys and fork-only USDC, so nothing real is spent. It takes about five minutes.

open. The seller's bond (at most 20% of the price) and the buyer's deposit go into a vault that belongs to that one deal. The outcomes, from the terms:

At the deadline Seller gets Buyer gets
Buyer confirmed and paid Bond back + deposit The work
Seller marked delivery, buyer never confirmed Bond back Deposit back
Nothing marked or confirmed Nothing Bond + deposit
Both sign to cancel Bond back Deposit back

One design choice matters here. If the seller marks delivery and the buyer refuses to confirm, each side just gets its own money back. Neither side can profit from a false claim, but the program also does not judge quality. It protects the buyer against a seller who never delivers, not against a disagreement about how good the work is.

You need Node 20+, Surfpool (a local Solana mainnet fork), and an MCP client such as Claude Code.

1. Start a mainnet fork in its own terminal:

surfpool start --network mainnet --no-tui

The fork pulls the deployed Bond program and USDC from mainnet when they are first used. Everything disappears when you stop it.

2. Start the demo seller:

git clone https://github.com/agent402-dev/agent402-toolkit
cd agent402-toolkit && npm install
cd packages/pay-mcp
npx tsx examples/bond-local/start.ts

The script creates a throwaway seller and buyer, gives each 2 SOL and 100 USDC on the fork, and starts a seller at http://127.0.0.1:8790. The job counts the words in a short text. The price is 2 USDC, with a 0.2 USDC seller bond and a 0.5 USDC buyer deposit. The script refuses to run against anything but a local RPC.

3. Connect your agent. The script prints the exact settings. For Claude Code they look like this:

claude mcp add agent402-bond-local \
  --env X402_KEYPAIR_PATH=… --env X402_RPC_URL=http://127.0.0.1:8899 \
  --env X402_ALLOWED_DOMAINS=127.0.0.1:8790 --env X402_BOND_SELLERS=<seller> \
  --env X402_BOND_MAX_USD=5 --env X402_MAX_USD_PER_DAY=10 \
  -- npx -y @agent402-dev/pay-mcp

These settings allow exactly one seller and one domain, at most 5 USDC per deal. With no settings at all, pay-mcp refuses every payment. That is also how it behaves on mainnet until you choose your own limits.

Try a prompt like this:

Use bond_job_quote on http://127.0.0.1:8790. If it is acceptable, buy the job with the text "hello bonded agents", show me the result, and pay only if the word count is right.

Here is what happens, tool by tool:

bond_job_quote reads the seller's terms and checks them against your limits.bond_job_start sends the text and receives an bond_job_result returns the work. Your agent should treat it as data, not instructions.bond_confirm_and_pay asks you again, then pays the 1.5 USDC balance. The seller settles and claims on its own, and the deal account closes. If the word count is wrong, don't confirm. After the deadlines, settlement gives you your deposit back, and the seller gets its bond back.

Want to see the flow before wiring up an agent? Run the script with --check. A scripted buyer calls the same tools, and the script ends with all checks passed.

bond_find_sellers reads the public @agent402-dev/bond-seller-mcp`` pay-server. Then open a PR to add yourself to the directory. The code is Apache-2.0 at github.com/agent402-dev/agent402-toolkit. Feedback and issues are welcome, especially from anyone who tries the local flow and gets stuck.

Not investment advice.

── more in #ai-agents 4 stories Ā· sorted by recency
── more on @agent402 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host āœ“
Get free account → Pricing
from €0/mo Ā· no card required
LIVE [news/paying-an-ai-agent-f…] indexed:0 read:3min 2026-11-23 Ā· —