Building on the Codex Harness — Dominik Kundel, OpenAI

Dominik Kundel from OpenAI presents the Codex app server, an open-source JSON RPC protocol that enables developers to build customizable agent interfaces with fine-grained control over the Codex harness, supporting advanced features like dynamic tools and developer instructions. He highlights practical integration methods, showcases creative applications such as embedding Codex in Doom, and offers key tips for effective customization and deployment to encourage innovative use of the platform.

In this talk, Dominik Kundel from OpenAI introduces the Codex app server and how developers can build on top of the Codex harness to create custom agent interfaces. He begins by gauging the audience’s familiarity with building agent harnesses and the Codex app server, explaining that the app server is a JSON RPC protocol that wraps the Codex harness. This protocol enables deep integration and communication between client applications and the Codex harness, powering various first- and third-party interfaces such as IDE extensions and plugins. Importantly, both the Codex harness and app server are open source under the Apache 2 license, allowing developers to fork, customize, and connect them to other model providers.

Dominik demonstrates the flexibility of the app server by showing an inspector tool that intercepts real-time messages between the Codex app and the app server. These messages cover a wide range of functionalities, including thread management, file search, and streaming data. The protocol exposes over 120 client messages, enabling developers to configure initialization, modify threads, set goals, list plugins, and even manipulate the file system. Unlike more generic protocols, the app server offers fine-grained control over the harness, including model selection and sandbox permissions, making it highly adaptable for various use cases.

Customization is a key feature of the app server, with two main ways to tailor the agent: developer instructions and dynamic tools. Developer instructions allow augmenting the system prompt without replacing the carefully tuned base prompt, preserving the agent’s performance while adapting it to specific applications. Dynamic tools enable exposing additional functions to the agent, which can be loaded on demand to avoid cluttering the context window. This flexibility supports advanced scenarios such as integrating sign-in with ChatGPT subscriptions and controlling network or file access on a per-thread basis.

Dominik also highlights practical aspects of using the app server, noting that it is bundled with the Codex CLI and the Codex app itself, with binaries available for multiple platforms. Developers can spin up the app server using standard input/output or web sockets, depending on their needs. Integration is simplified by a recently released Python SDK that manages lifecycle and authentication, but developers can also leverage Codex itself to generate client code quickly. He shares a creative example of embedding Codex inside the Doom video game, showcasing how the app server can be used in unconventional environments to interact with the game and execute commands dynamically.

To conclude, Dominik offers three key tips for developers working with the app server: ship your own version of the harness to avoid compatibility issues, expose new functions as deferred tools to keep the context clean, and prefer appending developer instructions rather than rewriting the system prompt to maintain agent effectiveness. He emphasizes the app server’s advantage over Codex Exec for building interactive, multi-threaded clients and encourages experimentation and creativity in building unique interfaces. The session ends with an invitation to access the slides and engage further at the OpenAI booth.

Useful Links