OpenAI Put Codex Inside Its Agents SDK
OpenAI's Agents SDK alpha embeds the Codex harness — session loops, budgets, sandboxes — without a hand-built runtime. What changed, and the catches.
23 Nov 2026 · 6 min read · Hazentic Quantum
On 3 November 2026, OpenAI shipped an alpha of its Agents SDK with the Codex harness as the native engine. On 20 November, Python SDK v1.0.0-alpha.1 embedded Codex Core itself inside the Python process. The runtime behind Codex — the loop that calls the model, runs tools, manages history, and summarises context — is now something your application can use instead of something you build.
The runtime is the part of agent work nobody wants to write. The model call is easy; the loop around it — retries, tool routing, approvals, context that grows until it breaks — is where agent projects quietly drown. OpenAI now offers to own that loop. The question is what it costs to accept.
What actually shipped
The hosted Agents API entered public beta on 10 September 2026: one call creates a session — model, tools, MCP servers, subagents, sandbox — and OpenAI runs the loop. The SDK is the other half: the same ideas inside your application, where you control deployment, storage, and approvals.
On 3 November, the JavaScript SDK alpha (v0.22.0-alpha.1) made the Codex harness the native engine (the old engine kept as "Classic"); a Python preview (v0.24.0-alpha.7) followed on 8 November. The 8 November previews — Python v0.24.0-alpha.7 and JavaScript v0.22.0-alpha.2 — add application-side conversation storage, hosted FileSearch, CodeInterpreter and ImageGeneration tools, RunBudget limits (requests, tokens, or estimated cost), and A2A adapters between agents. The Python preview ships through GitHub Releases, not PyPI.
Then 20 November: Agents SDK v1.0.0-alpha.1 embeds unmodified Codex Core (rust-v0.166.0) through PyO3. Pass RunConfig(model_provider=CodexProvider()) to the Runner and calls route through Codex directly — no codex app-server startup, no JSON-RPC hop. The Runner keeps the loop, tools, handoffs, approvals, and guardrails; Codex supplies the model connection and native workspace tools.
What you stop building
If you have built an agent before, you know the checklist: a loop that calls the model and dispatches tools; history management, because a long session outgrows its context window; approvals before consequential commands; a budget, because a looping agent spends real money while you sleep; and somewhere safe to run code.
The harness covers all of that in one place — compaction, session storage, subagents, sandboxes, budget limits — instead of five libraries you wire together and debug at 2 a.m. It also adds scripted-response testing: try agent behaviour without a real model or API key, which is the difference between an agent you can test in CI and one you can only test by spending money and hoping.
The catches, in plain language
An alpha is an alpha, and this one has sharp edges. Read these before you build on it.
Interfaces will move. This is a preview, and the Python preview is not on PyPI yet. Budget time for breaking changes; do not build a client commitment on it. Moving from the 0.24 harness preview (v0.24.0-alpha.8) to v1.0.0-alpha.1, saved states do not carry over: checkpoint formats changed from SessionState to RunState, so users move to Runner.run() and start fresh.
There are now two approval systems, and they fail differently. Native Codex approval prompts are separate from SDK tool approvals, and the provider cannot answer a native one — it fails the model call. An SDK tool approval pauses the run through the human-in-the-loop flow, and you can resume it. Two stops that look alike in logs, with opposite outcomes.
Removing the server hop removes a boundary. Codex Core now runs inside your Python process, so hooks can see your application's environment, and shell_environment_policy does not restrict the runtime itself. Keep credentials out of the process environment.
Budgets are limits, not guarantees. RunBudget caps requests, tokens, or estimated cost, but it does not guarantee a spending cap. Treat it as a tripwire, not a promise your bill cannot exceed a number.
The hosted API has residency limits. It is still in public beta, keeps data in the US only, and is not eligible for Zero Data Retention. If your client needs EU data residency or a zero-retention guarantee, use the in-app SDK instead.
How this fits the agent landscape
This is not happening in isolation: Google donated Agent Substrate to the CNCF in the same month, and Anthropic's Claude Sonnet 5.5 (28 September) is the everyday model for coding and agentic work. The model is becoming the commodity; the runtime around it is where the real product lives.
The work shifts from choosing a model to architecture: where the loop runs, who holds the secrets, what the agent can touch without asking. Those decisions decide whether an agent survives real users — the same point as our piece on automation architecture that survives growth.
What to do this week
- [ ] If you run agents on OpenAI's SDK today, read the 3 and 20 November release notes on GitHub before upgrading.
- [ ] Pick a side: hosted Agents API (one call, US-only data, beta) or in-app SDK (you run the loop, you own the data).
- [ ] Audit your approval flow: native Codex and SDK tool approvals are two different things — log and handle them separately.
- [ ] Move secrets out of the process environment if Codex Core will run in-process — a secret the runtime can see is a secret a prompt injection can reach.
- [ ] Set a RunBudget on every agent and pair it with billing alerts.
- [ ] Planning an agent build and weighing the hosted API against the SDK? Contact us or look at our work.
FAQ
When did OpenAI add the Codex harness to the Agents SDK?
The JavaScript SDK alpha shipped 3 November 2026, a Python preview followed on 8 November, and v1.0.0-alpha.1 embedded Codex Core in-process on 20 November. All are alpha previews — and OpenAI made no blog announcement; details come from the GitHub release notes and independent write-ups.
Is the Agents SDK stable enough to build on?
Not yet. Interfaces change between alpha versions, the Python preview is distributed through GitHub Releases rather than PyPI, and sessions do not carry over. Pilot it; do not build a client commitment on it.
What is the difference between the Agents API and the Agents SDK?
The Agents API is OpenAI's hosted service: one call creates a session and OpenAI runs the loop, with US-only data and no Zero Data Retention in beta. The SDK runs the same harness in your application, where you control deployment, storage, and approvals.
Why do native Codex approvals fail the model call?
The Codex provider cannot answer native Codex approval prompts, so such a request ends the model call instead of pausing it. SDK tool approvals still pause through the Runner's human-in-the-loop flow. Handle the two cases separately.
Let’s find your bottleneck.
Tell us what is slowing the business down. We reply within one business day — with an honest answer, even if we are not the right fit.
Free website teardown · contact@hazenticquantum.com