Kundel describes two protocols: the app server connects a UI to the Codex harness, and the Responses API connects the harness to model inference. The app server also powers the Codex app and supports third-party projects, while compatible model providers can plug into the harness through the open Responses schema.
How Codex Works
Speaker
Dominik Kundel of OpenAI explains how the Codex agent harness works at AI Engineer World’s Fair, with examples for engineers building agents.
Context construction aims to control size, remain flexible, and support cacheability. Codex defers some tools until tool search is needed and caps the available skills list at 2% of the maximum context window, shortening descriptions when necessary.
Codex can delegate to subagents, keep background terminals running, and interact with a browser through JavaScript in a persistent Node REPL. For file work, models use apply patch and shell tools; filesystem actions run through platform-specific sandboxes, including Bubblewrap on Linux and Seatbelt on macOS.
To reduce approval fatigue without enabling unrestricted access, Codex uses a separate read-only review subagent when an action needs escalation. It considers the conversation, user authorization, and the action’s impact; deleting a file the user explicitly asked to remove may be approved, while uploading a file is treated differently from a basic connectivity check.
Kundel says network overhead became a bottleneck when inference ran at 1,000 tokens per second, so WebSocket mode sends changed items over a persistent connection. For long tasks, /goal injects continuation prompts until the model reports completion, and compaction carries necessary context into a fresh window.
Takeaways
- Keep context bounded: defer rarely used tools and limit how much skill description enters the prompt.
- Use persistent code execution for browser tasks that involve several pages or turns.
- Make approval decisions based on user authorization and action impact, with a separate reviewer that has read-only access.
- Measure network and tool-call overhead as well as model inference speed.
- Write goals that are concrete and verifiable so an agent can tell when the work is done.
Mentioned in this talk
Search inside this talk
What was claimed 9
- feature
Codex: Open source; MIT- and Apache 2.0-licensed
“the Codex harness and everything I'm showing you is open source. It's MIT- and Apache 2.0-licensed”
YouTube Unverified1 source· Talk
- integrates with
Codex integrates with Codex app server
“you can build on top of the Codex harness using the app server protocol”
YouTube Unverified1 source· Talk
- integrates with
Codex integrates with
OpenAI Responses API
“The second part is the Responses API, which handles communication between the harness and inference.”
YouTube Unverified1 source· Talk
- integrates with
Codex integrates with
Claude Code
“I even used that same app server to put Codex into Claude Code.”
YouTube Unverified1 source· Talk
- feature
OpenAI Responses API: Deferred tool loading through tool search, available since GPT-5.4
“Since GPT-5.4, you can mark any tool as deferred loading.”
YouTube Unverified1 source· Talk
- feature
Codex: Auto review assesses escalated actions against user authorization and risk
“we built auto review to cover actions that are harder to predict an agent might take”
YouTube Unverified1 source· Talk
- feature
OpenAI Responses API: WebSocket mode uses a persistent connection and sends only changed data
“This saves on network overhead and provides stateful context, which means we only have to send the data that actually changed.”
YouTube Unverified1 source· Talk
- feature
Codex: Automatically continues goal tasks until the model reports completion
“Until then, the harness will automatically inject this continuation prompt.”
YouTube Unverified1 source· Talk











