The thing I would add from operating these: the expensive failure is almost never a single expensive call. It is a cheap call repeated.
What that means practically is that your per-call cost estimate barely matters and your loop detection matters enormously. The runs that hurt me were an agent retrying a failing tool with a slightly different argument each time, so no naive duplicate check caught it, several hundred times.
Two things that helped more than any budget:
- Detect repetition semantically. Same tool, similar arguments, no progress on the task for N steps → stop. Not a cost control, a sanity control, and it fires earlier.
- Make failures terminal by default. A tool that fails twice should stay failed for that run rather than remaining available. Most runaway loops are an agent optimistically retrying something that will never work.
And log cost per run against the run's outcome. You will find a small number of runs consuming most of the spend, and they are usually the ones that failed.