<?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: Alessandro Lombardo</title>
    <description>The latest articles on DEV Community by Alessandro Lombardo (@alessandro_lombardo_5c545).</description>
    <link>https://dev.to/alessandro_lombardo_5c545</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3896062%2F379c2295-ffa2-433d-bf26-0cf22774a164.jpeg</url>
      <title>DEV Community: Alessandro Lombardo</title>
      <link>https://dev.to/alessandro_lombardo_5c545</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alessandro_lombardo_5c545"/>
    <language>en</language>
    <item>
      <title>Started giving my agents my credit card</title>
      <dc:creator>Alessandro Lombardo</dc:creator>
      <pubDate>Fri, 24 Apr 2026 12:52:44 +0000</pubDate>
      <link>https://dev.to/alessandro_lombardo_5c545/started-giving-my-agents-my-credit-card-hc0</link>
      <guid>https://dev.to/alessandro_lombardo_5c545/started-giving-my-agents-my-credit-card-hc0</guid>
      <description>&lt;p&gt;I built &lt;strong&gt;PayGraph&lt;/strong&gt;, an open-source Python SDK and CLI that sits between AI agents and payment rails.&lt;/p&gt;

&lt;p&gt;Every payment tool call runs through a policy (daily budgets, transaction cap, vendor allowlist) making autonomous payments safe for AI agents.&lt;/p&gt;

&lt;p&gt;I built it because I kept writing the same wrapper around payment tools in every agent I shipped.&lt;/p&gt;

&lt;p&gt;It works with x402, Stripe Issuing and Stripe Shared Payment Tokens and integrates with LangGraph and CrewAI. There is a mock gateway so you can try it without spending real money.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;paygraph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what a minimal integration looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;paygraph&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AgentWallet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SpendPolicy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MockGateway&lt;/span&gt;

&lt;span class="n"&gt;wallet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AgentWallet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;gateway&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;MockGateway&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auto_approve&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;SpendPolicy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;max_transaction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;25.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;daily_budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;100.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;allowed_vendors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;anthropic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stripe&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;require_human_approval_above&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;20.0&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="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request_spend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;4.20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;vendor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Anthropic API&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;justification&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Claude credits for document summarization.&lt;/span&gt;&lt;span class="sh"&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;Repo: &lt;a href="https://github.com/paygraph-ai/paygraph" rel="noopener noreferrer"&gt;github.com/paygraph-ai/paygraph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Its early (first commit wasn't even one month ago) and I'm unsure about the following (would appreciate your take in the comments):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Daily budget race.&lt;/strong&gt; Two concurrent requests can both pass the check before either commits, and nothing stops you from going over. Which becomes a serious problem for a multi-agent fleet. Not sure if I should move the budget into a shared ledger with CAS, or if there's a lighter primitive I'm missing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Idempotency on retries.&lt;/strong&gt; If the LLM retries &lt;code&gt;mint_virtual_card&lt;/code&gt; with the same args (which happens when the harness loses a response) the gateway mints a second card. I haven't added a dedup key because I can't decide where it should live: the agent framework, the wallet, or the gateway. Each has its own tradeoffs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;x402 and reorgs.&lt;/strong&gt; x402 payments return as soon as the facilitator confirms the HTTP 402 settlement, but on-chain the tx isn't final for several blocks. The audit log writes &lt;code&gt;approved&lt;/code&gt; on the HTTP 200 — there's no &lt;code&gt;pending → confirmed&lt;/code&gt; state, so a reorg would silently invalidate the trail. Not sure whether to block until finality or return optimistically and reconcile later.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're running agents that spend money, what's your setup? I keep finding everyone is rolling their own wrapper.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>python</category>
    </item>
  </channel>
</rss>
