Last updated: November 27, 2026
The OpenAI Agents SDK Codex provider is an opt-in Python model provider in the 1.0.0 alpha wheels. Passing RunConfig(model_provider=CodexProvider()) runs embedded Codex Core inside your process, while the Runner keeps your tools, handoffs and approvals. Alpha.2, released November 23, 2026, adds resumable approvals, tool hooks and text redaction.
Contents
- What changed in the 1.0 alpha
- Release at a glance
- How to install and run the Codex provider
- New in alpha.2: resumable approvals, hooks and redaction
- Codex provider versus the default provider and codex_tool
- Limitations to plan around
- Frequently asked questions
What changed in the 1.0 alpha
OpenAI published Agents SDK v1.0.0-alpha.1 for Python on November 20, 2026. It is the first preview from the feat/simple-codex branch and adds Codex as an opt-in model provider (alpha.1 release notes).
The wheel embeds unmodified Codex Core rust-v0.166.0 through PyO3. Direct calls to Core eliminate codex app-server startup and JSON-RPC (alpha.1 release notes). You do not need a separate Codex CLI installation (Codex provider guide).
The design keeps the familiar SDK loop. The Python Runner manages the agent loop, function tools, handoffs, approvals, guardrails and output validation, and Codex supplies the model connection and native workspace tools (Codex provider guide).
Alpha.2 followed on November 23, 2026 with cross-worker recovery of conversations and pending approvals, tool execution hooks, Runner text redaction and detailed operation tracing (alpha.2 release notes).
Release at a glance
| Item | Detail |
|---|---|
| Latest preview | v1.0.0-alpha.2 (November 23, 2026), wheel version 1.0.0a2 |
| Distribution | GitHub Releases only, hash-pinned wheels |
| Python | Standard CPython 3.10 to 3.14 |
| Platforms | Linux x86-64 and ARM64 (glibc 2.28+), macOS 11+ on Apple silicon, Windows x64 |
| Embedded runtime | Codex Core rust-v0.166.0 via PyO3 |
| Import | from agents.models.codex import CodexProvider |
| Provider options | cwd, config_overrides, api_key |
| Authentication | Saved Codex login under CODEX_HOME (default ~/.codex) or API key |
| Stable line on PyPI | openai-agents 0.26.0 (November 24, 2026) |
Details come from the release notes (alpha.2) (alpha.1), the provider guide (docs) and the 0.26.0 release (v0.26.0). Neither lists separate pricing.
How to install and run the Codex provider
- Create a fresh virtual environment with standard CPython 3.10 to 3.14.
- Open the alpha.2 release, download
SHA256SUMSand the wheel for your platform, and confirm the digest withsha256sum,shasum -a 256orGet-FileHash(provider guide). - Install it with
python -m pip install --only-binary=:all: "WHEEL_FILE". In a repository checkout, useuv pip install --reinstall-package openai-agents "WHEEL_FILE"and run examples withuv run --no-syncso a sync does not replace the wheel. - Authenticate. Run Python under the same account and
CODEX_HOMEyou used forcodex login, or passCodexProvider(api_key=...)from your secret store. Python needs write access to that directory. - Select Codex per run:
config = RunConfig(model_provider=CodexProvider()), thenawait Runner.run(agent, "...", run_config=config). - If your only credential is a Codex login, disable hosted tracing with
tracing_disabled=TrueorOPENAI_AGENTS_DISABLE_TRACING=1, because the tracing exporter needs its own OpenAI credentials. - Close the provider with
await provider.aclose()when your application finishes.
The guide’s test script runs one calculator agent with either provider. Both runs should print square called with 12 and answer 144 (provider guide). An explicit model object, such as OpenAIChatCompletionsModel, keeps handling inference unless RunConfig.model overrides it.
For unattended, read-only jobs, the guide shows CodexProvider(config_overrides=('approval_policy="never"', 'sandbox_mode="read-only"')). Commands that need more permission then fail, while SDK tool approvals still use the Runner’s human-in-the-loop flow.
New in alpha.2: resumable approvals, hooks and redaction
Alpha.2 targets teams that run agents on queues or multiple workers (alpha.2 release notes).
- ResumableSession. Persists conversation history and pending approvals together. Supply a
ResumableSessionStorewith atomic conditional writes or useRedisSessionStore. - Worker handoff. On a replacement worker, call
ResumableSession.resume(store, session_id)andsession.load_state(agent), rebuild the config with matching tools, hooks and redactor, approve or reject the interruption, then callRunner.runagain. - Native approval recovery. Supports one pending direct
exec_commandorapply_patchapproval in one local environment, with the same workspace path and permissions. - Tool hooks.
RunConfig.tool_executiontakes aToolExecutionConfig. Experimentalprepare_tool_inputedits arguments before approval,prepare_tool_outputedits results, andprepare_tool_declarationchanges or withholds function declarations. - Redaction and tracing.
RunConfig.redact_textapplies your callback to model input, replies, streams and saved state.tracing={"operation_detail": "metadata"}or"content"controls span detail, and an[opentelemetry]extra exports spans through your tracer provider.
Plan the upgrade order. Alpha.2 reads alpha.1 RunState schema 1.22 but always writes schema 1.24, and alpha.1 cannot read the new snapshots. Upgrade checkpoint readers before writers.
Codex provider versus the default provider and codex_tool
| Need | Best option | Notes |
|---|---|---|
| Keep current model, delegate one workspace task to Codex | codex_tool |
Experimental tool; the agent’s own model stays in charge |
| Run the whole agent on Codex | CodexProvider |
Native commands and edits follow Codex sandbox and approval settings |
| Hosted Responses tools such as file search or code interpreter | Default provider | Not supported through Codex |
| Sampling controls or output-token limits | Default provider | Unsupported settings raise an error with Codex |
| Mix Codex with LiteLLM or other adapters | MultiProvider |
Codex does not wrap LiteLLM or any-llm clients |
The table follows the provider guide’s integration and limits sections (provider guide). Earlier hosted work, such as automatic review and scheduled automations, is covered in our OpenAI Agents API guide, and long-running Responses jobs in our OpenAI background mode guide.
If you drive Codex from a terminal rather than Python, see our Codex CLI 0.172 guide. For other Python agent frameworks, compare our Pydantic AI 2.75 guide and CrewAI artifacts guide.
Limitations to plan around
- It is a prerelease. The guide warns that a passing CI run and checksums do not establish release approval, and that wheels should come only from the SDK’s GitHub Releases page.
- Each Runner request gets a fresh, ephemeral Codex thread. Keep history in an SDK session or pass
result.to_input_list()to the next run. - PDFs, uploaded files, hosted file IDs, stored response IDs and prompt IDs are unsupported. Raw
role="system"messages are rejected; useAgent.instructions. - Remote image URLs are not fetched. Supply an absolute local path, a
file:URL or a data URL. - Cancellation and output guardrails do not roll back native commands. After a crash or partial edit, inspect and reconcile the workspace before retrying.
The stable 0.26.0 release was mainly bug fixes (v0.26.0 release notes); current versions are on PyPI.
Frequently asked questions
What is the Codex provider in the OpenAI Agents SDK?
It is an opt-in model provider, CodexProvider, added in the Python Agents SDK 1.0.0 alpha. You pass it in RunConfig so Codex Core, embedded in the wheel, handles model calls and native workspace tools, while the Python Runner keeps managing tools, handoffs, approvals, guardrails and output validation.
How do I install OpenAI Agents SDK 1.0.0-alpha.2?
The alpha is published only on GitHub Releases, not PyPI. In a fresh CPython 3.10 to 3.14 virtual environment, run pip install with –only-binary=:all: and the hash-pinned wheel URL for your platform: Linux x86-64, Linux ARM64, macOS 11+ on Apple silicon, or Windows x64.
Do I need the Codex CLI or an API key?
No Codex CLI installation is needed, because the wheel bundles Codex Core. The provider can use your saved Codex login under CODEX_HOME, which defaults to ~/.codex, or an API key passed as CodexProvider(api_key=…). Tracing and compaction clients still need their own OpenAI credentials.
Which Responses API features does CodexProvider not support?
The provider guide lists hosted file search, code interpreter, image generation, computer use, container shell and hosted connectors as unsupported, along with stored response IDs, raw system messages, sampling controls and output-token limits. Unsupported settings raise an error.
Is the stable openai-agents package on PyPI affected?
No. PyPI still serves the 0.x line, with 0.26.0 released on November 24, 2026 as a bug-fix release. The Codex provider exists only in the 1.0.0 alpha wheels on GitHub, so keep production on the stable release for now.
Sources
- GitHub: Agents SDK v1.0.0-alpha.2 release notes
- GitHub: Agents SDK v1.0.0-alpha.1 release notes
- GitHub: Codex provider guide (docs/models/codex.md, v1.0.0-alpha.2)
- GitHub: openai-agents-python v0.26.0 release notes
- PyPI: openai-agents package
Featured image: OpenAI logo, public domain, via Wikimedia Commons. OpenAI and Codex are trademarks of OpenAI. FreeAnswers is not affiliated with OpenAI.
Related guide: Mastra 1.86 guide: durable agents, channel tools and Knowledge importers.
1 thought on “OpenAI Agents SDK Codex Provider: Power-User Guide to the 1.0 Alpha, Approvals and Limits”