AI agent failures are simultaneously reliability incidents and cost incidents. A production agent that enters a retry loop, processes inputs it was not designed for, or receives malformed responses from downstream dependencies does not just fail to complete its task. It fails while continuing to consume tokens, and the cost of the failure can exceed the cost of successful operation by a significant multiple.
The Failure Modes That Cost the Most
Retry amplification is the most expensive failure mode in production agent systems. An agent that encounters an error will retry the failed step according to its retry configuration. If the underlying cause of the failure is systematic rather than transient, every retry fails in the same way. A task that was expected to complete in five steps at a predicted cost now runs indefinitely, each retry accumulating context from all prior attempts.
Context accumulation during failure is the second compounding factor. In multi-step agent workflows, each step's context typically includes the history of prior steps. When a step fails repeatedly, the context grows with each retry. By the fifth retry of a step that is failing systematically, the context sent to the model may be five times larger than the first attempt, and the token cost per retry has grown proportionally.
What Good Cost Controls Look Like for Agent Systems
Agent cost controls need to operate at the task or session level rather than the request level, because a single agent task may involve dozens of requests. Per-task cost limits set a maximum total token expenditure for a single agent task execution. When the task cost exceeds the limit, the agent is stopped and the task is flagged for human review rather than continuing to run. Step-level retry limits cap the number of retries allowed for any single step, providing defense in depth against retry amplification.
The Incident Response Playbook
When a production agent generates an unexpected cost spike, the incident response should include stopping the agent execution as quickly as possible to limit additional spend, identifying which step or tool was causing the failure, analyzing the total cost of the incident including the context accumulation multiplier, and documenting the failure mode for the post-incident review. The post-incident review should produce at minimum a retry limit adjustment and ideally a per-task cost limit that would have bounded the incident's cost impact.