Codex Quickstart for NeMo Relay
This Quickstart Guide walks you through the process for running one local Codex CLI task through NeMo Relay and writing its turn, model, and tool lifecycle to a local Agent Trajectory Observability Format (ATOF) file. For detailed setup, refer to the Installation Guide.
This path observes local Codex processes. Cloud or remote Codex tasks are only partially observable because their provider traffic does not cross the local Relay gateway.
This guide uses disposable local files and wrapped execution to try Relay for one run. It is a trial configuration, not an ongoing deployment setup.
For personal use, configure user or system settings and follow the agent’s persistent integration setup.
For administrator-managed deployments, use daemon mode for a shared service and centrally managed configuration.
Use the event relationships to follow model and tool work through a run and check where the expected activity occurred.
Prerequisites
Before you start, make sure you have:
- Codex CLI 0.150.0 or newer
- Inference access: an OpenAI API key, a supported Codex login, or credentials for an OpenAI Responses-compatible gateway
- A trusted Git working directory where Codex is permitted to create a file
- A supported NeMo Relay CLI platform
- Permission to download the NeMo Relay version used by this guide
On Unix, the verification step also uses jq 1.6 or newer; check your version
with jq --version. PowerShell uses its built-in JSON parser.
Use Codex’s configured model; Relay does not select or require one. For example,
authenticate with codex login, or set OPENAI_API_KEY for an API-key-backed
Relay-wrapped run. Relay replaces Codex’s model provider with its gateway
provider, so CODEX_API_KEY or a custom provider’s env_key alone is insufficient.
A custom gateway must provide the OpenAI Responses
API; configure its credentials, base URL, and model in Codex before wrapping
the run. Also add an [upstream] section with
openai_base_url = "https://YOUR_GATEWAY/v1" to the Relay config.toml below;
Codex’s custom base URL is not carried over when Relay replaces its provider.
Refer to Codex authentication.
Quickstart Steps
To quickly get started with NeMo Relay, complete the following steps:
Install the NeMo Relay CLI
Install the NeMo Relay CLI version for these docs:
Unix shell
Windows PowerShell
Set up a working directory
Create a disposable Git repository and permit Codex to write files there:
Save and run the remaining files from this directory:
Save this file as
config.tomlin the directory where you will run the agent:config.tomlThe agent entry in
config.tomltells Relay which executable to launch.Save this sibling file as
plugins.tomlto enable ATOF export tologs/events.jsonl:plugins.toml
ATOF output can contain sensitive prompts, responses, tool arguments, and tool
results. Protect logs/events.jsonl even when full payload export is disabled.
Run a Codex task
The prompt asks the agent to create a known file so you can distinguish a successful tool action from an ordinary text reply. Relay records the turn, model calls, and tool activity while the agent completes the task.
From the directory containing both files, clear the previous example outputs and run the validation prompt:
Unix shell
Windows PowerShell
The workspace-write sandbox permits the marker file in your working directory; it does not disable sandboxing.
To choose a model for this invocation, use
nemo-relay --config "$PWD/config.toml" codex -- --model MODEL_ID exec --sandbox workspace-write "YOUR_PROMPT".
Replace MODEL_ID with an ID your provider supports. Put this Codex option
before exec, preserving the prompt and sandbox from the command above.
Relay starts a temporary local gateway and injects Codex hooks for this run. It does not modify your persistent Codex plugin configuration.
Verify the output
The tool marker proves that the agent created the requested file. The event marker proves that Relay recorded matching start/end records for the required turn or agent, tool, and model work. The response marker is the agent’s reply; it is checked separately from the captured lifecycle.
The verification command prints RELAY_QUICKSTART_TOOL_OK and RELAY_QUICKSTART_EVENTS_OK.
Run the verification checks
After the task exits, confirm that Relay wrote the local event stream:
Unix shell
Windows PowerShell
The verification command prints the following output when its checks pass:
The agent’s final reply should include RELAY_QUICKSTART_RESPONSE_OK;
its surrounding wording can vary.
- The verification markers confirm the tool-created file and matching start/end records for custom turn, tool, and LLM work.
- If Codex reports that approval requests are unsupported in
execmode, run the same command interactively by removing onlyexec. Keep--sandbox workspace-write, approve the file write if prompted, and exit Codex after the reply before running the verification checks. Existing Codex settings and tool policies can still require approval inside the workspace.
Inspect the Recorded Activity
Read the completed model calls from the same event file:
Unix shell
Windows PowerShell
category and name identify the recorded work. The same uuid pairs its
start and end records; parent_uuid connects it to its enclosing scope.
timestamp records when this event occurred. For model calls, category_profile
and metadata can include the model identity and completion status, depending
on the integration. These fields let you follow a call through the run without
requiring full prompt or response capture.
Next Steps
Now that you have a working setup, you should explore the following resources in greater detail: