← All posts

Explainer

The Codex harness is open: what OpenAI actually handed you

The Codex harness is open: what OpenAI actually handed you

On August 20, 2026, OpenAI declared the engine under Codex a platform and put the whole thing on the table under Apache-2.0 — the harness that runs the agent loop, plus three ways in: codex exec for scripts and CI, the official Codex SDK for application code, and app-server, the JSON-RPC protocol the IDE extensions are built on. The sales pitch is one number: with harness changes alone — retained reasoning and context compaction, same GPT-5.6 Sol underneath — the ARC-AGI-3 score went from 13.3% to 38.3% while output tokens dropped sixfold (OpenAI-reported). The strategic read writes itself: if the harness moves a benchmark 3x without touching the model, the harness is worth open-sourcing precisely because the models are not.

What actually shipped — and what was already there

Get the timeline right first, because much of the coverage compresses it. The openai/codex repo was created on April 13, 2025 and has carried an Apache-2.0 license the whole time; the Rust core (codex-rs), the CLI, and the app-server source were already in it, and OpenAI published an engineering deep-dive on the App Server back in February 2026. So August 20 was not a source drop. It was a support contract: the app-server protocol is now documented for third parties, the TypeScript and Python SDKs are official, and OpenAI is explicitly inviting you to build products on the layer that was previously "read the code and good luck." The repo sits at roughly 114k stars as of this writing.

ComponentWhat it isStatus
Harness core (codex-rs)The agent loop in Rust: context management, tool execution, sandboxing, approvals, event streamApache-2.0, in the repo since 2025
Codex CLIThe interactive terminal agent everyone knowsApache-2.0
codex execNon-interactive runs: final message to stdout, progress to stderr, JSONL events, schema-validated outputApache-2.0, now a documented platform surface
app-serverBidirectional JSON-RPC protocol over stdio: threads, turns, events, approval requestsApache-2.0, protocol newly documented
Codex SDKTypeScript and Python libraries to start, resume, and stream Codex tasksApache-2.0, now official
GPT-5.x Codex modelsThe models that make the harness goodNot open — API and ChatGPT plans only
gpt-oss modelsOpenAI’s open-weight line, runnable locally via the built-in Ollama / LM Studio providersOpen weights, separate release

If you already run Codex CLI day to day, nothing about your binary changed — you were running the harness all along, and installation is the same. What changed is that the parts you could previously only read are now parts you are supported in building on.

Why the harness matters more than the model

The ARC-AGI-3 experiment is the most interesting artifact in the announcement. Two harness features — retained reasoning across turns and context compaction — took the same GPT-5.6 Sol model from 13.3% to 38.3% while cutting output tokens six times over. That is not a model release; it is plumbing. OpenAI-reported, single benchmark, so hold it loosely — but the direction matches what anyone operating long agent runs already knows: agents fail less from model stupidity than from context falling apart at hour two.

The post defines the category cleanly: the model answers, but "the surrounding execution system is the harness" — the thing that lets an agent understand a task, maintain context over time, inspect relevant information, call tools, expose progress, handle failures, request human approval when necessary, and return a useful result. Every serious agent product ends up rebuilding that list. OpenAI is betting that if its rebuild is free and good, you will bring your workloads — and your model spend — to it.

app-server: the piece worth reading

App-server is the harness exposed as a long-lived process speaking bidirectional JSON-RPC 2.0 messages (with the jsonrpc header omitted on the wire), newline-delimited JSON over stdio by default, with experimental WebSocket and Unix-socket transports. The API is organized around three primitives: threads (a conversation, which can be created, resumed, forked, and archived with persisted history), turns (one user-to-agent exchange), and items (the persisted inputs and outputs — user messages, agent reasoning, shell commands, file edits). A mandatory initialize handshake opens each connection, and the server can initiate approval requests that pause execution until a client answers.

This protocol was not designed for the announcement; it fell out of building the VS Code extension, which is its first production client. That is exactly why it is credible — the GitHub and JetBrains integrations ride the same events you would. If you have wired up Codex CLI notifications, app-server is the grown-up version of the same idea: instead of scraping one notify event, you subscribe to the full stream.

codex exec and the SDK: the automation surfaces

codex exec runs a bounded agent workflow without the TUI: final agent message to stdout, progress to stderr, --json for the full JSONL event stream, and --output-schema to force the result into a JSON Schema you define. The sandbox defaults to read-only — escalation to workspace-write is a flag, and the sandbox modes apply unchanged. Sessions resume with codex exec resume --last, which makes multi-stage pipelines practical. If you are putting an agent into CI, this is the entry point — running a coding agent in CI covers the pattern.

The SDK (TypeScript and Python, in the repo’s sdk/ directory) is the programmatic wrapper: start, resume, and stream Codex tasks from application code without speaking JSON-RPC yourself. OpenAI’s own framing of the split: the SDK simplifies common workflows; app-server gives product teams direct control over lifecycle and UX.

Can you point it at another model?

Yes — with one hard constraint. Custom providers go in config.toml:

[model_providers.myproxy]
name = "My Provider"
base_url = "https://api.example.com/v1"
env_key = "MYPROXY_API_KEY"
wire_api = "responses"

The constraint is that last line: per the config reference, "responses" is the only supported wire_api value — the endpoint must speak the OpenAI Responses API, not Chat Completions. Ollama and LM Studio ship as built-in providers (an --oss flag selects your configured local one), which is how you run open-weight models — gpt-oss included — under the open harness with zero API spend. Anthropic and other vendors’ native APIs need a Responses-compatible proxy in front. So: model-agnostic plumbing, Responses-shaped socket.

