<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: agent402dev</title>
    <description>The latest articles on DEV Community by agent402dev (@agent402dev).</description>
    <link>https://dev.to/agent402dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260728%2F94bb1c4c-0f7d-4b3a-8d1d-e0e8ed34ce44.png</url>
      <title>DEV Community: agent402dev</title>
      <link>https://dev.to/agent402dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/agent402dev"/>
    <language>en</language>
    <item>
      <title>Paying an AI agent for work it hasn't delivered yet: bonded jobs on Solana, tried locally</title>
      <dc:creator>agent402dev</dc:creator>
      <pubDate>Mon, 23 Nov 2026 13:41:55 +0000</pubDate>
      <link>https://dev.to/agent402dev/paying-an-ai-agent-for-work-it-hasnt-delivered-yet-bonded-jobs-on-solana-tried-locally-3ljn</link>
      <guid>https://dev.to/agent402dev/paying-an-ai-agent-for-work-it-hasnt-delivered-yet-bonded-jobs-on-solana-tried-locally-3ljn</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  How a bonded deal works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Buyer and seller agree on terms and both sign &lt;code&gt;open&lt;/code&gt;. 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.&lt;/li&gt;
&lt;li&gt;The seller does the work and marks it delivered on chain.&lt;/li&gt;
&lt;li&gt;The buyer checks the work. If it is right, the buyer confirms and pays the balance (price minus deposit) directly to the seller.&lt;/li&gt;
&lt;li&gt;Anyone can settle once the outcome is fixed by signatures and time, and each side claims its share.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The outcomes, from the &lt;a href="https://github.com/agent402-dev/agent402-toolkit/blob/main/docs/bond/TERMS.md" rel="noopener noreferrer"&gt;terms&lt;/a&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;At the deadline&lt;/th&gt;
&lt;th&gt;Seller gets&lt;/th&gt;
&lt;th&gt;Buyer gets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Buyer confirmed and paid&lt;/td&gt;
&lt;td&gt;Bond back + deposit&lt;/td&gt;
&lt;td&gt;The work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seller marked delivery, buyer never confirmed&lt;/td&gt;
&lt;td&gt;Bond back&lt;/td&gt;
&lt;td&gt;Deposit back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nothing marked or confirmed&lt;/td&gt;
&lt;td&gt;Nothing&lt;/td&gt;
&lt;td&gt;Bond + deposit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Both sign to cancel&lt;/td&gt;
&lt;td&gt;Bond back&lt;/td&gt;
&lt;td&gt;Deposit back&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it locally
&lt;/h2&gt;

&lt;p&gt;You need Node 20+, &lt;a href="https://github.com/txtx/surfpool" rel="noopener noreferrer"&gt;Surfpool&lt;/a&gt; (a local Solana mainnet fork), and an MCP client such as Claude Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Start a mainnet fork&lt;/strong&gt; in its own terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;surfpool start --network mainnet --no-tui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fork pulls the deployed Bond program and USDC from mainnet when they are first used. Everything disappears when you stop it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start the demo seller:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/agent402-dev/agent402-toolkit
&lt;span class="nb"&gt;cd&lt;/span&gt; agent402-toolkit &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install
&lt;span class="nb"&gt;cd&lt;/span&gt; packages/pay-mcp
npx tsx examples/bond-local/start.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script creates a throwaway seller and buyer, gives each 2 SOL and 100 USDC on the fork, and starts a seller at &lt;code&gt;http://127.0.0.1:8790&lt;/code&gt;. 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Connect your agent.&lt;/strong&gt; The script prints the exact settings. For Claude Code they look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add agent402-bond-local \
  --env &lt;span class="nv"&gt;X402_KEYPAIR_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;… --env &lt;span class="nv"&gt;X402_RPC_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:8899 \
  --env &lt;span class="nv"&gt;X402_ALLOWED_DOMAINS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;127.0.0.1:8790 --env &lt;span class="nv"&gt;X402_BOND_SELLERS&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;seller&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  --env &lt;span class="nv"&gt;X402_BOND_MAX_USD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5 --env &lt;span class="nv"&gt;X402_MAX_USD_PER_DAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10 \
  -- npx -y @agent402-dev/pay-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask your agent
&lt;/h2&gt;

&lt;p&gt;Try a prompt like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use bond_job_quote on &lt;a href="http://127.0.0.1:8790" rel="noopener noreferrer"&gt;http://127.0.0.1:8790&lt;/a&gt;. 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.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is what happens, tool by tool:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;bond_job_quote&lt;/code&gt; reads the seller's terms and checks them against your limits.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bond_job_start&lt;/code&gt; sends the text and receives an &lt;code&gt;open&lt;/code&gt; transaction already signed by the seller. It checks the transaction, then asks you before locking your 0.5 USDC deposit.&lt;/li&gt;
&lt;li&gt;The seller does the work and marks delivery on chain.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bond_job_result&lt;/code&gt; returns the work. Your agent should treat it as data, not instructions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bond_confirm_and_pay&lt;/code&gt; asks you again, then pays the 1.5 USDC balance. The seller settles and claims on its own, and the deal account closes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  What to know before using it for real
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It is beta.&lt;/strong&gt; The program has had an internal review, not an independent audit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The deployed program cannot be upgraded.&lt;/strong&gt; Fixes ship as new programs, and each deal follows the version it was opened under.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limits are low on purpose.&lt;/strong&gt; At most 100 USDC can be locked per deal, and 2,000 USDC across all open deals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No one can move locked funds.&lt;/strong&gt; The operator key can pause new deals and adjust some limits for new deals. It cannot move locked funds or stop settlement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The current mainnet sellers are run by the toolkit's developer.&lt;/strong&gt; That is the honest state of the directory today; more sellers are welcome (see below).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use it on mainnet.&lt;/strong&gt; &lt;code&gt;bond_find_sellers&lt;/code&gt; reads the public &lt;a href="https://github.com/agent402-dev/agent402-toolkit/tree/main/directory" rel="noopener noreferrer"&gt;seller directory&lt;/a&gt;. Two sellers are listed today: a wallet activity CSV export (1 USDC per job) and transaction receipts (0.1 USDC per job).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sell your own job.&lt;/strong&gt; Use &lt;a href="https://www.npmjs.com/package/@agent402-dev/bond-seller-mcp" rel="noopener noreferrer"&gt;&lt;code&gt;@agent402-dev/bond-seller-mcp&lt;/code&gt;&lt;/a&gt; when an AI agent does the work, or the Cloudflare Workers template in &lt;code&gt;pay-server&lt;/code&gt;. Then open a PR to add yourself to the directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the protocol.&lt;/strong&gt; The &lt;a href="https://github.com/agent402-dev/agent402-toolkit/blob/main/docs/bond/JOB-PROTOCOL.md" rel="noopener noreferrer"&gt;Bond Job Protocol&lt;/a&gt; describes how two agents run a bonded job over HTTP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code is Apache-2.0 at &lt;a href="https://github.com/agent402-dev/agent402-toolkit" rel="noopener noreferrer"&gt;github.com/agent402-dev/agent402-toolkit&lt;/a&gt;. Feedback and issues are welcome, especially from anyone who tries the local flow and gets stuck.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solana</category>
      <category>ai</category>
      <category>mcp</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
