Runaway-Agent Detection
In this article
- Explain why step, time and spend ceilings belong in the runtime that sends each call, not in the prompt.
- Charge every model call, tool call and client retry to a budget ledger, and refuse a call before it starts when its worst case does not fit.
- Tell a healthy retry from a loop with an action signature and a counter that resets when the result changes.
- Decide for a trace whether the run is killed, escalated or runs on, and write the audit event that records why.
- Terms defined here: budget ledger, action signature.
Overview
A runaway agent does not crash. It reads order 1042 for the third time, writes "let me check the order once more", and every one of those calls is billed. OWASP gives the cost side a name, Denial of Wallet: bills driven up by agent loops that nothing bounds. [3]
The shop's support agent from the earlier P01 articles handles one refund per run: it reads the order with get_order and pays 49.00 EUR back with create_refund at the outside payments provider. The shop, its traces and every number below are made up. Three of its runs below look alike from the outside. One must be killed, one handed to a person and one left alone, and each stop has to leave a record that says why.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Ceilings live in the dispatcher
- The ledger is checked before the call
- A signature for each action
- Three traces
- Kill or escalate
- The same ceilings in real runtimes
- Common mistakes
- Sources
- Check yourself, 13 questions