OpenAI Agents trace processor
Attach Aletheia as an additional trace processor. Existing processors remain in place.
import { addTraceProcessor } from "@openai/agents";
import { createAletheiaTraceProcessor } from "@avinash27/aletheia";
addTraceProcessor(createAletheiaTraceProcessor({
apiKey: process.env.ALETHEIA_API_KEY!,
openaiApiKey: process.env.OPENAI_API_KEY,
captureContent: false,
}));Agent, model, function-tool, handoff, guardrail, response, custom, and MCP spans are mapped into the versioned Aletheia protocol. Duration, token usage, and supported-model cost are rolled up automatically. Supplying an OpenAI API key adds evidence-based decision events; the key is never sent to Aletheia. Inputs and outputs are recorded only when content capture is explicitly enabled.