You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If the serialized RunState shape changes, update `CURRENT_SCHEMA_VERSION` in `src/agents/run_state.py` and the related serialization/deserialization logic. Keep released schema versions readable, and feel free to renumber or squash unreleased schema versions before release when those intermediate snapshots are intentionally unsupported.
94
+
- When bumping `CURRENT_SCHEMA_VERSION`, also add or update the matching entry in `SCHEMA_VERSION_SUMMARIES` in `src/agents/run_state.py` so every supported version keeps a short historical note describing what changed in that schema.
Copy file name to clipboardExpand all lines: README.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ The OpenAI Agents SDK is a lightweight yet powerful framework for building multi
10
10
### Core concepts:
11
11
12
12
1.[**Agents**](https://openai.github.io/openai-agents-python/agents): LLMs configured with instructions, tools, guardrails, and handoffs
13
+
1.[**Sandbox Agents**](https://openai.github.io/openai-agents-python/sandbox_agents): Agents preconfigured to work with a container to perform work over long time horizons.
13
14
1.**[Agents as tools](https://openai.github.io/openai-agents-python/tools/#agents-as-tools) / [Handoffs](https://openai.github.io/openai-agents-python/handoffs/)**: Delegating to other agents for specific tasks
14
15
1.[**Tools**](https://openai.github.io/openai-agents-python/tools/): Various Tools let agents take actions (functions, MCP, hosted tools)
15
16
1.[**Guardrails**](https://openai.github.io/openai-agents-python/guardrails/): Configurable safety checks for input and output validation
@@ -45,19 +46,36 @@ uv add openai-agents
45
46
46
47
For voice support, install with the optional `voice` group: `uv add 'openai-agents[voice]'`. For Redis session support, install with the optional `redis` group: `uv add 'openai-agents[redis]'`.
47
48
48
-
## Run your first agent
49
+
## Run your first Sandbox Agent
49
50
50
-
```python
51
-
from agents import Agent, Runner
52
-
53
-
agent = Agent(name="Assistant", instructions="You are a helpful assistant")
51
+
[Sandbox Agents](https://openai.github.io/openai-agents-python/sandbox_agents) are new in version 0.14.0. A sandbox agent is an agent that uses a computer environment to perform real work with a filesystem, in an environment you configure and control. Sandbox agents are useful when the agent needs to inspect files, run commands, apply patches, or carry workspace state across longer tasks.
54
52
55
-
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
53
+
```python
54
+
from agents import Runner
55
+
from agents.run import RunConfig
56
+
from agents.sandbox import Manifest, SandboxAgent, SandboxRunConfig
57
+
from agents.sandbox.entries import GitRepo
58
+
from agents.sandbox.sandboxes import UnixLocalSandboxClient
59
+
60
+
agent = SandboxAgent(
61
+
name="Workspace Assistant",
62
+
instructions="Inspect the sandbox workspace before answering.",
Copy file name to clipboardExpand all lines: docs/agents.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
Agents are the core building block in your apps. An agent is a large language model (LLM) configured with instructions, tools, and optional runtime behavior such as handoffs, guardrails, and structured outputs.
4
4
5
-
Use this page when you want to define or customize a single agent. If you are deciding how multiple agents should collaborate, read [Agent orchestration](multi_agent.md).
5
+
Use this page when you want to define or customize a single plain `Agent`. If you are deciding how multiple agents should collaborate, read [Agent orchestration](multi_agent.md). If the agent should run inside an isolated workspace with manifest-defined files and sandbox-native capabilities, read [Sandbox agent concepts](sandbox/guide.md).
6
+
7
+
The SDK uses the Responses API by default for OpenAI models, but the distinction here is orchestration: `Agent` plus `Runner` lets the SDK manage turns, tools, guardrails, handoffs, and sessions for you. If you want to own that loop yourself, use the Responses API directly instead.
6
8
7
9
## Choose the next guide
8
10
@@ -12,6 +14,7 @@ Use this page as the hub for agent definition. Jump to the adjacent guide that m
12
14
| --- | --- |
13
15
| Choose a model or provider setup |[Models](models/index.md)|
14
16
| Add capabilities to the agent |[Tools](tools.md)|
17
+
| Run an agent against a real repo, document bundle, or isolated workspace |[Sandbox agents quickstart](sandbox_agents.md)|
15
18
| Decide between manager-style orchestration and handoffs |[Agent orchestration](multi_agent.md)|
| Run turns, stream events, or manage conversation state |[Running agents](running_agents.md)|
@@ -57,6 +60,8 @@ agent = Agent(
57
60
)
58
61
```
59
62
63
+
Everything in this section applies to `Agent`. `SandboxAgent` builds on the same ideas, then adds `default_manifest`, `base_instructions`, `capabilities`, and `run_as` for workspace-scoped runs. See [Sandbox agent concepts](sandbox/guide.md).
64
+
60
65
## Prompt templates
61
66
62
67
You can reference a prompt template created in the OpenAI platform by setting `prompt`. This works with OpenAI models using the Responses API.
Copy file name to clipboardExpand all lines: docs/config.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,13 @@
2
2
3
3
This page covers SDK-wide defaults that you usually set once during application startup, such as the default OpenAI key or client, the default OpenAI API shape, tracing export defaults, and logging behavior.
4
4
5
+
These defaults still apply to sandbox-based workflows, but sandbox workspaces, sandbox clients, and session reuse are configured separately.
6
+
5
7
If you need to configure a specific agent or run instead, start with:
6
8
9
+
-[Agents](agents.md) for instructions, tools, output types, handoffs, and guardrails on a plain `Agent`.
7
10
-[Running agents](running_agents.md) for `RunConfig`, sessions, and conversation-state options.
11
+
-[Sandbox agents](sandbox/guide.md) for `SandboxRunConfig`, manifests, capabilities, and sandbox-client-specific workspace setup.
8
12
-[Models](models/index.md) for model selection and provider configuration.
9
13
-[Tracing](tracing.md) for per-run tracing metadata and custom trace processors.
Copy file name to clipboardExpand all lines: docs/index.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ Here are the main features of the SDK:
20
20
-**Agent loop**: A built-in agent loop that handles tool invocation, sends results back to the LLM, and continues until the task is complete.
21
21
-**Python-first**: Use built-in language features to orchestrate and chain agents, rather than needing to learn new abstractions.
22
22
-**Agents as tools / Handoffs**: A powerful mechanism for coordinating and delegating work across multiple agents.
23
+
-**Sandbox agents**: Run specialists inside real isolated workspaces with manifest-defined files, sandbox client choice, and resumable sandbox sessions.
23
24
-**Guardrails**: Run input validation and safety checks in parallel with agent execution, and fail fast when checks do not pass.
24
25
-**Function tools**: Turn any Python function into a tool with automatic schema generation and Pydantic-powered validation.
25
26
-**MCP server tool calling**: Built-in MCP server tool integration that works the same way as function tools.
@@ -28,6 +29,23 @@ Here are the main features of the SDK:
28
29
-**Tracing**: Built-in tracing for visualizing, debugging, and monitoring workflows, with support for the OpenAI suite of evaluation, fine-tuning, and distillation tools.
29
30
-**Realtime Agents**: Build powerful voice agents with `gpt-realtime-1.5`, automatic interruption detection, context management, guardrails, and more.
30
31
32
+
## Agents SDK or Responses API?
33
+
34
+
The SDK uses the Responses API by default for OpenAI models, but it adds a higher-level runtime around model calls.
35
+
36
+
Use the Responses API directly when:
37
+
38
+
- you want to own the loop, tool dispatch, and state handling yourself
39
+
- your workflow is short-lived and mainly about returning the model's response
40
+
41
+
Use the Agents SDK when:
42
+
43
+
- you want the runtime to manage turns, tool execution, guardrails, handoffs, or sessions
44
+
- your agent should produce artifacts or operate across multiple coordinated steps
45
+
- you need a real workspace or resumable execution through [Sandbox agents](sandbox_agents.md)
46
+
47
+
You do not need to choose one globally. Many applications use the SDK for managed workflows and call the Responses API directly for lower-level paths.
48
+
31
49
## Installation
32
50
33
51
```bash
@@ -59,6 +77,7 @@ export OPENAI_API_KEY=sk-...
59
77
60
78
- Build your first text-based agent with the [Quickstart](quickstart.md).
61
79
- Then decide how you want to carry state across turns in [Running agents](running_agents.md#choose-a-memory-strategy).
80
+
- If the task depends on real files, repos, or isolated per-agent workspace state, read the [Sandbox agents quickstart](sandbox_agents.md).
62
81
- If you are deciding between handoffs and manager-style orchestration, read [Agent orchestration](multi_agent.md).
63
82
64
83
## Choose your path
@@ -69,6 +88,7 @@ Use this table when you know the job you want to do, but not which page explains
69
88
| --- | --- |
70
89
| Build the first text agent and see one complete run |[Quickstart](quickstart.md)|
71
90
| Add function tools, hosted tools, or agents as tools |[Tools](tools.md)|
91
+
| Run a coding, review, or document agent inside a real isolated workspace |[Sandbox agents quickstart](sandbox_agents.md) and [Sandbox clients](sandbox/clients.md)|
72
92
| Decide between handoffs and manager-style orchestration |[Agent orchestration](multi_agent.md)|
73
93
| Keep memory across turns |[Running agents](running_agents.md#choose-a-memory-strategy) and [Sessions](sessions/index.md)|
74
94
| Use OpenAI models, websocket transport, or non-OpenAI providers |[Models](models/index.md)|
0 commit comments