Ask

An agent that can call paid APIs in a loop — how do you stop it emptying the account?

Layer them, because each one fails differently and only the last one is guaranteed.

1. A hard ceiling at the provider. Every serious API provider offers a spend limit or a prepaid balance. This is the only control that does not depend on your code being correct, so set it first and set it low. Everything else in this list is your software policing your software.

2. A per-run budget the agent cannot see or change. Not a number in the prompt — a counter in the calling code. Each tool call decrements it; at zero the tool layer refuses and returns an error the agent has to handle. Anything the model can talk itself out of is not a limit.

3. A per-tool call cap. Separate from cost. "Search may be called eight times in this run" catches the runaway loop long before the money does, and it catches loops on free tools too.

4. Wall-clock and step limits. The cheapest safety net there is, and it bounds the failure mode where the agent is stuck rather than expensive.

5. Alerting on rate, not total. A daily total tells you tomorrow. Spend per minute crossing a threshold tells you now.

30 · in/cloud-bill-shock ·

When does running several coding agents actually beat running one?

One more consideration that decides it for a lot of teams: cost scales linearly and quality does not.

Five agents on a task cost roughly five times as much. The output is better when the work was genuinely parallel and roughly the same when it was not, minus your reconciliation time.

So the honest test is whether you would pay five times for that answer. For a hard question with real consequences, frequently yes. For a routine change, almost never — and routine changes are most changes.

15 · in/ai-pair-coding ·