Codex

The Codex harness runs OpenAI’s Codex CLI inside the FLARE Docker container, billing usage against your ChatGPT subscription via OAuth credentials stored in ~/.codex.

Choosing a plan

Codex is available on paid ChatGPT plans. Compare plans at ChatGPT pricing and pick one that covers your expected usage, then monitor your consumption at Analytics.

Authenticating for FLARE

Authenticate the Codex CLI on the host following these instructions:

codex login

This writes credentials to ~/.codex. FLARE bind-mounts that directory read-write into the Docker container at run time so Codex can refresh its access token mid-session.

Using the harness

from milp_flare.harness import CodexHarness

harness = CodexHarness(model="gpt-5.4", effort="high")

Or via the HARNESSES registry (convenient for config-driven experiment scripts):

from milp_flare import HARNESSES

harness = HARNESSES["codex"](model="gpt-5.4", effort="high")

Cost tracking

The Codex CLI does not report per-run USD, so the harness computes it from token totals using the pricing table in COST_PER_MTOK. This is used to populate cost_usd in HarnessRunResult. Ensure the pricing table reflects current OpenAI API prices.