跳到主要内容Skip to main content
← Frameworks

OpenAI Agents SDKOpenAI Agents SDK

OpenAI
PythonPython 开源Open source MITMIT 编程底座Coding framework 通用harnessGeneral-purpose harness guardrailsguardrails MCPMCP human-in-the-loophuman-in-the-loop sandboxsandbox partial lifecycle: active 核验Checked 2026-10-23

OpenAI Agents SDK 是「primitives-only 的多agent harness」。

官方自述 lightweight yet powerful:filesystem / 规划 / 记忆都不替你决定。

"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

适合:

  • 要薄 harness,要内建 guardrails 与 human-in-the-loop。
  • 要 MCP 一等支持,团队是 Python 栈。

不适合:

  • 要开箱即用的长任务工作区(用 Deep Agents 或走 SandboxAgent 路线)。
  • TypeScript 生态(用 openai-agents-js)。

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-20

出品属地Origin
国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
国内使用Direct access
大陆可直连direct OK openai.github.io 直连实测 200;PyPI 实测可达。openai.github.io measured 200 direct; PyPI measured reachable.
备案状态CAC filing
未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。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.

备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。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.

固定坐标系Fixed coordinate system

8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.

模型与开放条件Model & openness

官方自述 provider-agnostic。 官方的接入口径是一句话: 支持 OpenAI 两套 API,也支持 100+ 其他 LLM。

官方原文:"It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs."

实现路径有两层证据:

  • 核心依赖是 openai>=3.0.0。
  • 可选依赖有两个 extra,都是非 OpenAI 路径。

两个 extra 分别是 litellm(openai-agents[litellm]) 与 any-llm(openai-agents[any-llm],要求 Python ≥3.11)。

官方 models 页给出完整接入面(已核验)。 官方专列 "Non-OpenAI models" 与 "Third-party adapters" 两节。

两节里的接入点:

  • 内置 provider 接入点可指向 OpenAI 兼容端点。
  • 另有 Any-LLM / LiteLLM 两个 beta 适配器。

内置接入点的官方示例:

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

适配器的官方示例:

anthropic/claude-3-5-sonnet

LiteLLM 页上的口径是:一个接口接 100+ 模型,也可以用任何 AI 模型。

官方原文:"allows you to use 100+ models via a single interface ... use any AI model in the Agents SDK"

换 provider 的改动量 = 换 model(字符串名 / LitellmModel(...) / provider 前缀)。

⚠ 但官方没有「零改动」的量化承诺,各家能力对齐度需实测。

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

你自己运营进程 —— 它是库,不是服务。

README 的四种运行方式全部是本地代码调用:

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

唯一例外是 SandboxAgent 的 hosted sandbox client —— 官方提到可以用托管沙箱。

⚠ 但那依赖 OpenAI 侧的容器服务,不是「整个 agent 托管」。

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

本地文件能力明确存在,但不在默认 agent 里。

官方为「需要检查文件、跑命令、打补丁,或在长任务间保留工作区状态」 的场景单独提供了 SandboxAgent。

官方原文:SandboxAgent 是 preconfigured to work with a container to perform work over long time horizons

它的 default_manifest 里可以声明 GitRepo(repo=..., ref=...)。

沙箱客户端分平台:

  • UnixLocalSandboxClient —— macOS / Linux。
  • Windows 须用 DockerSandboxClient(需 openai-agents[docker] extra)。
  • Windows 也可用 hosted sandbox client。

⚠ 这条是本站选型时的实用信息:Windows 用户不能直接用本地 Unix 沙箱路径。

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

自托管 = 关了就停。 README 没有托管执行选项 (Realtime 是长连接,但进程仍在自己手里)。

断点续跑有官方支撑。 Sessions 章节写明 官方原文:"Automatic conversation history management across agent runs"。

可选后端有 SQLite(SQLAlchemy 依赖)与 Redis(openai-agents[redis])。

SandboxAgent 的 default_manifest 也面向 官方原文:"preserve workspace state across longer tasks"。

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

工具面是官方列出的四类:functions、MCP、hosted tools, 以及 agents as tools(把别的 agent 当工具调)。

后两类与 handoffs 并列,都是核心委派机制。

