Skip to main content
Prefer zero setup? Use plog run or import provenlog.auto instead. See Auto-Instrumentation.

Setup

from provenlog.integrations.openai_agents import Trail
from agents import add_trace_processor

add_trace_processor(Trail(agent_id="my-openai-agent"))

What gets captured

EventAction TypeDetails
Function callsTOOL_CALL / TOOL_RESULTFunction name, arguments, output
LLM generationsLLM_CALL / LLM_RESPONSEModel, token counts
HandoffsCUSTOMSource agent, target agent
Guardrail evaluationsCUSTOMGuardrail name, pass/fail
Agent spansCUSTOMAgent lifecycle events

How it works

The Trail registers as a trace processor via the OpenAI Agents SDK’s add_trace_processor hook. It receives structured trace events for all agent activity.

Configuration

# Simple — uses default embedded mode
trail = Trail(agent_id="my-openai-agent")

# With explicit client for custom configuration
from provenlog import ProvenLogClient

client = ProvenLogClient("http://localhost:7600", agent_id="my-agent")
trail = Trail(client=client, agent_id="my-openai-agent")