Skip to main content
← Frameworks

OpenAI Agents SDK

OpenAI
Python Open source MIT Coding framework General-purpose harness guardrails MCP human-in-the-loop sandbox 8 axes checked Active Checked 2026-10-23

Read the two badges separately: the first is whether this page is backed by evidence, the second is whether the product is still maintained. An archived product can have complete evidence; complete evidence does not mean the product is active.

30-second check: should it make your shortlist?

In one line

"A primitives-only multi-agent harness" — the official description is "lightweight…

How you use it

Local / self-hosted · Framework / SDK

Licence / commercial use

Open licence

Read the original licence before commercial use
Mainland China

Direct in mainland · Not in filing list

These four cards help you rule things out, not decide for you. The real differences are in the eight questions and sources below.

Information not confirmed

  • A capability-alignment matrix across the 100+ providers
  • Regions, quotas, and billing of the hosted sandbox client (quotes not recorded per our price-recording policy)
  • Concurrent-write semantics of Sessions backends across multi-process/multi-machine
  • The real dependency footprint and upgrade conflicts of the litellm / any-llm extras

"A primitives-only multi-agent harness" — the official description is "lightweight yet powerful": it hands you the agent-loop primitives and does not decide for you how the filesystem, planning or memory work.

When to use it, when not to

Fits: you want a thin harness with built-in guardrails / human-in-the-loop, first-class MCP support, and a Python stack. Not a fit: a ready-made long-task workspace (use Deep Agents or the SandboxAgent route); a TypeScript ecosystem (use openai-agents-js).

China availability domestic / direct access / CAC filing · snapshot 2026-10-23

Origin
foreign-made foreign entity (no matching filing entity in the CAC registry).
Direct access
direct OK openai.github.io measured 200 direct; PyPI measured reachable.
CAC filing
not in filing list:not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

8 questions, one table

8 questions, each comparable item by item with its peers.

Model & openness

The official self-description is provider-agnostic. The official access statement is one sentence: the OpenAI two APIs are supported, and so are 100+ other LLMs.

Official wording: "It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs."

The implementation path has two layers of evidence:

  • The core dependency is openai>=3.0.0.
  • There are two optional extras, both non-OpenAI paths.

The two extras are litellm (openai-agents[litellm]) and any-llm (openai-agents[any-llm], requires Python ≥3.11).

The official models page gives the full access surface (verified). The official docs dedicate "Non-OpenAI models" and "Third-party adapters" sections.

Access points in those sections:

  • Built-in provider access points can point at OpenAI-compatible endpoints.
  • Plus Any-LLM / LiteLLM beta adapters.

Official example of the built-in access point:

MultiProvider(openai_base_url="https://openrouter.ai/api/v1")

Official adapter example:

anthropic/claude-3-5-sonnet

The LiteLLM page's wording: one interface to 100+ models, and any AI model can be used.

Official wording: "allows you to use 100+ models via a single interface ... use any AI model in the Agents SDK"

Switching providers = change the model (a string name / LitellmModel(...) / provider prefix).

⚠ But the official docs make no "zero-change" quantitative promise; per-vendor capability alignment needs testing.

Where it runs

You run the process yourself — it is a library, not a service.

All four run modes in the README are local code calls:

  • Runner.run_sync
  • RealtimeRunner.run
  • VoicePipeline.run
  • sandbox client

The only exception is SandboxAgent's hosted sandbox client — the official docs mention a hosted sandbox is available.

⚠ But that depends on OpenAI-side container services; it is not "the whole agent hosted".

Local files

Local-file capability explicitly exists, but not in the default agent.

For scenarios that "need to inspect files, run commands, apply patches, or preserve workspace state across longer tasks" the official docs provide SandboxAgent separately.

Official wording: SandboxAgent is preconfigured to work with a container to perform work over long time horizons

Its default_manifest can declare GitRepo(repo=..., ref=...).

Sandbox clients split by platform:

  • UnixLocalSandboxClient — macOS / Linux.
  • Windows must use DockerSandboxClient (requires the openai-agents[docker] extra).
  • Windows can also use the hosted sandbox client.

⚠ A practical selection note: Windows users cannot use the local Unix sandbox path directly.

Tasks after shutdown

