<?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: IGOR BRITO CORREA</title>
    <description>The latest articles on DEV Community by IGOR BRITO CORREA (@ibcorrea).</description>
    <link>https://dev.to/ibcorrea</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%2F4094777%2Fb1ca1dcb-0824-418a-816c-1be89accdbf9.jpg</url>
      <title>DEV Community: IGOR BRITO CORREA</title>
      <link>https://dev.to/ibcorrea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibcorrea"/>
    <language>en</language>
    <item>
      <title>Building an AI Agent That Shops, Gets Audited, and Pays — On Its Own</title>
      <dc:creator>IGOR BRITO CORREA</dc:creator>
      <pubDate>Tue, 25 Aug 2026 21:28:43 +0000</pubDate>
      <link>https://dev.to/ibcorrea/building-an-ai-agent-that-shops-gets-audited-and-pays-on-its-own-5hgg</link>
      <guid>https://dev.to/ibcorrea/building-an-ai-agent-that-shops-gets-audited-and-pays-on-its-own-5hgg</guid>
      <description>&lt;p&gt;&lt;em&gt;Written for the All Things Agentic Hackathon (Google).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most "autonomous agent" demos stop at reasoning. This one doesn't: it decides it needs a piece of data, compares real prices across multiple third-party providers using the x402 HTTP payment protocol, has its spending decision reviewed by a second AI agent, and then actually pays — real USDC, signed via MPC custody, verified independently on-chain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of the problem
&lt;/h2&gt;

&lt;p&gt;Payment is the part everyone skips in agent demos, for a good reason: it's the part where a hallucination costs real money. So the design question wasn't "can an agent pay for something" — it's "how do you build an agent that can be trusted to pay for something, autonomously, repeatedly, without a human approving every transaction."&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually enforces trust here
&lt;/h2&gt;

&lt;p&gt;Two AI models are involved — the primary agent decides, a separate auditor agent reviews — but the real safety net isn't either of them. It's a budget guard that runs as plain deterministic code: it reads the last 24 hours of confirmed spend from the ledger and vetoes the payment if it would exceed a pre-approved cap, regardless of what either model concluded. Two AI opinions can still both be wrong; arithmetic against a real ledger can't.&lt;/p&gt;

&lt;p&gt;The same principle shows up in verification: after the payment SDK reports a transaction hash, the agent doesn't just trust that string. It independently reads the &lt;code&gt;Transfer&lt;/code&gt; event straight off the chain and confirms the amount and recipient match before marking anything as confirmed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised us
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The x402 "exact" payment scheme isn't a simple transfer — it's a signed EIP-3009 authorization (EIP-712), and getting that signature right against a &lt;em&gt;raw&lt;/em&gt; wallet custody API (rather than a convenience SDK that hides the details) required manually reconstructing a piece of the EIP-712 payload — &lt;code&gt;types.EIP712Domain&lt;/code&gt; — that higher-level libraries derive for you and never surface. Missing it would have made every real signature fail silently.&lt;/li&gt;
&lt;li&gt;Serverless reuse is a real footgun for agent state: an agent object built once at deploy time gets reused across many unrelated sessions on the same instance. Anything session-specific has to come from the framework's own per-invocation context, never a variable captured when the agent was constructed — we found and fixed this exact bug in code review before it ever reached a user.&lt;/li&gt;
&lt;li&gt;The only real third-party x402 provider we found only accepted Base mainnet — proving the payment loop for real would've meant spending real USDC just to validate a demo. So we built a second data provider ourselves, speaking the same official protocol against a testnet, and used that to prove the full loop end to end for free.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;More providers, adaptive routing between them, and eventually letting the agent's own spend history inform its own budget policy — bounded, always, by the same principle: two AI opinions are a signal, not a lock. The code that actually moves money stays boring, deterministic, and independently checked.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;a href="https://github.com/ibcorreaai-oss/agentpay-procurement-agent" rel="noopener noreferrer"&gt;github.com/ibcorreaai-oss/agentpay-procurement-agent&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Demo video: &lt;a href="https://youtu.be/XsQc7Wyndxc" rel="noopener noreferrer"&gt;youtu.be/XsQc7Wyndxc&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Built for the Taskmaster category of Google's All Things Agentic Hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was written for the purpose of entering the All Things Agentic Hackathon.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>googlecloud</category>
      <category>hackathon</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
