Three ways to embed the Codex agent loop in your app

OpenAI wants developers to treat the open-source harness behind the Codex app, CLI and IDE extension as a runtime for their own products. In an August 21 post on OpenAI’s developer blog, the company describes three ways to integrate it and shows a sample operations app, Relay, that puts the agent next to a shipment dashboard instead of in a chat window.
The harness is the execution layer around the model. OpenAI’s list of what it does: it helps the model gather context, reason through tasks, call tools, stay inside configured boundaries, ask for approval and carry work forward. On the engineering side it manages conversation state, streams execution, enforces the configured sandbox and approval policies, and keeps work going across turns. The post argues this layer affects results on its own. On ARC-AGI-3, retained reasoning plus context compaction lifted GPT-5.6 Sol’s score from 13.3% to 38.3% and cut output tokens sixfold, with the model staying the same. Compaction here means summarising older context so a long session stays inside the window.
OpenAI’s pitch follows from that: “If you are building software that needs an agent, you can start with Codex instead of inventing a new runtime, then decide what the surrounding application should own.”
The surface for this is Codex app-server, which exposes the harness through a documented client protocol. A client creates threads, starts turns, receives events and handles approval requests, and the application talks to a local Codex process. Codex’s own terminal UI already runs as a client of this protocol. Release 0.135.0 moved TUI config and plugin state onto APIs owned by app-server and made /status show remote connection details, and 0.153.x made TUI sessions reconnect after an external app-server connection drops, with drafts and transcripts kept. The protocol keeps growing: it now has an experimental thread/revert request for rolling a thread back to an earlier turn.
The post sorts integrations into three layers by how much control the host application needs:
codex execfor scripts, CI jobs and one-off background tasks: it runs a bounded agent workflow and returns structured output.- The official Codex SDK for application code that needs to start, resume or stream Codex tasks through a programmatic interface.
- App-server when the agent is part of the product: the application keeps conversations open, streams events, interrupts work, exposes tools and answers approval requests.
OpenAI draws the line between the last two this way: the SDK simplifies common programmatic workflows, while app-server gives product teams direct control over the lifecycle and the user experience.
The CLI, app-server and the official SDK are all published as open source, and an open-source components guide lists where each one lives. The open layer stops there. “Model access and managed services remain separate,” the post says. With the harness code available, the host application controls three things, as OpenAI lists them. First, the interface: existing dashboards, editors, queues, maps, records and approval flows stay in place. Second, context and tools: the app decides which systems, documents, data and actions to expose, including MCP services it runs itself. Third, operational boundaries: where the agent runs, which files and tools it can reach, which actions need approval, how work is observed and how results get back to the system of record.
Relay shows how those pieces fit together. It is a sample app built on app-server, running on fictional seeded data. The user doesn’t write a prompt. They pick a shipment and click an action such as Compare recovery. The application supplies the context for that shipment, Codex pulls the latest sample operational data through the app’s own MCP tools, and the agent explains the options. Rebooking a shipment counts as a consequential write, so it waits for human approval. Once a tool changes the underlying record, Relay refreshes its business view. The harness handles the agent loop, conversation state, streamed activity and tool calls, and the product keeps its dashboard, records and controls.
The post sketches the same pattern for other jobs. A security analyst gets an investigation queue, recent alerts, affected services and an approval step before a remediation ticket opens. A support engineer gets account history, product logs, internal docs and a draft reply. A product team gets a task board where moving an issue to a ready state kicks off a scoped implementation workflow. OpenAI also lists incident response, account operations and research workflows as places Relay’s pattern could apply.
OpenAI names a few public implementations. GitHub and JetBrains bring Codex into existing IDE workflows, and Cisco uses the Codex SDK in App Builder inside Cisco Cloud Control. The one example outside software comes from tax preparation: Thrive Holdings and Crete use Codex in a workflow that takes in practitioner feedback. Their pilot processed 7,000 returns and cut preparation time by about a third.
Up next
Computer use goes GA on the Claude Platform, Video
Claude now takes several actions per turn, click, type, key, screenshot, instead of one per round trip. Early-access customers saw 20–40% fewer round trips per task with computer use, now generally available.
Related stories
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

