CTL-155 · agent
Per-Run Spend Caps
Set hard token, cost and time limits per agent run at the model gateway and cloud layer.
TechnicalEffort LowEffectiveness High
Runaway loops stop when something cuts them off. Per-key or per-run budgets at an LLM gateway, maximum iteration and wall-clock limits in the agent runtime, and cloud quotas for agent roles cap the damage of any single run.
Set limits per agent based on its normal runs, with some headroom. A coding agent and a research agent have very different costs. Make the stop visible to the run owner with the reason, so they can raise the limit on purpose rather than work around it.
Put it in place
- 01Route agent model traffic through a gateway with per-key and per-run budgets.
- 02Set maximum steps, tool calls and wall-clock time in the agent framework.
- 03Tag cloud resources created by agents with the run ID and auto-delete on run end.
- 04Alert the run owner at 50 percent of budget and stop at 100 percent.