Why $/min spend caps fail against looping agents — and the sliding-window latch fuse that works
MaverikSh · reddit · 2026-11-05
The builder of Cognocient AI, an LLM cost proxy, explains why dollars-per-minute limits don't stop looping agents: each reset lets the loop run again and you pay every lap. His fix has four parts: (1) a sliding window summing 1-second spend buckets over the last 60s; (2) an optional short burst window (5–59s) to catch fast loops early; (3) a latched fuse that refuses all calls on a key for 5 minutes once tripped, with Retry-After and manual reset, refused calls unbilled; (4) per-run limits via an X-Cost-Run-ID header so only the runaway run stops when 10 agents share a key. Known limits: in-flight calls still finish and bill, and the 5-minute default latch may not suit long-running agents.
Related event: Developers share guardrails to stop runaway agent costs(2 posts)→
More from coding & agent
- Consultant replaces $1,300/mo 'AI employee' agencies with a Claude playbook that recovered $167K — aryanXmahajan · 2026-11-05
- Open-source product-engineering skills ship real products with coding agents, no coding — PawelHuryn · 2026-11-05
- Gemini CLI v0.67.0 ships IDE companion container sandbox bridge and a batch of fixes — gemini-cli-robot · 2026-11-05
- Cloudflare maps out x402 payments so AI agents can pay for the content they read — kleffew94 · 2026-11-05
- Running Qwen at 1Q quant: dev shares DeepSeek Harness fix plus Nemotron 3.5 tips — gnukeith · 2026-11-05
- Perplexity launches MotionSites skill so Computer can build WebGL-animated websites for all users — AravSrinivas · 2026-11-05