MCP 是核心依赖,不是可选。 这一点看 tools 的依赖声明:

  • mcp>=1.19.0,<3 写在 dependencies 里。
  • 它不在 optional-dependencies 里,是一等能力。

Guardrails 可配置。 官方列「Configurable safety checks for input and output validation」,分 input 与 output 两个方向。

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

官方原文只有 Sessions。

官方原文:"Automatic conversation history management across agent runs"

可选后端有 Redis(openai-agents[redis]) 与 SQLAlchemy(SQLAlchemy + asyncpg 依赖)。

注意与本站主张的分野。

Sessions 管的是会话历史。

本站的「状态 ≠ 上下文」主张里,把大工具输出落盘这类手段在本 SDK 属用户自建。

SandboxAgent 的沙箱工作区可以承担这个角色,但官方没有把它宣传成 context 管理层。

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

内建 Guardrails(输入 + 输出双向校验)+ Human in the loop(工具级审批)。

这是本站目前见到的权限面最完整的内建方案。两句官方原文:

官方原文:"Configurable safety checks for input and output validation"

官方原文:"Built-in mechanisms for involving humans across agent runs"

机制细节已核验(官方 guardrails 与 human_in_the_loop 专章)。 guardrails 共三类:

  • input —— 只在链条第一个 agent 跑。
  • output —— 只在产出最终输出的 agent 跑。
  • tool —— 包 FunctionTool,执行前后各校验一次,可 skip/replace/raise tripwire。

第三条的 tripwire 命中即抛异常并立即中止。

input 侧可选 run_in_parallel=False,在 agent 启动前拦截。

工具级审批:needs_approval=True|callable 可用在 function_tool、ShellTool、ApplyPatchTool、Agent.as_tool。

MCP server 用 require_approval。

审批以 run-wide interruptions 暂停,RunState 可序列化/恢复。 参数无法安全解析时 fail closed,always_approve 可固化决策。

⚠ 边界要说清:官方没有内建文件/网络沙箱。

guardrails 是用户可编程的校验钩子;真正的沙箱边界交宿主机或 SandboxAgent 容器,不在 guardrail 层。

(已查 guardrails、human_in_the_loop、Sandbox agents 三页。)

与 Deep Agents 的「trust the LLM,边界责任交给你」形成鲜明对照。

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

适合:

  • 想要「薄 harness」,agent loop 原语之外的自己挑。
  • 需要 guardrails 与 human-in-the-loop 是内建的。
  • 需要 MCP 一等支持,团队是 Python 栈。

不适合:

  • 想要开箱即用的长任务工作区。
  • 追求 TypeScript 生态(该用 openai-agents-js)。

不适合的两条各有替代路线。长任务工作区用 Deep Agents, 或走该 SDK 的 SandboxAgent 路线。

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.

头号误解Top misconception

  • 以为「provider-agnostic」= 换provider 零改动 —— 文档给了 100+ 的承诺但没给量化保证,本站标记为未核验Reading "provider-agnostic" as "switching providers costs nothing" — the docs promise 100+ without a quantified guarantee; this site marks it unverified
  • 以为 SandboxAgent 在 Windows 上开箱可用 —— 本地路径只有 UnixLocalSandboxClient(macOS/Linux),Windows 要走 Docker 或 hostedAssuming SandboxAgent works out of the box on Windows — the local path is only UnixLocalSandboxClient (macOS/Linux); Windows needs Docker or hosted
  • 以为 Guardrails 能当权限护栏用 —— 它是输入/输出校验,不是沙箱边界;两者能解决的风险类型不同Assuming Guardrails work as a permission boundary — they are input/output validation, not a sandbox boundary; they address different risk types
  • 以为这是 OpenAI 闭源 SDK 的「官方壳」 —— 它本身是 MIT 开源框架,官方明确「committed to continuing to build the Agents SDK as an open source framework」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"

未知项清单Known unknowns

  • 100+ provider 各自的能力对齐度矩阵
  • hosted sandbox client 的可用区域、配额与计费方式(报价按本站的报价记录约定本站不采)
  • Sessions 后端在多进程/多机下的并发写语义
  • litellm / any-llm extra 的实际依赖体积与升级冲突
  • 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

证据来源Evidence sources

判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-09-30。

