Use traces to diagnose failures in individual runs. Turn those failures into repeatable tests so you can detect regressions when you change a prompt, tool, or workflow.
Inspect a trace
Use tracing with the Agents SDK to record model calls, tool calls, guardrails, and handoffs. When a run fails, check where the behavior diverged from what you expected. For example, check whether the agent called the right tool, passed the right arguments, or requested approval before taking an action.
Build a repeatable evaluation
- Select representative inputs and include cases where you observed failures.
- Define checks for the final response and for important intermediate actions, such as a tool call or handoff.
- Run the same cases before and after a change. Inspect the traces for regressions to identify which step needs attention.
Get started with Promptfoo to set up test cases and assertions. For more on designing evaluation criteria and test sets, see the evaluation best practices.