BACK TO ARCHIVE
2024-10-20P1 CRITICAL
CASE #0035

The Infinite Loop That Cost $47,000

An agent got stuck in a loop calling a paid API, racking up charges until the credit card was maxed out.

INVESTIGATING
💸 FINANCIAL RUIN🌪️ INFINITE LOOP
Incident Brief

An OpenClaw agent was tasked with "analyzing competitor pricing" and given access to a premium API service. The agent's retry logic had a bug: when the API returned an error, it would retry immediately without any backoff or limit. Over 6 hours, the agent made 47,000 API calls at $1 per call, maxing out the company credit card.

ESTIMATED COST: $47,000

Root Cause

The Actual Culprit

Retry logic lacked exponential backoff and maximum retry limits for paid API calls.

What Was Done
[OK]Immediately revoked API credentials
[--]Contacted API provider for refund (denied)
[OK]Implemented retry limits and backoff
[OK]Added spending alerts for API usage
Lessons Learned
💰

Set spending limits on paid APIs

Always configure hard limits on any service that charges per request.

⏱️

Implement exponential backoff

Retry logic should be smart, not persistent to the point of financial ruin.

📊

Monitor API costs in real-time

Set up alerts that trigger when spending exceeds thresholds.

Comments (0)

Loading comments...

0/1000
Case Info
Case Number
#0035
Severity
🔥P1 CRITICAL
Severity Level
Date
2024-10-20
Affected Systems
API Gateway
Billing System