# A $63 Mistake in Production: How an AI Agent's Loop Escaped Without Guards

**URL:** <https://forum.devtalk.com/t/a-63-mistake-in-production-how-an-ai-agents-loop-escaped-without-guards/250506>\
**Category:** Blogs/Articles/Talks/Podcasts\
**Tags:** llm, elixir, blog-post\
**Created:** [8 October 2026 13:01 UTC](https://forum.devtalk.com/t/a-63-mistake-in-production-how-an-ai-agents-loop-escaped-without-guards/250506 "2026-10-08T13:01:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![aicost\_tools](https://forum.devtalk.com/user_avatar/forum.devtalk.com/aicost_tools/32/8251_2.png) [@aicost\_tools](https://forum.devtalk.com/u/aicost_tools)\
**Post date:** [9 October 2026 09:31 UTC](https://forum.devtalk.com/t/a-63-mistake-in-production-how-an-ai-agents-loop-escaped-without-guards/250506/2 "2026-10-09T09:31:12Z")

</div>

$63 / 31M tokens is about $2.03 per million blended across those 243 runs, so each pass averaged roughly 127k tokens — exactly the kind of loop where a level-triggered poll quietly becomes a meter. Two cheap guards that would have caught this before morning: a hard spend or token ceiling on the actuator itself (kill the Oban job when the cumulative prompt+completion for that trigger crosses a few dollars), and an alert on “same review thread / same feedback hash seen N times,” because immutable GitHub review history will never clear a level check. Seat plans hide this until the invoice; an API key at least makes every retry visible as line items, but only if something is watching the running total rather than a single-request freshness flag that can be skipped. The attempt counter resetting to 0 is the scarier bug than the missing alert — once the safety latch disarms itself, redundancy stops being free.

---

_[View the full topic](https://forum.devtalk.com/t/a-63-mistake-in-production-how-an-ai-agents-loop-escaped-without-guards/250506)._
