Agents SDK v1.0.0-alpha.2
Highlights
- Resume conversations and pending approvals across workers with Responses or Codex.
- Recover supported native Codex command and edit approvals.
- Configure tool execution hooks and filter available function tools.
- Opt into Runner text redaction and detailed operation tracing with either provider.
- Upgrade checkpoint readers before writers. Alpha.2 introduces new persisted state formats.
Install
This GitHub-only preview bundles openai-agents and the native Codex runtime.
Activate a standard CPython 3.10–3.14 virtual environment, then run the single command for your platform. Pip verifies the downloaded wheel against its SHA-256 hash from the release's SHA256SUMS file before installing it.
Linux x86-64 (glibc 2.28+)
python -m pip install --only-binary=:all: "https://github.com/openai/openai-agents-python/releases/download/v1.0.0-alpha.2/openai_agents-1.0.0a2-cp310-abi3-manylinux_2_28_x86_64.whl#sha256=1c073472688dfae9ed4b082ad4be3451ceb2cf7913bfb56b1a9af258b63cdf7b"Linux ARM64 (glibc 2.28+)
python -m pip install --only-binary=:all: "https://github.com/openai/openai-agents-python/releases/download/v1.0.0-alpha.2/openai_agents-1.0.0a2-cp310-abi3-manylinux_2_28_aarch64.whl#sha256=fd879e9f013173af52e60a2706133633ef4d1edf6ae1b5899e2f022a26aaba73"macOS 11+ (Apple silicon)
python -m pip install --only-binary=:all: "https://github.com/openai/openai-agents-python/releases/download/v1.0.0-alpha.2/openai_agents-1.0.0a2-cp310-abi3-macosx_11_0_arm64.whl#sha256=4a86bf3c2ffd9018ec05bc3744a3f00898b019007922d0a0640864e4b704129f"Windows x64
python -m pip install --only-binary=:all: "https://github.com/openai/openai-agents-python/releases/download/v1.0.0-alpha.2/openai_agents-1.0.0a2-cp310-abi3-win_amd64.whl#sha256=a1b5d648ee998c755f792128c9066260eb8a5ff4c050d1812986834baaf4579f"To get started, see the Codex examples guide.
Upgrading from v1.0.0-alpha.1
- Alpha.2 reads alpha.1
RunStateschema 1.22 and always writes schema 1.24, even with redaction disabled. Alpha.1 cannot read new snapshots. - Protected
ResumableSessioncheckpoints use version 2.
Sessions and approvals
- Use
ResumableSessionto persist conversation history and pending approvals together. Supply aResumableSessionStorewith atomic conditional writes or useRedisSessionStore. Protect checkpoint storage and allow one writer per session. See the session guide. - On a replacement worker, call
session = await ResumableSession.resume(store, session_id)andstate = await session.load_state(agent). Recreateconfigwith the appropriate model provider, matching tool declaration and authorization policy, hooks, and redactor. UseCodexProviderfor pending native Codex approvals. Approve or reject the original interruption throughRunState, then continue withawait Runner.run(agent, state, session=session, run_config=config). - Native Codex recovery supports one pending direct
exec_commandorapply_patchapproval in one local environment. Restore the same workspace path, permissions, and required hooks. Affected files must match their saved state. Missing required SDK tools or hooks leave approvals pending. Managed native hooks can also stop approval recovery. Keep required hooks enabled. Restored native results enter the conversation's replay history. See the native approval example. - After failure or worker loss, inspect the checkpoint and workspace. Reconcile partial edits and other external effects before retrying. Recovery cannot restart terminated commands or recover alpha.1 approvals that ended the model call.
Tool execution
- Configure
RunConfig.tool_executionwithToolExecutionConfig. Experimentalprepare_tool_inputmodifies arguments before approval and execution.prepare_tool_outputmodifies results after execution. Both support SDK tools with either provider and hooked native Codex tools. Responses-hosted tools execute outside these callbacks. - Use
prepare_tool_declarationto change or withhold supported function declarations. The Runner rechecks eligibility before execution, including after approval. See the tool hooks example. - With input or output hooks configured,
sdk_only_tool_hooks=Truedisables native Codex workspace tools and their approval recovery. - Embedded Codex Core
rust-v0.166.0includes a patch blocking native dispatch when any synchronousPreToolUsehandler fails or times out. After approval, the replacement worker runs configuredon_tool_startcallbacks and reuses the approved input without applyingprepare_tool_inputagain. Asynchronous notifications and output hooks cannot prevent an action already started. See the required tool hooks patch. - When the manager run is cancelled, active
Agent.as_tool()calls get up to 250 ms to clean up. Repeated cancellation does not reset the deadline. Tools that exceed the timeout may continue running and cause side effects or state changes after cancellation returns. #6130
Redaction and tracing
- Opt into
RunConfig.redact_textwith your own synchronous callback. It changes recognized text sent to the model and SDK tools, replies, streams, and persisted state. Supply the same callback when continuing protected sessions. Protected runs withhold raw stream events and restrict automatic traces to metadata. Binary media and native Codex operations remain outside its protection. See the redaction guide. - Use
RunConfig(tracing={"operation_detail": "metadata"})for operation metadata with either provider. Set"operation_detail"to"content"to capture bounded model inputs and outputs, tool arguments, and available results. Model retries add events to the same model span. - Default SDK tracing can expose native Codex results, including file contents, through returned responses or replayed history. Set
RunConfig(trace_include_sensitive_data=False)to suppress sensitive trace payloads in every mode. UseRunConfig(tracing_disabled=True)to disable SDK tracing entirely. - Install the verified wheel with its
[opentelemetry]extra and useOpenTelemetryTracingProcessorto export SDK spans through your application's tracer provider. OpenTelemetry exports payloads only in"content"mode. See the OpenTelemetry setup.