Skip to main content
Trace Codex CLI agent turns, tool calls, and API requests in Arize AX for full observability.
Codex is OpenAI’s open-source CLI coding agent. The Arize Coding Harness Tracing instruments Codex notify hook events and exports OpenInference spans to Arize AX. Each agent turn is captured as an LLM span with tool calls, token usage, and API request details.

Launch Arize AX

To get started, sign up for a free Arize AX account and get your Space ID and API Key:
  1. Log in at app.arize.com
  2. Click Settings and copy the Space ID
  3. Open the API Keys tab and create or copy an API key

Install

Curl installer

macOS / Linux:
Windows (PowerShell):

Local clone

Open a new shell after install so the update takes effect.

Configuration

Credentials live in ~/.arize/harness/config.json. To override per category, set environment variables in ~/.codex/arize-env.sh — the notify hook sources this file automatically. Env values take precedence over config.json.

Redaction controls

Each ARIZE_LOG_* flag accepts "true" or "false" and defaults to "true". Set to "false" to opt out per category:

Observe

Once tracing is enabled, Codex activity is streamed to Arize AX. You’ll see:
  • Turn traces — each agent turn (user prompt to assistant response) as a parent LLM span
  • Tool call spans — one per tool decision and result pair
  • API request spans — one per API or WebSocket request
  • Session grouping — all turns from the same session grouped by session.id
  • Token usage — prompt, completion, and total token counts on every turn span

Hooks Captured

Codex emits a single notify event with subtypes for each lifecycle stage. The Arize AX hook fans them out into the spans listed above.

Reference

For the full list of environment variables, default file paths, and troubleshooting steps, see the Codex tracing README.

Uninstall

Resources

Arize Coding Harness Tracing

OpenInference

Codex CLI