Self-hosted = stop it and it's gone. The README has no hosted execution option (Realtime is a long connection, but the process stays in your hands).

Resuming after interruption has official support. The Sessions section states Official wording: "Automatic conversation history management across agent runs".

Optional backends include SQLite (SQLAlchemy dependency) and Redis (openai-agents[redis]).

SandboxAgent's default_manifest also targets Official wording: "preserve workspace state across longer tasks".

Tools & extensions

The tool surface is the four kinds the official docs list: functions, MCP, hosted tools, and agents as tools (calling other agents as tools).

The latter two sit alongside handoffs as core delegation mechanisms.

MCP is a core dependency, not optional. See the dependency declaration:

  • mcp>=1.19.0,<3 is in dependencies.
  • It is not in optional-dependencies — a first-class capability.

Guardrails are configurable. The official list includes "Configurable safety checks for input and output validation", split into input and output directions.

Context & memory

The official wording only has Sessions.

Official wording: "Automatic conversation history management across agent runs"

Optional backends include Redis (openai-agents[redis]) and SQLAlchemy (SQLAlchemy + asyncpg dependencies).

Note the divergence from our claim.

Sessions manages conversation history.

In our "state ≠ context" claim, measures like spilling large tool outputs to disk are user-built in this SDK.

SandboxAgent's sandbox workspace can play that role, but the official docs do not market it as a context-management layer.

Permissions & limits

Built-in Guardrails (input + output two-way validation) + Human in the loop (tool-level approval).

This is the most complete permissions surface we have seen built in so far. Two official lines:

Official wording: "Configurable safety checks for input and output validation"

Official wording: "Built-in mechanisms for involving humans across agent runs"

Mechanism details verified (official guardrails and human_in_the_loop chapters). Guardrails come in three kinds:

  • input — runs only on the first agent in the chain.
  • output — runs only on the agent producing the final output.
  • tool — wraps FunctionTool, validates before and after execution; can skip/replace/raise a tripwire.

The third kind's tripwire throws an exception and aborts immediately.

On the input side, run_in_parallel=False optionally intercepts before the agent starts.

Tool-level approval: needs_approval=True|callable works on function_tool, ShellTool, ApplyPatchTool, Agent.as_tool.

MCP servers use require_approval.

Approvals pause via run-wide interruptions; RunState is serializable/resumable. When arguments cannot be safely parsed it fails closed; always_approve can pin a decision.

⚠ State the boundary: the official docs have no built-in file/network sandbox.

guardrails are user-programmable validation hooks; the real sandbox boundary is left to the host machine or the SandboxAgent container, not the guardrail layer.

(guardrails, human_in_the_loop, and Sandbox agents pages checked.)

This contrasts sharply with Deep Agents' "trust the LLM, boundary responsibility is yours".

Best for

Fits:

  • You want a "thin harness" and choose everything beyond the agent loop primitives yourself.
  • You need guardrails and human-in-the-loop built in.
  • You need first-class MCP support and your team is on Python.

Does not fit:

  • You want a batteries-included long-task workspace.
  • You are in the TypeScript ecosystem (use openai-agents-js).

Both "does not fit" items have alternative routes: for the long-task workspace use Deep Agents, or take this SDK's SandboxAgent route.

Licence and terms of use

MIT

Top misconception

  • Reading "provider-agnostic" as "switching providers costs nothing" — the docs promise 100+ without a quantified guarantee; this site marks it unverified
  • Assuming SandboxAgent works out of the box on Windows — the local path is only UnixLocalSandboxClient (macOS/Linux); Windows needs Docker or hosted
  • Assuming Guardrails work as a permission boundary — they are input/output validation, not a sandbox boundary; they address different risk types
  • Assuming this is an official shell around OpenAI's closed-source SDK — it is itself an MIT-licensed framework, and the official docs state they are "committed to continuing to build the Agents SDK as an open source framework"

Evidence sources

Checked 2026-10-23,Content updated 2026-09-30。This is the date of the entry, not a claim that every field was rechecked that day.

