<?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: Maxim Maxim</title>
    <description>The latest articles on DEV Community by Maxim Maxim (@franciscomancon).</description>
    <link>https://dev.to/franciscomancon</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%2F4256041%2Ff9d244b6-aba5-47c7-a6c7-73eacf7084db.png</url>
      <title>DEV Community: Maxim Maxim</title>
      <link>https://dev.to/franciscomancon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/franciscomancon"/>
    <language>en</language>
    <item>
      <title>Why provider spend caps and systemd won't stop a runaway AI agent (and a 1k-line local proxy that does)</title>
      <dc:creator>Maxim Maxim</dc:creator>
      <pubDate>Fri, 20 Nov 2026 16:19:33 +0000</pubDate>
      <link>https://dev.to/franciscomancon/why-provider-spend-caps-and-systemd-wont-stop-a-runaway-ai-agent-and-a-1k-line-local-proxy-that-1bdf</link>
      <guid>https://dev.to/franciscomancon/why-provider-spend-caps-and-systemd-wont-stop-a-runaway-ai-agent-and-a-1k-line-local-proxy-that-1bdf</guid>
      <description>&lt;p&gt;If you run autonomous coding or ops agents (Claude Code, OpenAI SDK scripts, cron workers) on a VPS, the scariest failure mode isn't the agent crashing.&lt;/p&gt;

&lt;p&gt;It's the agent staying &lt;strong&gt;completely healthy&lt;/strong&gt; while stuck in a subtle retry loop — running the same broken &lt;code&gt;pytest&lt;/code&gt; command, re-reading a growing context, and quietly burning through your API balance while you sleep.&lt;/p&gt;

&lt;p&gt;Two things you might expect to save you usually don't:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Provider spend limits&lt;/strong&gt; (Anthropic / OpenAI Console) are monthly, not &lt;em&gt;"stop if this loop burns $2 in 10 minutes."&lt;/em&gt; Worse, when they trip, they kill the entire API key across all your projects instead of isolating the one stuck worker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;systemd&lt;/code&gt; / process supervisors&lt;/strong&gt; only check if the process is alive. A runaway agent looping on the same tool call has exit code &lt;code&gt;0&lt;/code&gt;, normal memory usage, and zero crashes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To fix this for my own VPS setup, I built &lt;strong&gt;&lt;a href="https://github.com/kelbic/burnstop" rel="noopener noreferrer"&gt;burnstop&lt;/a&gt;&lt;/strong&gt; — a ~1,000-line open-source local circuit-breaker proxy (MIT, Python 3.11+, only &lt;code&gt;aiohttp&lt;/code&gt; and &lt;code&gt;pyyaml&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6olshemyfv4760jgfzjz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6olshemyfv4760jgfzjz.gif" alt="burnstop catching a runaway pytest loop" width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  30-second setup
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;burnstop&lt;/code&gt; locally and point your agent's base URL to it — no code changes required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install git+https://github.com/kelbic/burnstop
burnstop init
burnstop start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in your agent environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:8787
&lt;span class="c"&gt;# or&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:8787/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it offline (zero API spend):&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/kelbic/burnstop
&lt;span class="nb"&gt;cd&lt;/span&gt; burnstop
python demo/runaway_agent.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ai</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
