Skip to main content
Instrument the execution object or its event bus, then choose where the completed trace goes. By default, capture retains lifecycle metadata and usage while omitting prompt text, tool arguments/results, response text, and error bodies.

Write JSONL traces

This complete example requires OPENAI_API_KEY and a TypeScript runner. It makes a model call and appends a metadata trace to traces.jsonl.
traces.ts

Observe a harness

Pass an EventBus as HarnessRuntime.telemetry and attach instrumentBus(bus, options) to observe runtime/direct model and controller calls. Keep Agent-driver instrumentation on its own bus to avoid counting a call twice. A tool event or missing trace is not evidence of whether an external effect happened; use application records for that.

Capture and shutdown

Choosing an exporter does not opt into content. If you need content, set an explicit bounded capture/redaction policy at both instrumentation and each explicit exporter instance. See capture policy. Export queues and retention are bounded. Slow exporters do not block the Agent’s outcome; drops and export errors appear as diagnostics. Call shutdown() after active work settles to detach and drain within its deadline. The host still owns external providers and clients it supplied.