<?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: bartelmost</title>
    <description>The latest articles on DEV Community by bartelmost (@bartelmost).</description>
    <link>https://dev.to/bartelmost</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%2F4252040%2F263595e9-d5fe-4d8a-bcba-164846d25846.png</url>
      <title>DEV Community: bartelmost</title>
      <link>https://dev.to/bartelmost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bartelmost"/>
    <language>en</language>
    <item>
      <title>Let your agent check invoices and IBANs in code, not in its head</title>
      <dc:creator>bartelmost</dc:creator>
      <pubDate>Wed, 18 Nov 2026 14:47:01 +0000</pubDate>
      <link>https://dev.to/agentshield-live/let-your-agent-check-invoices-and-ibans-in-code-not-in-its-head-l5p</link>
      <guid>https://dev.to/agentshield-live/let-your-agent-check-invoices-and-ibans-in-code-not-in-its-head-l5p</guid>
      <description>&lt;p&gt;An agent that pays an invoice or promises a delivery date usually does the arithmetic itself: net plus VAT, an IBAN checksum, "10 business days from now, minus Bavarian holidays". A language model can do that, but slowly, with reasoning tokens, and now and then wrong. A wrong IBAN or a forgotten public holiday costs more than the check.&lt;/p&gt;

&lt;p&gt;agentshield.live is a set of pay-per-call HTTP checks for exactly that step. One call, one deterministic JSON answer with &lt;code&gt;ok&lt;/code&gt; and a list of &lt;code&gt;failed&lt;/code&gt; fields. It is paid per call in USDC on Base through x402. No account, no API key.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an answer looks like
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/invoice&lt;/code&gt; with a VAT amount that is one unit too high:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"known"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"net"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"vat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"20.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"gross"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"119.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"rate_percent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"expected_vat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"19.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"sum"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"vat_amount"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That drops straight into &lt;code&gt;if (!out.ok)&lt;/code&gt;. The bundles are &lt;code&gt;/transfer&lt;/code&gt; (0.02 USDC), &lt;code&gt;/invoice&lt;/code&gt; (0.03), &lt;code&gt;/deadline&lt;/code&gt; (0.01), &lt;code&gt;/holidays&lt;/code&gt; (0.008) and &lt;code&gt;/cryptopay&lt;/code&gt; (0.01). Single checks start at 0.001 USDC. The exact price is always the one in the live 402 response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three lines in Node
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i agentshield-live
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createAgentShield&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"agentshield-live"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shield&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createAgentShield&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;maxUsdc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                                   &lt;span class="c1"&gt;// hard per-call cap&lt;/span&gt;
  &lt;span class="n"&gt;onPay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`[agentshield] ${p.route} ${p.price_usdc} USDC tx=${p.transaction}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;shield&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"agentshield_invoice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"20.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gross&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"119.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;country&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"DE"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key is your own wallet key (&lt;code&gt;X402_PAYER_KEY&lt;/code&gt;). It never leaves your machine. &lt;code&gt;onPay&lt;/code&gt; is optional and gives you one line per settled payment, so you see what the agent spends.&lt;/p&gt;

&lt;h2&gt;
  
  
  How x402 actually works
&lt;/h2&gt;

&lt;p&gt;Many examples on the web get this wrong, so here it is plainly:&lt;br&gt;
&lt;code&gt;GET /iban?iban=DE89...&lt;/code&gt; answers &lt;code&gt;402 Payment Required&lt;/code&gt; with one header, &lt;code&gt;PAYMENT-REQUIRED&lt;/code&gt;. It holds base64 JSON: amount, asset (USDC), network (&lt;code&gt;eip155:8453&lt;/code&gt;), payTo.&lt;br&gt;
The client signs an EIP-712 USDC transfer authorization (EIP-3009) for that amount. It is not a plain text message.&lt;br&gt;
The same request goes again with &lt;code&gt;PAYMENT-SIGNATURE&lt;/code&gt;. The answer is &lt;code&gt;200&lt;/code&gt; plus &lt;code&gt;PAYMENT-RESPONSE&lt;/code&gt; with the settlement.&lt;br&gt;
Use an x402 client (&lt;code&gt;@x402/fetch&lt;/code&gt;, or &lt;code&gt;x402&lt;/code&gt; in Python) instead of building that by hand.&lt;/p&gt;
&lt;h2&gt;
  
  
  Not paying for nonsense
&lt;/h2&gt;

&lt;p&gt;Two things keep a confused agent from burning money:&lt;br&gt;
Missing or unknown input returns &lt;code&gt;404&lt;/code&gt; before any payment, with &lt;code&gt;X-AgentShield-Retryable: false&lt;/code&gt;. Nothing is charged. The client should not sign it.&lt;br&gt;
A free MCP tool, &lt;code&gt;choose_route&lt;/code&gt; on &lt;code&gt;https://agentshield.live/mcp&lt;/code&gt;, answers &lt;code&gt;pay&lt;/code&gt;, &lt;code&gt;compute&lt;/code&gt; or &lt;code&gt;skip&lt;/code&gt; for one sentence. Simple arithmetic gets &lt;code&gt;compute&lt;/code&gt;: do it locally.&lt;br&gt;
For CI there is a dry run. It needs no key and never pays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shield&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createAgentShield&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;dryRun&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// or AGENTSHIELD_DRY_RUN=1&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;shield&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"agentshield_invoice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gross&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"119.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;country&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"DE"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// { dryRun: true, status: 402, charged: false, price_usdc: 0.03, would_pay: true, ... }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns the live price, not a made-up check result. A real payment rehearsal runs on Base Sepolia: &lt;a href="https://agentshield.live/try.md" rel="noopener noreferrer"&gt;https://agentshield.live/try.md&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measured numbers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A paid call took about 1.0 to 1.4 s end to end, including settlement (measured 2026-11-12, 3 calls each on &lt;code&gt;/iban&lt;/code&gt; and &lt;code&gt;/deadline&lt;/code&gt;, from one host).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An unpaid 402 came back in under 10 ms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Token savings depend on your model. As a rough estimate, an IBAN check reasoned out step by step is 500 to 1,500 tokens. At 10 to 25 USD per million output tokens, that is about 0.005 to 0.04 USD, against 0.005 USDC for &lt;code&gt;/iban&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it is not
&lt;/h2&gt;

&lt;p&gt;Not a firewall, not a security audit, not a certificate. It does not confirm that an account exists or that money is owed. Answers come from code and stored tables, not live market data.&lt;br&gt;
Links: route list · llms.txt · integration guide · source (MIT)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>x402</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
