openai
Codex harness goes managed in the new Agents API
Promtime
openaiOpenAI has opened the Codex harness to outside applications through the Agents API, a managed service in which sessions, orchestration, context compaction and recovery are handled on the vendor side. The calling application supplies the tools and chooses the execution environment, according to OpenAI.
At a glance
- Agents work inside a sandbox where they run code, edit files, connect to MCP servers and produce artifacts, while the harness applies skills and resumes a session where it left off.
- Sessions are configured in one call: OpenAI's sample enables programmatic tool calling, an MCP server, web search and multi-agent mode with a cap of four concurrent subagents.
- Billing reuses existing rates for models, OpenAI tools and hosted containers, but data residency covers only the United States and Zero Data Retention is not supported.
Agent frameworks have mostly been assembled in-house: a loop, a context strategy, a retry policy. Handing that stack to OpenAI reads as an attempt to make the Codex runtime the default substrate for third-party agents, with tool choice and sandbox placement left to the customer. The residency and retention limits likely narrow the addressable set, since regulated buyers often require Zero Data Retention.
Four concepts define the API, and the session is the durable one
An agent is the model, instructions, tools and MCP servers available to it, and an environment is an optional sandbox or computer where the agent reaches files, loads skills and runs commands. A session is a durable instance of an agent that works on tasks and responds to input.
Events and items are the inputs sent to an agent and the output produced during a session. In the quickstart flow the application creates a session, OpenAI provisions the environment, user input starts a turn, and progress arrives through streamed output or webhooks that fire when the agent finishes or needs input.
Session state is retained, so work continues across turns without rebuilding the conversation context. With an OpenAI-hosted session the application sends input and receives events while OpenAI runs the agent and provisions and manages its sandbox. A separate task can also be sent to the same session, or the agent can be steered mid-turn.
OpenAI's sample session enables four concurrent subagents and three tools
The managed harness runs commands and code in a sandbox, applies relevant skills and instructions, connects to external data through tools or MCP, accepts steering while it works, summarizes previous work to manage the context window, breaks work into subtasks for subagents and resumes a session where it left off.
In OpenAI's Python sample a session is created through client.beta.agents.sessions.create with the model gpt-6-astra, instructions to use the OpenAI documentation MCP server and web search, and multi-agent mode enabled with max_concurrent_subagents set to four. The declared tools are programmatic tool calling, an MCP server over HTTP and web search.
The environment in that sample is self-hosted, with a workspace directory and a capability directory that holds skills. Documentation lists the other option as an OpenAI-hosted sandbox, which the service provisions and manages, with setup and limitations described under environment options.
Five reference applications ship with the API, from incident response to SQL
OpenAI publishes five complete applications: an incident response agent that investigates alerts and requests approval for recovery actions, a Slack bot that investigates requests using connected workplace tools, a data analyst that answers warehouse questions with read-only SQL, a GitHub issue investigator that reproduces reported bugs and shares findings on GitHub, and a document reviewer that applies policy skills and specialist agents.
Two shorter examples cover creating and running a directory-tree script in an OpenAI-hosted sandbox, and comparing release notes with subagents whose findings are combined into one answer. Model usage is billed at the selected model's API rates, OpenAI tools at their standard rates and OpenAI-hosted sandboxes at standard container rates.
US-only residency and no ZDR
The Agents API currently supports data residency in the United States only and does not support Zero Data Retention, and choosing a self-hosted sandbox does not make it ZDR-eligible. Sessions and published artifacts can be deleted when they are no longer needed. No timetable for wider residency coverage is given, and the SDK path still sits under the beta namespace.
Comments
No comments yet. Be the first.
Join the conversation
Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.
We only use your name and avatar from Google. We never store your email address.