类型Type名称Name链接Link
repoOpenAI Agents SDK · 仓库(Python)OpenAI Agents SDK · repository (Python)https://github.com/openai/openai-agents-python
docs官方文档首页Official docs homepagehttps://openai.github.io/openai-agents-python/
docsModels(provider-agnostic、Non-OpenAI models、Any-LLM / LiteLLM 适配器)Models (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)Using any model via LiteLLM ("use any AI model", 100+ models)https://openai.github.io/openai-agents-python/models/litellm/
docsSandbox agents(官方专章)Sandbox agents (official dedicated chapter)https://openai.github.io/openai-agents-python/sandbox_agents
docsGuardrails(官方专章)Guardrails (official dedicated chapter)https://openai.github.io/openai-agents-python/guardrails/
docsHuman in the loop(官方专章)Human in the loop (official dedicated chapter)https://openai.github.io/openai-agents-python/human_in_the_loop/
docsSessions(官方专章)Sessions (official dedicated chapter)https://openai.github.io/openai-agents-python/sessions/
docsSandbox clients(平台差异与 hosted client)Sandbox clients (platform differences and the hosted client)https://openai.github.io/openai-agents-python/sandbox/clients/
repoAgents SDK JS/TS(独立仓,MIT,3,935★,滚动核验 2026-10-23)Agents 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)Releases (0.22.3 @ 2026-09-17)https://github.com/openai/openai-agents-python/releases

实测记录Measured runs

本档未跑集成与性能实测;结论只覆盖 API 与官方文档披露的能力面。

实测建议(按 harness 分区五维度定制到这个 SDK 的重点):

#测什么为什么值得测
1最小 hello agent 要几个文件、多少行官方称 lightweight,要验证「薄」到什么程度
2Guardrails 能不能拦住「读文件」类越权官方定位是 input/output 校验,与文件访问权限不是一回事
3SandboxAgent 在 Windows 上的最小可用路径官方示例是 Unix,Windows 要另走 Docker
4换成 litellm / any-llm 接本地模型要改多少官方说 provider-agnostic,验证真实改动量
5Sessions 断掉进程后恢复状态是否完整这是本站最关心的「可靠长期运行」

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 是官方写在首段的Provider-agnostic is in the official first paragraph

官方首段把这条写在最前面:

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.

这是本站的第一决策点。 代码层面的证据也一致:

  • 核心依赖 openai>=3.0.0。
  • 另有 litellm 与 any-llm 两个可选 extra,作为非 OpenAI 路径。

⚠ 但要说清边界:「100+」是官方声明,本站未做端到端实测具体各家 provider 的能力对齐度。

工具调用、structured output、多模态在各家差异很大。

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.

与 Deep Agents 的对照:本站最该给用户看的一张表Versus Deep Agents: the table our readers most need to see

两个都在 Python agent harness 档,风格完全相反:

维度OpenAI Agents SDKDeep Agents
风格primitives-only,薄batteries-included,厚
filesystem不预置(要自己接,或用 SandboxAgent)核心卖点,可插拔后端
子代理agents as tools / handoffs(需自己建)预置 sub-agents
上下文管理只有 Sessions(会话历史)summarize + 落盘 + 跨会话记忆
权限内建 guardrails + human-in-the-loop官方明说「trust the LLM」,边界归你
运行形态你自己跑(本地/容器/Redis)你自己跑

选型口诀:想要「安全内建」选前者,想要「功能内建」选后者。

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:本地文件能力的官方答案,但有个 Windows 坑SandboxAgent: the official answer for local files — with a Windows pitfall

普通 Agent 不带本地工作区。官方为此单独提供 SandboxAgent:

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

它的 default_manifest 可以声明要检出的仓库:

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

⚠ 平台差异是选型时必须知道的:

客户端支持平台说明
UnixLocalSandboxClientmacOS / LinuxREADME 示例用的就是它
DockerSandboxClientWindows 等需 openai-agents[docker] extra
hosted sandbox client依赖 OpenAI 侧服务官方提到可用

Windows 用户不能直接走本地 Unix 沙箱路径。

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

官方提供章节
Guardrails(input + output 双向校验)「Configurable safety checks for input and output validation」
Human in the loop(跨多次运行引入人工)「Built-in mechanisms for involving humans across agent runs」

