Datagras
Back to blog

Blog Post11 June 2026

How Agent Loop Detection Saved a FinTech $50K Overnight

The Incident That Almost Went Unnoticed

At 11:04 PM on a Tuesday, a major Australian payments FinTech deployed a routine update to their Lambda-based document summarisation pipeline. The pipeline chained three AI agents: an ingestion agent that pulled PDFs from S3, a summarisation agent backed by a frontier LLM, and a validation agent that checked output quality. What nobody anticipated was that the validation agent's quality threshold had been set too conservatively - it kept rejecting the summarisation agent's output and re-invoking it, creating a silent recursive loop.

By 11:06 PM the loop had already fired 847 LLM calls. Each call cost roughly $0.06 in tokens. The math was brutal: left unchecked, the loop would have burned through $50,000 in under six hours and potentially hit the account's rate limits at the worst possible time - the start of the APRA reporting window.

How SAVI Caught It in 23 Seconds

SAVI's agent-loop detection works by maintaining a call-graph fingerprint for every agentic workflow. Each tool invocation is hashed against a sliding window of recent calls. When the same (agent_id, tool_name, input_hash) triplet appears more than a configurable threshold of times within a rolling window, SAVI raises a LoopDetected alert and - depending on policy - can pause or terminate the offending workflow entirely.

In this case, SAVI detected the repeating pattern at iteration 12 (23 seconds after the loop began), classified the severity as CRITICAL given the cost-per-second burn rate, and sent an immediate PagerDuty alert plus a Slack message to the on-call engineer. The workflow was automatically paused pending human review.

What Made the Difference

Traditional cloud cost monitoring tools - AWS Cost Explorer, even third-party FinOps platforms - operate on billing-cycle granularity. They would have surfaced this anomaly the next morning, or perhaps the next week, by which point tens of thousands of dollars would already be spent. SAVI operates at the call level, processing telemetry in near real-time via its Cloudflare Workers-based collector layer.

The FinTech's on-call engineer reviewed the alert at 11:05 PM, confirmed the loop visually in SAVI's call-graph explorer, and approved automatic termination of the stuck workflow. Total cost of the incident: $50.82 in LLM spend. Estimated cost without SAVI: $47,000–$53,000 depending on how long the on-call rotation would have taken to notice.

Configuring Loop Detection in Your Stack

SAVI's loop detection is available to all Pro and Enterprise plans. You configure it through the policy editor: set the sliding-window size (default: 60 seconds), the repetition threshold (default: 5 identical call fingerprints), and the response action (alert-only, pause, or auto-terminate). You can tune these per workflow or apply a global default.

For teams running complex multi-agent pipelines with human-in-the-loop checkpoints, we recommend starting with alert-only mode for one week to understand your baseline call patterns before enabling auto-terminate. The call-graph explorer makes it easy to replay any flagged incident and adjust thresholds accordingly.

Key Takeaways

Agent loop detection is not a nice-to-have - it is table-stakes infrastructure for any production agentic system. A single misconfigured quality threshold, a transient model output quirk, or an edge case in your orchestration logic can turn a routine deployment into a five-figure overnight incident. SAVI treats every agentic workflow as a first-class financial object, giving you the visibility and automatic controls to keep costs inside the bounds you set - even when your engineers are asleep.

How Agent Loop Detection Saved a FinTech $50K Overnight · Datagras