AI Engineer World's Fair 2026
Building on the Codex Harness — Dominik Kundel, OpenAI
Loading slides…
Read the talk
Building on the Codex Harness
The Codex App Server lets a custom interface use the same agent harness as the Codex app. Dominik Kundel explains the message protocol, customization and packaging choices, then puts the agent inside Doom.
From a talk by Dominik Kundel
At a glance
Ideas worth remembering
App Server gives custom clients access to Codex’s harness through action messages and events, including streaming, thread control and file operations.
Developer instructions preserve the tuned base prompt; deferred dynamic tools add application capabilities that Codex can discover through tool search.
Bundle the server binary and generate bindings for that version so the client does not depend on the user’s installed CLI being compatible.
Use codex exec for scripted tasks; use App Server when a client needs richer interaction, goal functionality or control over multiple concurrent threads.
Build the interface on an existing harness
Building an agent harness can feel intimidating before you even get to the interface you wanted to make. Dominik Kundel, who works on Codex developer experience at OpenAI, opens with that problem: how can developers build their own interfaces while reusing the machinery that already runs Codex?
The Codex App Server provides a protocol around the Codex harness. Like Agent Client Protocol, or ACP, it gives an application a way to communicate with an agent implementation. Here, the implementation is the same harness behind the Codex app, its IDE integrations and third-party clients. The client can change while the underlying agent machinery stays familiar.
Both the harness and App Server are open source under Apache 2. Developers can inspect or fork them, and the model provider is configurable: Kundel describes support for providers with a Responses API-compatible interface, plus convenience settings for LM Studio and Ollama. That compatibility condition matters; the claim is not that any arbitrary model endpoint can be substituted unchanged.
The JSON-RPC-style protocol already supports several kinds of client. Kundel names the Codex app, VS Code, Xcode and JetBrains integrations, as well as a plugin that lets Claude Code hand tasks to Codex or ask it to review code. These are different entry points into the same harness, rather than separate agent implementations built for each interface.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A message becomes thread activity and streaming events
At the protocol level, the application is the client and Codex App Server is the server. The client sends messages to perform actions and receives events describing what happens. To make that exchange concrete, Kundel builds an inspector that intercepts traffic between the real Codex app and its server, then opens the inspector in the app’s browser and sends a message.
The first inspection appears to include old buffered events, so he starts again. The fresh activity gives the reader a useful question to follow: which messages establish the work, and which carry its output? Kundel points out thread-start messages containing configuration and project context, configuration reads, and delta messages carrying streamed data. A response arrives through a sequence of events that a client can render as work progresses.
The protocol exposes considerably more than sending a prompt and collecting text. At the time of the talk, Kundel reports more than 120 client messages, with coverage that includes:
- Client setup: initialization and configuration specific to the application.
- Conversation and task control: thread modifications, turns and setting a goal for a custom version of goal mode.
- Application capabilities: listing plugins, searching files and modifying the filesystem.
This breadth lets a custom client use capabilities that already appear in the Codex app, including streaming and file search.
That specificity is also Kundel’s distinction from ACP. ACP is described as the more generic protocol; App Server exposes controls over individual parts of the Codex harness. It also supports sign-in with ChatGPT, so users of a third-party application can bring their own subscription and consume their Codex usage allowance.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Add instructions and tools without replacing the base
Developer instructions provide the first customization layer. They augment Codex’s existing system instructions, which are themselves available in the repository. The recommendation is to add application-specific guidance through this layer, preserving the prompt work OpenAI has done for individual models. The Codex app uses this approach for functionality that differs from the IDE extension or CLI.
Tools provide a separate way to extend what the agent can do. An integration can use MCP or directly define dynamic tools that expose its own functions. Direct tool definitions make application behavior available to the agent: the interface can supply operations beyond the harness’s existing capabilities.
Deferred loading changes how those tools enter the agent’s context. Rather than putting every additional tool into the prompt upfront, deferred tools can be found through tool search. The functions remain available, while their definitions need not all occupy the context window from the start. This is especially useful as an application adds more functions; the mechanism is discovery on demand, rather than a growing inventory injected into every conversation.
Other settings can vary per thread. A client can choose a model provider or model, and control sandbox permissions such as which network connections are available and which files the agent can modify. Instructions, tools and permissions therefore answer different questions: how the agent should behave, what application functions it can call, and what access it has while doing the work.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Ship the binary and bindings together
App Server comes in the same binary as the Codex CLI. An existing CLI installation can therefore start it, but the Codex app takes a more controlled packaging approach: it includes the binary in its application bundle and updates that binary with the app. On Windows, it ships both Windows and Linux builds, selecting the Linux binary for WSL mode and the Windows binary for native operation.
The reason to bundle it is version alignment. App Server can generate TypeScript bindings or a JSON schema for a particular version, and the protocol changes between versions. Shipping the binary you built against keeps the client’s expected capabilities aligned with the server’s actual capabilities. Relying on a user’s installed CLI leaves that pairing dependent on when the user last updated.
The available integration choices solve different parts of the job:
- Transport: the server supports standard input/output (
stdio) and WebSockets. Kundel leaves the choice to the application’s use case rather than prescribing one transport for everyone. - Python SDK: the SDK handles much of the lifecycle management and makes features such as sign-in with ChatGPT easier to integrate through a familiar interface.
- A custom client: developers can implement the protocol directly, including by asking Codex to build against its documentation.
Kundel’s own example is a Visual Basic client intended to feel native on Windows, which he says Codex built largely in one shot. It illustrates how reusing the harness can shift effort toward the application and its interface. That is a personal implementation result, rather than a measured guarantee about how quickly every client can be built.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Doom becomes a client—and tools change the game
A client does not have to be a conventional chat window. The agent might run in the background, respond to an interaction in an existing application, or appear inside a video game. Kundel takes the last option literally: “How can I shove this into video games?” His experiment runs Codex inside Doom.
After a brief window and control-capture problem associated with the dual-monitor setup, the demo works. The client is an Electron app using Cloudflare’s Doom WASM renderer. Most of the game engine is implemented in C, and it loads Freedoom with a game file that Codex has modified. The agent interface renders through the game engine itself, and interaction is passed to App Server using Electron’s IPC mechanism. Saying hello produces a Codex response inside the game.
The more revealing question is what happens when the conversation can change the game. Dynamic tools expose game functions to Codex. Requests for health and armor cause tool calls that grant them; a request for weapons and ammunition triggers further tool calls. The interface displays the conversation, while the tools give that conversation an effect on game state. These requests turn the earlier discussion of application-specific functions into a concrete example.
The same client still connects to an App Server running on Kundel’s machine. When he asks, “What’s the directory?”, Codex calls a shell, retrieves the current working directory and renders the result in the game. Game tools have been added alongside the harness’s local workspace capabilities. You could do coding work inside Doom, though Kundel’s practical verdict is that the Codex app is probably a better place for it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Use codex exec for scripts, App Server for client control
codex exec offers another entry point into Codex: a non-interactive command for starting tasks from scripts. Kundel gives a CI/CD workflow that automatically fixes a pull request as an example. When the surrounding system needs to kick off a task, a scripted command can be a suitable integration.
App Server becomes more useful when the application needs a comprehensive agent interface or many concurrent threads. An evaluation harness, for example, can start multiple threads through the protocol instead of building its own orchestration around separate codex exec calls. Goal functionality is another reason to use the richer interface. The distinction is the amount of harness control the application needs, including thread creation and task management.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Three decisions that keep the integration manageable
The closing advice returns to three implementation decisions, each addressing a different source of trouble:
- Bundle your own harness version. Experimental features can change, and users may have older CLIs without the features your client expects. Bundling makes the supported version a choice the application controls.
- Expose application functions, then mark them deferred. The Codex app itself exposes functions for actions such as creating automations. Tool search keeps added functions available without putting their full inventory into the context unnecessarily.
- Start with developer instructions. Replacing the base system prompt gives up the model-specific tuning already built into the harness. Adding instructions lets the application customize behavior while retaining that work.
The prompt warning is substantive. Kundel describes ongoing work to keep prompts in distribution and the agent performing well. Writing a replacement system prompt means taking responsibility for those concerns yourself. The recommended starting point is to retain the tuned base and add the instructions and functions that make the new application useful.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Full transcript
Loading transcript…