Latest in AI
How to try Codex as a Python Agents SDK provider
Compare the default model provider with Codex in the Python Agents SDK alpha, using a read-only fixture and checks for tools, history and approvals.
If you already have an agent built with the Python Agents SDK, you do not have to rewrite its tool loop to try Codex. The SDK's November 20 alpha lets you select Codex for a single run. Python still orchestrates the agent, while embedded Codex Core handles model calls and can supply its native workspace tools.
Treat this as a compatibility experiment, not a production upgrade. Start with a small, read-only agent that can tell you exactly what changed when you switch the provider.
Choose the right integration
Use CodexProvider if you want Codex to handle an agent's model calls. That is different from giving a non-Codex agent one tool that delegates a particular workspace task to Codex. The versioned provider guide covers both paths.
Before trying the provider switch, check how the agent selects its model. A model name or the run's default is resolved by the provider. An explicit model object can continue handling inference unless the run overrides it. For a clean comparison, begin with an agent that does not set one.
Keep the alpha separate
Use a fresh virtual environment with standard CPython 3.10 through 3.14. The preview wheels are on the GitHub release, not PyPI. Pick the pinned asset for your platform: Linux x86-64 or ARM64 with glibc 2.28 or newer, Apple silicon on macOS 11 or newer, or Windows x64. Use the release's checksum-bearing asset link rather than substituting a package-registry version.
Keep the current deployment and its dependencies untouched. In the test project, use synthetic data and a known development workspace. A saved Codex login can authenticate the provider; it does not automatically authenticate a separate tracing or compaction client. Set up each service deliberately rather than assuming one successful login covers them all.
Compare the same read-only tool across both runs
Give an agent a Python lookup that returns a fixture inventory record and expose no write tools. Ask one question with a known result, such as whether a demo SKU is in the Pune warehouse. Verify that the recorded tool argument, returned record ID and final answer all agree. A plausible answer alone is not enough.
Use the same agent definition and input on both runs. For the Codex trial, pass RunConfig(model_provider=provider) to Runner.run(). Keep native execution read-only, and close the provider with await provider.aclose() when the application is done. OpenAI's versioned example shows how it checks the tool invocation and typed output in a synthetic workflow.
Vary the input once. Ask about an unknown SKU and make sure both runs return the lookup's unknown outcome rather than inventing a record. Compare observable behavior, not word-for-word phrasing.
Keep history in the SDK
Reusing the provider shares its thread manager, not a persistent Codex conversation. Each model call gets a fresh, temporary Codex thread. For follow-ups, use an SDK session so the Runner supplies conversation history.
Give each test provider its own session. In the second turn, say “What about the other warehouse?” and verify the agent retains the demo SKU from the first turn. Do not use a native Codex turn ID as a stored Responses ID.
Check the limits before a wider trial
Python tool approvals and native Codex prompts are separate. A native approval prompt fails the model call in this preview; it cannot be answered through the SDK's Python-tool approval path. Hosted tools such as Responses file search and code interpreter also are not equivalent to Codex workspace tools. Keep the existing provider for workflows that depend on those contracts.
If you tested the previous harness preview, finish pending native runs there. The new Runner does not resume the older SessionState checkpoints. Start with a fresh SDK session instead.
I'm Paras. I work at the intersection of AI, engineering and distribution.
I help AI teams turn SDK releases and migration decisions into technical writing and product stories developers can put to work.