<?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: uuu</title>
    <description>The latest articles on DEV Community by uuu (@ut181749ut).</description>
    <link>https://dev.to/ut181749ut</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%2F4233192%2Fe3ecc6cb-ecf7-48eb-a6c5-8b26bf0a3941.png</url>
      <title>DEV Community: uuu</title>
      <link>https://dev.to/ut181749ut</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ut181749ut"/>
    <language>en</language>
    <item>
      <title>I built a spending guard for AI agents that asks my phone before they pay</title>
      <dc:creator>uuu</dc:creator>
      <pubDate>Sun, 08 Nov 2026 06:23:32 +0000</pubDate>
      <link>https://dev.to/ut181749ut/i-built-a-spending-guard-for-ai-agents-that-asks-my-phone-before-they-pay-3nlb</link>
      <guid>https://dev.to/ut181749ut/i-built-a-spending-guard-for-ai-agents-that-asks-my-phone-before-they-pay-3nlb</guid>
      <description>&lt;p&gt;I've been letting AI agents do more on their own, and at some point I realized that if one decided to buy something or upgrade a plan, nothing would stop it. So I built &lt;strong&gt;Saifuban&lt;/strong&gt; ("wallet keeper" in Japanese).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ut181749ut.github.io/saifuban/" rel="noopener noreferrer"&gt;https://ut181749ut.github.io/saifuban/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Before spending money, the agent asks Saifuban whether the payment is OK. Saifuban answers using rules you set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small amounts under your threshold are approved right away.&lt;/li&gt;
&lt;li&gt;Anything larger sends a push notification to your phone. You tap Approve or Reject.&lt;/li&gt;
&lt;li&gt;Payments over the daily budget or the per-payment limit are refused, as are merchants you haven't allowed.&lt;/li&gt;
&lt;li&gt;A kill switch stops everything at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rules are per agent, so a research agent can have $5/day while a coding agent gets more. Saifuban never handles card details or moves money. It only decides whether a payment is allowed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How you connect it
&lt;/h2&gt;

&lt;p&gt;It's a remote MCP server, so any client that supports remote MCP can use it with one URL: Claude (custom connector), ChatGPT (developer mode), Cursor, VS Code and so on. Open the site, pick a budget, and paste the URL it gives you. Then ask your agent "check my remaining budget with Saifuban" to confirm it's connected.&lt;/p&gt;

&lt;p&gt;The agent sees three tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;request_payment&lt;/code&gt;: ask whether a payment (merchant, amount, currency, reason) is allowed. It waits up to 45 seconds for you to approve on your phone.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;check_payment_status&lt;/code&gt;: check a pending request later.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_budget&lt;/code&gt;: how much is left today.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amounts can be in yen or dollars, and the UI has an English mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things I had to get right
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pending requests count against the budget.&lt;/strong&gt; If they didn't, an agent could fire off ten pending requests, and approving them all would blow straight past the daily limit. So a pending request reserves its amount until it's decided or expires (24 hours).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asking is voluntary.&lt;/strong&gt; Someone on Reddit pointed out that a prompt-injected agent could simply skip the check. That's true. So every approved request now returns a single-use &lt;code&gt;payment_token&lt;/code&gt; that is scoped to the approved merchant and amount, expires in 24 hours, and dies if the agent is stopped. Whatever actually moves the money calls &lt;code&gt;/redeem&lt;/code&gt; before paying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://zrphnuvrsldcycxtdftv.supabase.co/functions/v1/saifuban/redeem &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"content-type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"token":"sbt_...","merchant":"OpenAI","amount":12.5,"currency":"USD"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A second redeem returns &lt;code&gt;already_used&lt;/code&gt;, a different merchant returns &lt;code&gt;merchant_mismatch&lt;/code&gt;, and a bigger amount returns &lt;code&gt;amount_exceeds_approval&lt;/code&gt;. To be clear, this only becomes hard enforcement when the payment side checks the token. Today that means your own payment code, not third-party checkout.&lt;/p&gt;

&lt;p&gt;API spend is the one place it's already enforced: if you store your OpenAI, Anthropic or OpenRouter key in Saifuban, the agent only ever gets a proxy key, and requests stop when the budget runs out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;Supabase Edge Functions and Postgres. All the rules are checked inside one database function, with a row lock per agent so concurrent requests can't race the budget. The site is a plain-JS PWA on GitHub Pages, and notifications use Web Push with approve/reject buttons right in the notification.&lt;/p&gt;

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

&lt;p&gt;It's free and early. I'd love to hear what limits would make you comfortable letting an agent spend, and whether you'd verify tokens on the merchant side.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site: &lt;a href="https://ut181749ut.github.io/saifuban/" rel="noopener noreferrer"&gt;https://ut181749ut.github.io/saifuban/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repo and issues: &lt;a href="https://github.com/ut181749ut/saifuban" rel="noopener noreferrer"&gt;https://github.com/ut181749ut/saifuban&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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