Runaway-Agent Detection
In this article
- Explain why run ceilings on steps, time and spend must be enforced by the runtime, not by the prompt.
- Build an action signature and a no-progress counter that tell a healthy retry from a loop.
- Predict for a given trace whether the run is killed, escalated or runs on, and name its terminal reason.
- Write the audit event a stopped run leaves behind.
- Terms defined here: budget ledger, action signature.
Overview
An agent that never stops is not a crash. It looks busy: it reads the same order again, asks for one more try, and every call costs money while nothing changes. OWASP names the attack that exploits this, Denial of Wallet, where unbounded agent loops run up the bill. [3]
Take a made-up shop whose agent issues refunds: it reads an order, then pays it back. You will put hard ceilings on its runs that the model cannot talk its way past, check every call against a ledger before it is sent and record its cost when it ends, and tell a healthy retry from a loop by comparing what each call asked for and what it got back. Then you will read three traces and decide, before the reveal, which run is killed, which is handed to a person and which keeps going.
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 the model cannot argue with
- A ledger checked before each call
- Telling a retry from a loop
- Three traces
- Kill or escalate
- The same ceilings in real runtimes
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions