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
workflow_namefor the logical application flow.group_idto connect runs from one conversation.- Metadata for environment/version/experiment identifiers.
- Custom spans around important application work.
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.