Trace AI Agents

The OpenAI Agents SDK includes built-in tracing. A trace represents an end-to-end workflow and contains spans for model generations, agent turns, tools, handoffs, guardrails, and custom events.

from agents import Runner, trace

with trace("Customer support"):
    result = await Runner.run(agent, user_message)

Useful trace dimensions

Sensitive data

Generation and function spans can contain model/tool inputs and outputs. Disable sensitive-data capture where required rather than assuming traces contain only metadata.

Reference

OpenAI Agents SDK tracing