TypeNameLink
repoOpenAI Agents SDK · repository (Python)https://github.com/openai/openai-agents-python
docsOfficial docs homepagehttps://openai.github.io/openai-agents-python/
docsModels (provider-agnostic, Non-OpenAI models, Any-LLM / LiteLLM adapters)https://openai.github.io/openai-agents-python/models/
docsUsing any model via LiteLLM ("use any AI model", 100+ models)https://openai.github.io/openai-agents-python/models/litellm/
docsSandbox agents (official dedicated chapter)https://openai.github.io/openai-agents-python/sandbox_agents
docsGuardrails (official dedicated chapter)https://openai.github.io/openai-agents-python/guardrails/
docsHuman in the loop (official dedicated chapter)https://openai.github.io/openai-agents-python/human_in_the_loop/
docsSessions (official dedicated chapter)https://openai.github.io/openai-agents-python/sessions/
docsSandbox clients (platform differences and the hosted client)https://openai.github.io/openai-agents-python/sandbox/clients/
repoAgents SDK JS/TS (separate repo, MIT, 3,935★, rolling verification 2026-10-23)https://github.com/openai/openai-agents-js
changelogReleases (0.22.3 @ 2026-09-17)https://github.com/openai/openai-agents-python/releases

Test notes

This site has not completed measured runs. The test protocol is at protocols/framework/_protocol.md.

