Skip to main content
Guide

Why AI agents fail in production

Last updated · Published by Trustabl

Many agent failures are not model failures. They are gaps in the code and configuration around the model, and most can be found in the agent's code before it ships. Even tool descriptions are a weak point: 97.1% of 856 MCP tool descriptions had at least one quality problem.

The eight common reliability gaps

# Gap What happens Example Stage that catches it
1 Unhandled tool errors A tool returns an error or an empty result and the agent carries on as if it succeeded A search tool returns [] after a rate limit; the agent tells the user nothing was found Code, Test
2 Missing timeouts and retry limits One slow API call stalls the run, or blind retries multiply cost and side effects A CRM call hangs for 90 seconds, so the run times out mid-task; retries create three duplicate tickets Code, Test
3 Unbounded loops No cap on iterations or recursion; the agent cycles until it hits a token or budget wall The agent re-plans the same failed step 40 times and burns its token budget Code, Test
4 Unvalidated outputs Free-text model output goes straight into code, queries or other agents The model returns "about 2,000" where code expects a number, and the next step crashes Code, Test
5 Untrusted input treated as instructions Web pages, files or tool results steer the agent (prompt injection) A web page tells the agent to email a file to an outside address, and it does Test, Contain
6 Over-broad permissions The agent holds credentials, egress or tools far beyond its task A support agent with a full admin key deletes records it only needed to read Contain
7 Silent failures No telemetry, or telemetry without agent labels, so failures stay invisible The agent reports success after a failed write, and nothing in the logs shows it Observe
8 No recovery path No checkpoints, idempotency or human hand-off; a mid-run failure leaves systems half-changed A refund agent fails after charging the card but before updating the order Code, Observe

Why these gaps are common

  • Agent code is new code. Teams that would never ship a web service without timeouts ship agents without them, because frameworks hide the network calls.
  • Demos hide variance. A single successful run says little. Reliability problems show up on the tenth, hundredth and thousandth run.
  • Tools multiply failure modes. Every tool an agent can call adds error paths, latency and permissions.
  • Errors compound across steps. At 95% success per step, a 10-step task succeeds only about 60% of the time. See why errors compound.
  • Observability alone arrives late. Traces show a failure after a user hits it. Static analysis and tests find many of the same gaps before release.

How to fix them

Work through the agent reliability lifecycle: write the code to reliability rules, test it with static analysis and repeated-run evals, contain its reach, and observe it in production. The checklist turns this into twelve checks you can run before every release.

Further reading

Next: The agent reliability lifecycle