---
title: "Unlocking the Codex harness: how we built the App Server"
description: "The Codex App Server is a bidirectional JSON-RPC protocol over stdio (JSONL), plus a long-lived process that hosts Codex core threads."
url: "https://swe.quest/articles/unlocking-the-codex-harness-how-we-built-the-app-server-3ac987fd7baeae92"
canonical: "https://openai.com/index/unlocking-the-codex-harness"
source: "OpenAI"
published: "2026-02-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 14
tags: ["ai-agents","api-design","ai-coding","system-design"]
---

# Unlocking the Codex harness: how we built the App Server

A post on [OpenAI](https://swe.quest/sources/openai.md), published 2026-02-04, 14 min read, Case study. Original: [https://openai.com/index/unlocking-the-codex-harness](https://openai.com/index/unlocking-the-codex-harness)

## Summary

The Codex App Server is a bidirectional JSON-RPC protocol over stdio (JSONL), plus a long-lived process that hosts Codex core threads. It exposes one agent harness to the CLI, VS Code, the desktop app, web, and partners such as JetBrains and Xcode. It grew out of a VS Code integration after exposing Codex as an MCP server proved awkward. The protocol is built on three primitives: items (with started, delta and completed lifecycles), turns and persisted threads. It adds an initialize handshake for versioning and server-initiated approval requests that pause a turn. Clients run it as a pinned child process locally or inside containers for Codex Web, rely on backward compatibility to upgrade the server independently, and can generate TypeScript types or a JSON Schema from the Rust protocol.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)

## Prerequisites

- JSON-RPC ([easy posts on RPC & gRPC](https://swe.quest/tags/rpc.md?difficulty=easy))
- LLM coding agents ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- client-server streaming protocols ([easy posts on Stream processing](https://swe.quest/tags/stream-processing.md?difficulty=easy))

## Keywords

Codex, Codex App Server, JSON-RPC, MCP, VS Code, Xcode, JetBrains

## Related posts

- [Harness engineering: leveraging Codex in an agent-first world](https://swe.quest/articles/harness-engineering-leveraging-codex-in-an-agent-first-world-2c11ac81997bc6aa.md): OpenAI · 2026-02-11 · Medium · 14 min read · AI for coding, AI agents, Developer productivity, Static analysis, Observability
  A small OpenAI team built and shipped an internal product of roughly a million lines over five months with zero manually written code, merging about 1,500 Codex-authored PRs at around 3.5 PRs per engineer per day, an estimated 10x faster than writing it by hand.
- [Unrolling the Codex agent loop](https://swe.quest/articles/unrolling-the-codex-agent-loop-9f9b82453a544efc.md): OpenAI · 2026-01-23 · Medium · 16 min read · AI agents, AI for coding, LLMs, Developer tools
  Codex CLI's agent loop repeatedly sends a prompt to the Responses API, executes any tool calls the model requests, and appends their outputs until the model returns an assistant message that ends the turn.
- [Building the Agent Host Protocol for sessions that continue across devices](https://swe.quest/articles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices-588952b6d83cc2ec.md): GitHub Engineering · 2026-11-17 · Medium · 7 min read · AI agents, API design, AI for coding, Distributed systems, Developer tools
  The Agent Host Protocol (AHP) is an open standard that lets multiple clients (VS Code, the Copilot app, mobile apps, custom tools) share the same long-running agent sessions, so work started on one device can continue on another.
- [Four minutes after midnight, Codex said the page was live](https://swe.quest/articles/four-minutes-after-midnight-codex-said-the-page-was-live-25ae19da11733480.md): Render · 2026-08-16 · Medium · 9 min read · AI for coding, AI agents, Code review, Developer productivity
  OpenAI's Dominik Kundel argues that with agentic delegation, code is no longer the bottleneck.
- [How two engineer side projects became the agent taking action inside Dropbox](https://swe.quest/articles/how-two-engineer-side-projects-became-the-agent-taking-action-inside-dropbox-2abfc90167ee3b16.md): Dropbox Tech · 2026-11-05 · Medium · 10 min read · AI agents, Sandboxing & isolation, Virtualization, Identity & auth, System design
  Dropbox's file-acting agent grew out of two engineer prototypes, a server-side sandbox with installed software and a desktop chat UI with permission controls, merged into one system.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