Harness vs Claude Agent SDK

The obvious comparison is Anthropic’s Claude Agent SDK, which has owned the "build your own agent on our engine" category since late 2025.

Codex harnessClaude Agent SDK
LicenseApache-2.0, full sourceAnthropic Commercial Terms; engine closed
EngineRust core you can read, fork, embedBundled Claude Code binary the SDK drives
LanguagesTypeScript + Python SDKs; JSON-RPC for everything elseTypeScript + Python
ModelsOpenAI by default; any Responses-API endpoint, incl. local Ollama / LM StudioClaude models (API, Bedrock, Vertex)
Extension pointsMCP servers, skills, plugins, exec policiesMCP servers, hooks, subagents, permissions
Headless / CIcodex exec with JSONL events + output schemasSDK query loop
Long-run supervisionApproval requests over app-server; watching them is your problemHooks + permission prompts; watching them is your problem

Anthropic’s stack is more turnkey today — hooks and subagents are mature, and the docs assume product builders. OpenAI’s counter is structural: you can read every line of the harness, ship it commercially, and swap the model endpoint, none of which the Claude side permits. For the day-to-day CLI matchup, see Claude Code vs Codex. Note the last row of that table: both stacks raise approval requests, and neither watches them for you.

What people are building on it

OpenAI’s examples are deliberately not coding tools: security investigation queues, support consoles, operations dashboards — "software that reflects how a specific person or team already works." Two named deployments, both OpenAI-reported: Cisco built App Builder inside Cisco Cloud Control on the Codex SDK, and Thrive Holdings’ accounting firm Crete ran a tax-preparation pilot that processed 7,000 returns with roughly a one-third reduction in preparation time. The shape of both is the same: the harness supplies the loop, the tools, and the approval gates; the builder supplies the domain and the UI.

What still ties you to OpenAI

Frequently asked questions

What is the Codex harness?

The execution system around the model — everything that lets an agent understand a task, maintain context over a long conversation, inspect relevant information, call tools, stream progress events, handle failures, ask a human for approval before consequential actions, and return a structured result. OpenAI's August 20, 2026 platform post argues this layer, not the model, is what separates a capable agent from a prompt-response loop, and backs it with an ARC-AGI-3 experiment where harness changes alone took GPT-5.6 Sol from 13.3% to 38.3%.

Is Codex open source now?

The harness is; the models are not. The openai/codex repo has carried an Apache-2.0 license since it appeared in April 2025, and the Rust core, CLI, codex exec, app-server, and the TypeScript and Python SDKs all live in it. What changed on August 20, 2026 is commitment: OpenAI now documents the app-server protocol and positions the SDK and exec as supported surfaces for building your own agents. The GPT-5.x Codex models remain API-and-ChatGPT-only; the separate gpt-oss models are the open-weight exception.

Can I use the Codex harness with other models?

Yes, with one hard constraint: the endpoint must speak the OpenAI Responses API. You add a model_providers block to config.toml with a name, base_url, and env_key; the config reference lists "responses" as the only supported wire_api value. Ollama and LM Studio ship as built-in providers for local open-weight models, and an --oss flag selects them. ChatGPT-plan sign-in only authenticates against OpenAI, so custom providers bring their own keys.

How does the Codex harness compare to the Claude Agent SDK?

Same product category, opposite licensing. The Claude Agent SDK is TypeScript and Python bindings over the bundled Claude Code engine, governed by Anthropic's Commercial Terms of Service, with the engine closed and Claude models assumed. The Codex harness is Apache-2.0 end to end — Rust core, CLI, JSON-RPC app-server, SDKs — and accepts any Responses-API endpoint. Anthropic's stack is more turnkey for hooks and subagents today; OpenAI's is the one you can fork, embed, and ship commercially without a terms conversation.

Where Backgrind fits

Backgrind is not a harness and does not compete with one. It is a desktop overlay for macOS and Windows that PTY-wraps whatever CLI you already run — codex today, and anything you build on the open harness tomorrow, because a terminal is a terminal — and floats it above your other windows, including games in borderless fullscreen. When the harness raises one of those approval requests, Backgrind pings you; you approve from a toast, a hotkey, or your phone, without alt-tabbing into a terminal you were supposed to be watching.

This release is the clearest evidence yet for the thesis Backgrind is built on: agent engines are commoditizing — the loop, the tools, the approval plumbing are now a free Apache-2.0 download from the biggest lab in the industry. What stays scarce is the other side of that approval request: a human who notices, in time, across three concurrent runs, while doing something else. That supervision layer is the overlay’s whole job, and it works the same whether the harness underneath is OpenAI’s, Anthropic’s, or yours.

Sources

Primary: Codex as a platform: build on the open agent harness (OpenAI Developers blog — components, harness definition, ARC-AGI-3 figures, Cisco and Thrive/Crete cases) and Unlocking the Codex harness: how we built the App Server (OpenAI engineering post on the protocol’s origin). Source, license and components: openai/codex (Apache-2.0; repo creation date and star count read from the GitHub API) and the app-server README (JSON-RPC framing, transports, threads/turns/items, initialize handshake). Custom providers and wire format: Codex config reference; non-interactive flags: codex exec docs. Claude side of the comparison: Claude Agent SDK overview and the license terms in anthropics/claude-agent-sdk-typescript. Release-date confirmation from secondary coverage: Open Source For You. ARC-AGI-3, the token figures, and both enterprise case studies are OpenAI-reported and not independently replicated.