Lab

Trace

Trace: A step-by-step record of one agent run, with each model call, tool call and result, used to find what went wrong and improve the harness.

When an agent gets something wrong, the final answer rarely says why. The trace does. It is the record of one run, step by step: what was in the context, what the model output, which tool the harness ran, what came back, how many tokens each turn read, and why the run stopped.

Reading traces is how people find the real cause. Often it is not the model at all. The harness offered the wrong tool, a result was cut short, the instructions were ambiguous, or a useful file was out of reach.

Traces also drive a slower loop around the agent loop. Collect traces from many runs, find the common failures, change the harness, the tools or the instructions, and run again. Keep the change if the results improve. This is sometimes called a hill-climbing loop, because each change is a small step that is kept only if it goes uphill. It improves the system without retraining the model.

There are shared formats for recording traces. OpenTelemetry, an open standard for software telemetry, has draft conventions for agent runs: a span for invoking an agent, and a span for each tool the harness runs, which can record the tool’s name, its arguments and its result. The conventions are still marked as in development, so names may change.

A trace can hold everything the agent read, including private files and anything typed into it. Where traces are stored, and who can see them, matters as much as what they record.

The explainer shows the trace of each run below the scene.

See it working

Explore it in How an AI agent works

Step through a model calling tools in a loop, and see how the harness around it decides what it sees, what it may touch and when it stops.

Open the explainer