An AI agent with no step limit stops when its context window is full. On GPT-5.6 that's $160 for one run.
The cost of AI agent loops that run without a step limit can escalate dramatically with larger language model context windows, even if per-token pricing remains constant. A simulated runaway agent run on GPT-5.6 with a 400K token window cost approximately $160, according to an analysis published November 15, 2026.
AI agent loops are designed to perform tasks by iteratively interacting with a language model, typically sending the full history of interactions with each request. If such an agent fails to terminate as intended, it will eventually stop when its accumulated history exceeds the model's context window, the maximum tokens a request can hold. This uncontrolled execution can lead to substantial, unforeseen costs.
The analysis reveals that the total cost of these "runaway" loops increases disproportionately with the size of the context window. Because each step resends the entire growing history, the total input tokens sent during an uncontrolled run increase with the square of the number of steps. For instance, doubling a model's context window from 200K to 400K tokens was observed to quadruple the cost of a runaway run, while a 2.5 times larger window (200K to 1M tokens) resulted in a 6.2 times cost increase, reaching over $1,000.
This suggests that enhancements in context window size, often perceived as a beneficial model upgrade, also significantly amplify the financial exposure for unmanaged agent behaviors. These figures are based on list prices as of November 12, 2026, without prompt caching or discounts, and assume the loop terminates when the window fills. The analysis notes, however, that some agent frameworks summarize history to continue beyond window limits, which would negate this natural cost ceiling and allow costs to grow indefinitely.
To mitigate this risk, developers can implement "step caps" or "dollar caps" that halt agent loops before they consume excessive resources. For example, a $1 cap on GPT-5.6 would stop a loop after roughly 28 steps, preventing it from reaching the $160 figure. While such caps can interrupt legitimate long-running tasks, tailoring limits to the typical length of successful runs can help manage costs without stifling necessary work.
Share this article
Related reading
6 stories
An AI Agent Ran 187 FEM/CFD Solves Over MCP. Here's How Many Matched the Textbook
We previously covered an AI agent running numerous solves, highlighting the practical costs and performance.

Vietnamese Travellers Can Now Scan NETS QR Codes to Pay in Singapore

Weixin Pay Sees 84% Rise in Overseas E-Wallet Transactions

BPC Pairs SmartVista with Huawei for Payment Modernisation