Suggested runs (tailored to this SDK within the harness section's five dimensions):

#What to testWhy it is worth testing
1How many files and lines for a minimal hello agentofficially called lightweight — verify just how "thin"
2Can Guardrails block an over-reach like "read a file"officially positioned as input/output validation, not file-access permission
3Minimal usable path of SandboxAgent on Windowsthe official example is Unix; Windows needs Docker
4How much changes when switching to litellm / any-llm with a local modelofficially provider-agnostic — verify the real diff size
5After killing the process, does Sessions restore state completelyour biggest "reliable long-running" concern

Provider-agnostic is in the official first paragraph

The official first paragraph puts this up front:

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs.

This is our first decision point. The code-level evidence agrees:

  • Core dependency openai>=3.0.0.
  • Two optional extras litellm and any-llm, as non-OpenAI paths.

⚠ But state the boundary: "100+" is an official claim; we have not measured the capability alignment of specific providers.

Tool calling, structured output, and multimodal support vary a lot across vendors.

Versus Deep Agents: the table our readers most need to see

Both sit in the Python agent-harness tier, with completely opposite styles:

DimensionOpenAI Agents SDKDeep Agents
Styleprimitives-only, thinbatteries-included, thick
filesystemnot preset (wire your own, or use SandboxAgent)core selling point, pluggable backends
subagentsagents as tools / handoffs (build them yourself)preset sub-agents
context managementonly Sessions (conversation history)summarize + disk spill + cross-session memory
permissionsbuilt-in guardrails + human-in-the-loopofficially "trust the LLM"; boundaries are yours
run formyou run it (local/container/Redis)you run it

Selection rule: want security built in → the former; want features built in → the latter.

SandboxAgent: the official answer for local files — with a Windows pitfall

A plain Agent carries no local workspace. For this the official docs provide SandboxAgent:

Use a SandboxAgent when the agent needs to inspect files, run commands, apply patches, or preserve workspace state across longer tasks.

Its default_manifest can declare repositories to check out:

agent = SandboxAgent(
    name="Workspace Assistant",
    default_manifest=Manifest(
        entries={"repo": GitRepo(repo="openai/openai-agents-python", ref="main")}
    ),
)

⚠ Platform differences are selection-critical:

ClientSupported platformsNote
UnixLocalSandboxClientmacOS / Linuxthe README example uses it
DockerSandboxClientWindows etc.requires the openai-agents[docker] extra
hosted sandbox clientdepends on OpenAI-side servicesofficially mentioned as available

Windows users cannot take the local Unix sandbox path directly.

The permissions surface: the most complete built-in scheme we have seen

Officially providedSection
Guardrails (input + output two-way validation)"Configurable safety checks for input and output validation"
Human in the loop (involving humans across runs)"Built-in mechanisms for involving humans across agent runs"

Contrast with Deep Agents' official statement (verbatim):

Deep Agents follows a "trust the LLM" model... Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police.

These two sentences are the two answers to our "who owns permissions" question — and a real selection criterion.

Do you want built-in input/output validation, or do you want to draw the sandbox boundary yourself?

Mechanism verified (see axes.permissions):

  • guardrails split into input / output / tool, with a tripwire abort on hit.
  • Tool-level approval needs_approval covers function_tool / ShellTool / ApplyPatchTool / MCP.

⚠ Boundary: no built-in file/network sandbox officially.

A guardrail is a user-programmable validation hook. The real sandbox boundary is left to the host machine or the SandboxAgent container.

"State ≠ context": the two SDKs answer differently

OpenAI Agents SDKDeep Agents
Conversation historySessions (Redis / SQLAlchemy backends)persistent memory (pluggable state and store)
Long contextno official context-management layersummarize long threads
Large-output disk spillno official claim (SandboxAgent's workspace can serve the role)offload tool outputs to disk

When we argue "persistence ≠ compression", Deep Agents is the side with official disk-spill mechanisms.

⚠ But note: SandboxAgent's workspace preservation (preserve workspace state) is itself a form of persistence.

The official docs just don't classify it as context management.

This is our judgment, not an official statement — marked as inference.

MCP is a first-class capability, not an optional plugin

In pyproject.toml, mcp>=1.19.0,<3 sits in dependencies, not optional-dependencies.

The official README lists MCP alongside functions and hosted tools as tool types.

In this SDK, connecting an MCP server requires installing nothing extra.

Appendix: the JS/TS version is a separate repo, not listed separately by us

The README explicitly points to openai/openai-agents-js (rolling verification 2026-10-23: MIT, 3,935★, active).

⚠ We do not list it as a separate object: a second-language implementation of the same product does not match our "one object = one decision basis" granularity (same treatment as Deep Agents Code). It is recorded here because selection requires knowing "a JS/TS version exists besides the Python one".

Verification notes

Basis for confidence: partial (downgraded from verified on 2026-10-03):

Why downgraded: the ❌ items below are our evidence gaps, not "the official docs don't provide it". Per the v3 rule "say unknown when unknown", marking verified while these exist would be inflated — downgraded to partial. Main gap: the real capability alignment of the 100+ providers (2026-10-08 additions: the three guardrail mechanisms and tool-level approval are verified).

✅ Verified list:

  • Repository existence and star count (30,233 · rolling verification 2026-10-23), license (MIT, via license API).
  • Last push (2026-10-22, still active).
  • Latest version 0.24.0 (releases @ 2026-10-15).
  • Key items of the full pyproject.toml (requires-python >=3.10, mcp>=1.19.0,<3 is a core dependency, litellm/any-llm/sqlalchemy all optional extras).
  • Full README: ten core concepts, code examples of the four run modes.
  • The SandboxAgent section with platform differences, and the JS-version repo metadata.

❌ Not verified:

  • The real capability alignment of the 100+ providers.
  • Availability and billing of the hosted sandbox client (quotes not recorded per our price-recording policy).
  • The concrete backend semantics of Sessions.
  • Costs of the Realtime/Voice paths.

Related entries

  • Deep AgentsThe pair most worth contrasting on our site: Deep Agents is batteries-included (filesystem + subagents + context management); this SDK is primitives-only. Two branches of the same decision tree.
  • Claude Agent SDKAlso in the "coding-base" tier, also from a model vendor. The OpenAI side goes primitives-only + built-in guardrails; the Anthropic side's home turf is Claude Code.
  • LangGraphLangGraph is a graph runtime; the OpenAI Agents SDK is an agent harness — composable (use the graph as a tool/subagent), but at different layers.
  • Codex CLIOther layer · AI coding

Same-category peers

Look at these three before reading further

Selected by overlap in jobs, not ranked. Compare where it runs, licence and status first; if one of the three fails, skip it.

ObjectWhereLicenceEvidence / statusWhat it is for
Pydantic AILocal / self-hostedOpen licence8 questions checked
Active
Pydantic AI is the type-safe Python agent loop — official README: "Pydan
smolagentsLocal / self-hostedOpen licence8 questions checked
Active
A thin agent library from Hugging Face — it lets agents think in code. I
AG2Local / self-hostedOpen licence8 questions checked
Active
The community continuation of AutoGen after the original repo stalled. T

Same vendor

More from OpenAI

One vendor’s products are often split across categories. This list puts them together so you do not have to assemble them across five sites.

This page is generated from the ai-handbook data layer (CC BY 4.0). For the judging criteria and method notes, see METHODOLOGY.md.