对比 Deep Agents 的官方声明(原文):

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

这两句话就是本站「权限归属」这个问题的两种答案,也是一个真实的选择依据。

你要内建的输入输出校验,还是你要自己划沙箱边界?

机制已核验(见 axes.permissions):

  • guardrails 分 input / output / tool 三类,命中抛 tripwire 中止。
  • 工具级审批 needs_approval 覆盖 function_tool / ShellTool / ApplyPatchTool / MCP。

⚠ 边界:官方无内建文件/网络沙箱。

guardrail 是用户可编程校验钩子。真正的沙箱边界交宿主机或 SandboxAgent 容器。

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.

「状态 ≠ 上下文」在这两个 SDK 里的不同答案"State ≠ context": the two SDKs answer differently

OpenAI Agents SDKDeep Agents
会话历史Sessions(Redis / SQLAlchemy 后端)persistent memory(pluggable state and store)
长上下文无官方 context management 层summarize long threads
大输出落盘无官方宣称(SandboxAgent 的工作区可承担)offload tool outputs to disk

本站主张「持久化 ≠ 压缩」时,Deep Agents 是有官方落盘手段的那一方。

⚠ 但要注意:SandboxAgent 的工作区保留(preserve workspace state) 实际上也是一种持久化。

只是官方没把它归类成 context management。

这是本站的判断,不是官方表述,已标注为推断。

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 是一等能力,不是可选插件MCP is a first-class capability, not an optional plugin

pyproject.toml 里 mcp>=1.19.0,<3 在 dependencies,而非 optional-dependencies。

官方 README 把 MCP 与 functions、hosted tools 并列为工具类型。

在这套 SDK 里接 MCP server 不需要额外装东西。

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.

附:JS/TS 版是独立仓,本站不单独收录Appendix: the JS/TS version is a separate repo, not listed separately by us

README 里明确指向 openai/openai-agents-js(滚动核验 2026-10-23:MIT,3,935★,活跃)。

⚠ 本站不把它作为独立对象收录:同一产品的第二语言实现, 与本站「一个对象 = 一套决策依据」的粒度不符(同 Deep Agents Code 的处理法)。 记录在此是因为选型时需要知道「Python 版之外还有 JS/TS 版」。

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

confidence: partial 的依据(2026-10-03 由 verified 降级):

为什么降级:下方 ❌ 项的主语是本站的取证缺口,不是「官方未提供」。 按 v3 铁律「未知就说未知」,这些条目存在时标 verified 属于虚高,故降为 partial。 主要缺口:100+ provider 的实际能力对齐度(2026-10-08 已补:guardrail 三类机制与工具级审批已核验)。

✅ 已核验清单:

  • 仓库存在与星数(30,233 · 滚动核验 2026-10-23)、许可(MIT,经 license API)。
  • 最近推送(2026-10-22,仍活跃)。
  • 最新版本 0.24.0(releases @ 2026-10-15)。
  • pyproject.toml 全文关键项(requires-python >=3.10、mcp>=1.19.0,<3 是核心依赖、 litellm/any-llm/sqlalchemy 均为可选 extra)。
  • README 全文十项核心概念、四种运行方式代码示例。
  • SandboxAgent 段落与平台差异、JS 版仓元数据。

❌ 未核验清单:

  • 100+ provider 的实际能力对齐度。
  • hosted sandbox client 的可用性与计费方式(报价按本站的报价记录约定本站不采)。
  • Sessions 的具体后端语义。
  • Realtime/Voice 路径的成本。

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 AgentsDeep Agents本站最值得对照的一对:Deep Agents 是 batteries-included(含 filesystem + 子代理 + 上下文管理),本 SDK 是 primitives-only。同一决策树的两个分支。The 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 SDKClaude Agent SDK同为「编程底座」档,且同样出自模型厂商。OpenAI 侧走 primitives-only + guardrails 内建,Anthropic 侧的主场是 Claude Code。Also 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.
  • LangGraphLangGraphLangGraph 是 graph runtime,OpenAI Agents SDK 是 agent harness —— 可组合(把图当工具/子代理),但层级不同。LangGraph 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 CLICodex CLI另一层 · AI 编程Other layer · AI coding

本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0). 方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.