Reading Multi-Step Agent Traces Without an LLM Judge
Diagnose multi-step agent failures using deterministic signals instead of LLM judges.
Guide · Trace Analysis
The spans and attributes an AI agent trace needs, named as in the OpenTelemetry GenAI conventions and the OpenAI Agents SDK, and the failure each one exposes.
Trace Taxonomy Editors · Updated
Agent tracing records one run of an AI agent as a tree of spans: the agent invocation at the root, and beneath it every model call, tool call, handoff and check, each with its timing, inputs, outputs and errors. A good agent trace lets you answer three questions about any run: what the agent was given, what it decided, and what it actually did.
This guide covers which spans an agent trace needs, which attributes on them expose which failure, and how the OpenTelemetry GenAI conventions and common agent frameworks name them. The failure modes it refers to are the 14 in the MAST taxonomy guide.
An agent run differs from an ordinary request in that its shape isn't fixed in code. The model decides how many steps there are, which tools to call and when to stop, so the trace is the only record of the path a run took.
Span names below are the ones the OpenTelemetry GenAI conventions recommend, next to what the OpenAI Agents SDK records by default. Other frameworks use their own names for the same operations.
| Operation | OpenTelemetry span name | OpenAI Agents SDK | What it lets you see |
|---|---|---|---|
| Agent or workflow invocation | invoke_agent {agent name}, or invoke_workflow when the application defines the control flow | agent_span (inside the run's trace) | Which agent did the work, and the boundary of one run or sub-run. Everything below it hangs off this span. |
| Plan | plan {agent name} | No dedicated span; the plan is in the generation that produced it | What the agent decided to do before doing it, so later steps can be checked against the plan. |
| Model call | {operation} {model}, e.g. chat gpt-4 | generation_span | The prompt the model actually saw, what it returned, token counts and why it stopped. |
| Tool call | execute_tool {tool name} | function_span | The arguments the agent passed, the result it got back and whether the tool errored. |
| Handoff to another agent | execute_tool {tool name}, when the handoff is a tool call that transfers work to another agent | handoff_span | What one agent passed to the next, which is where context gets dropped. |
| Guardrail or check | No generic GenAI span; record it as a custom span | guardrail_span | Whether a check ran at all, and what it decided. |
The OpenTelemetry conventions place the model call that produces a plan under the plan span, and the tool calls that carry the plan out as its siblings under the agent span. Keeping that nesting is what lets you compare what an agent planned with what it did.
Each row is an attribute from the OpenTelemetry GenAI conventions, the requirement level the conventions give it, and the failure it helps you find. Where it maps to a MAST failure mode, the code links to it.
| Attribute | On | Level | What it finds |
|---|---|---|---|
| gen_ai.agent.name | Agent and plan spans | When available | Role violations: an agent calling tools or making decisions that belong to another. (FM-1.2) |
| gen_ai.conversation.id | Agent and model spans | When the library has one | Runs that belong to the same session, so a failure split across several runs can be read as one. |
| gen_ai.tool.name and gen_ai.tool.call.id | Tool spans | Name required; call ID when the model supplies one | Repeated tool calls, and which model response asked for which tool execution. (FM-1.3) |
| gen_ai.tool.call.arguments | Tool spans | Opt-in | Arguments nothing upstream supplied: guessed or fabricated IDs, assumed values. (FM-2.2) |
| gen_ai.tool.call.result | Tool spans | Opt-in | A fact an agent received and then left out of its handoff, or misread. (FM-2.4) |
| gen_ai.usage.input_tokens and output_tokens | Model spans | Recommended | Context that shrinks sharply between turns of the same agent. (FM-1.4) |
| gen_ai.response.finish_reasons | Model spans | Recommended | Outputs cut off by the token limit rather than finished, which then look complete downstream. |
| gen_ai.input.messages and gen_ai.output.messages | Model spans | Opt-in | Reasoning that says one thing while the tool call in the same span does another. (FM-2.6) |
| error.type | Any span | Required when the operation errored | Which errors were real errors, so they can be told apart from runs that failed with no error at all. |
The conventions also ask instrumentations to set the agent name, operation name and tool name when a span starts, not when it ends, because sampling decisions are made from them. Two more things no attribute gives you: how the run ended (finished, errored, hit a turn limit, timed out) and which agent each message came from. Add both yourself if your framework doesn't record them.
In the OpenTelemetry conventions the content attributes are opt-in: the messages sent to and from the model, the system instructions, tool definitions, tool arguments and tool results. The conventions warn that tool arguments and results may contain sensitive information.
Leaving content out keeps a trace safe, but it also hides most agent failures. A fabricated order ID, a constraint the agent dropped or a fact it never passed on all look like a normal tool call when you only have names and timings. Ways to keep the content without spreading it:
_ref attributes (for example gen_ai.input.messages_ref) that hold a URI to the content in separate storage, so the trace backend never holds it.An agent can return a success status, stay within its latency budget and still do the wrong thing. Metrics count those runs as healthy, and logs show each step on its own. A trace keeps the steps in order with their parents, which is what you need to find the first step that went wrong rather than the last step that showed it. Silent success codes masking agent misbehavior and Root-cause attribution across parallel agent spans go further into both.
Tracing is built in and on by default. Each run is wrapped in a trace, with spans for agents, LLM generations, function tool calls, guardrails and handoffs. Traces have a workflow name and an optional group ID that links traces from the same conversation. Custom trace processors can send them to other destinations as well as, or instead of, OpenAI's Traces dashboard. The SDK's docs note that tracing is unavailable for organizations using OpenAI's APIs under a Zero Data Retention policy. See its tracing docs.
The OpenTelemetry conventions name LangChain, LangGraph, CrewAI, Microsoft Agent Framework, Pydantic AI, Google's ADK and the OpenAI Agents SDK in their guidance on which operations count as agents and which as workflows. Whether a given framework emits these spans, and which version of the conventions it follows, depends on its instrumentation: check the framework's own docs.
The AI SDK emits OpenTelemetry spans for its calls and records inputs and outputs unless you turn that off. Its telemetry docs list the spans and options. Trace-driven debugging for Vercel AI SDK agents walks through reading them.
Agent tracing is recording every step of an AI agent's run as a tree of timed spans: the agent invocation at the root, and under it each model call, tool call, handoff and check, with their inputs, outputs and errors. One trace is one run, so you can read back what the agent saw, decided and did, in order.
LLM tracing usually records single model calls. Agent tracing records the run around them: which agent made each call, the tools it used with what arguments, what it handed to other agents and how the run ended. Most agent failures sit in those steps, not inside one model call.
OpenTelemetry's semantic conventions for generative AI define span names and attributes for agent invocations, model calls and tool executions. They are still marked as in development and now live in their own repository, so check the current version before you build on a specific attribute.
Several failure modes can only be seen in content: fabricated arguments, withheld information, reasoning that contradicts the action. The OpenTelemetry conventions make content opt-in because it can hold sensitive data. Record it where you can redact it or keep it in separate storage, rather than not at all.
Not span by span. Failures like step repetition, conversation resets and early termination only show across a whole run, so if you sample, keep or drop entire runs.
Diagnose multi-step agent failures using deterministic signals instead of LLM judges.
Causal graph reconstruction separates where agent failures begin from where they appear.
Read agent traces to find where execution left the plan.
Agents return success while silently failing, evading all standard monitoring.
Full-trace retention reveals recurring agent failures that sampling destroys through fragmentation.
Agents invent IDs that pass every check and corrupt real records.