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.
It's the agent staying completely healthy while stuck in a subtle retry loop — running the same broken pytest command, re-reading a growing context, and quietly burning through your API balance while you sleep.
Two things you might expect to save you usually don't:
- Provider spend limits (Anthropic / OpenAI Console) are monthly, not "stop if this loop burns $2 in 10 minutes." Worse, when they trip, they kill the entire API key across all your projects instead of isolating the one stuck worker.
-
systemd/ process supervisors only check if the process is alive. A runaway agent looping on the same tool call has exit code0, normal memory usage, and zero crashes.
To fix this for my own VPS setup, I built burnstop — a ~1,000-line open-source local circuit-breaker proxy (MIT, Python 3.11+, only aiohttp and pyyaml).
30-second setup
Run burnstop locally and point your agent's base URL to it — no code changes required:
pip install git+https://github.com/kelbic/burnstop
burnstop init
burnstop start
Then in your agent environment:
export ANTHROPIC_BASE_URL=http://127.0.0.1:8787
# or
export OPENAI_BASE_URL=http://127.0.0.1:8787/v1
Try it offline (zero API spend):
git clone https://github.com/kelbic/burnstop
cd burnstop
python demo/runaway_agent.py

Top comments (0)