I'm researching how engineers investigate production incidents involving AI agents. Thinking about a recent incident, what actually went wrong, what took the longest to understand, and which tools helped most—logs, traces, dashboards, evaluation systems, or something else? I'm especially interested in real examples rather than theoretical answers.
4 Answers
The longest part is often reconstructing what the agent actually did, rather than finding the final error. Once multiple models, tools, identities, and permissions are involved, you have to correlate prompts, tool calls, credentials, retrieved context, and execution traces into one timeline. That makes observability and auditability just as important as traditional debugging.
For me, the slowest step is rebuilding the exact execution context. Every run should have one trace ID connecting the input, normalized request, planner decision, model and prompt versions, tool calls and arguments, retrieved documents, retries, validator results, and final response. The hardest bugs happen when each component works alone but the handoff is wrong—for example, stale context, a silently changed template, a partial tool success, or a fallback model making different assumptions.
The AI-agent part is usually what creates the complexity. Anything deterministic should be implemented as ordinary code or automation, with the agent used only where flexibility is genuinely needed. Reducing the agent’s responsibilities can eliminate a lot of troubleshooting.
Exactly. An agent can help write the deterministic pieces, but relying on it for predictable work often creates unnecessary failure modes.
Evaluating the generated result for a particular user input can take a surprising amount of time, especially when several models are involved. It’s difficult to determine whether the problem came from routing, a prompt change, model behavior, retrieved context, or the grading criteria itself.

That matches what I’ve been seeing: the real question is not just whether a component failed, but what the agent knew, what it chose, and why the system allowed that choice.