OpenAI Agents

Local AgentInspect processor for OpenAI Agents JS. Prefer setTraceProcessors for local-only traces.

How to use @agent-inspect/openai-agents without sending traces to OpenAI's default export pipeline.

Two processor modes

ModeAPIOpenAI default exportAgentInspect traces
Additional processoraddTraceProcessor(agentInspect(...))May still runLocal JSONL via AgentInspect
Replacement listsetTraceProcessors([agentInspect(...)])Disabled when list is only AgentInspectLocal only

For local-only debugging, prefer setTraceProcessors with only the AgentInspect processor unless you explicitly need OpenAI's export.

ts
import { setTraceProcessors } from "@openai/agents";
import { agentInspect } from "@agent-inspect/openai-agents";

setTraceProcessors([
  agentInspect({
    traceDir: ".agent-inspect",
    capture: "metadata-only",
  }),
]);

What maps to AgentInspect steps

  • Agent runs → run / step spans
  • Tool calls → TOOL steps with metadata
  • Handoffs → correlated steps when metadata is present
  • Guardrails → bounded metadata (no certification claims)
  • MCP tool calls → tool steps when the Agents SDK exposes MCP spans

Privacy

  • Default metadata-only capture
  • No automatic upload from AgentInspect
  • Replacing processors does not by itself redact OpenAI SDK network traffic — review OpenAI SDK settings separately
  • capture: "preview" is opt-in and persists bounded, redacted inputPreview / outputPreview span attributes; tune with maxPreviewChars and redactionProfile, and watch onDiagnostic / getDiagnostics().capture for AI_CAPTURE_FIELD_UNAVAILABLE. There is no full-content mode. See ADAPTERS.md.

Recipes

  • openai-agents-local-processor

No-key packed consumer check

The repository includes a packed-consumer check that installs the root and OpenAI Agents adapter tarballs into a temporary project. It drives deterministic tracing fixtures without OPENAI_API_KEY or a live provider call, writes a local trace, and inspects it through the packed AgentInspect CLI.

bash
pnpm build
node scripts/packed-openai-agents-e2e.mjs

The check is also included in pnpm pack:smoke.

Troubleshooting

SymptomCheck
Traces also appear in OpenAI dashboardYou may be using addTraceProcessor alongside default export — switch to setTraceProcessors for local-only
No local filesConfirm processor is registered before agent runs; check traceDir
Missing tool spansEnsure tools run inside a traced agent session

See ADAPTERS.md.

Full reference remains in GitHub docs during the docs migration.