SpyBara
Go Premium

Documentation 2026-05-02 05:57 UTC to 2026-05-05 23:00 UTC

3 files changed +277 −64. View all changes and history on the product overview
2026
Fri 29 06:38 Thu 28 06:37 Wed 27 06:42 Sun 24 06:25 Fri 22 06:33 Thu 21 06:36 Wed 20 06:35 Tue 19 11:58 Mon 18 22:01 Thu 14 21:00 Tue 12 18:57 Thu 7 21:57 Wed 6 00:01 Tue 5 23:00 Sat 2 05:57
Data Information:
  • After 2026-05-05 06:03 UTC, this monitor no longer uses markdownified HTML/MDX. Comparisons across that boundary can therefore show more extensive diffs.

guides/admin-apis.md +33 −0 created

Details

1# Admin APIs

2 

3import {

4 adminClientExamples,

5 auditLogExamples,

6 inviteUserExamples,

7} from "./admin-apis-examples";

8 

9Admin APIs let you automate organization management workflows such as user invitations, audit log review, project administration, API key management, and rate limit operations. Use them for back-office automation, security workflows, and operational tooling that should run outside the dashboard.

10 

11For endpoint details, see the [Administration API reference](https://developers.openai.com/api/reference/administration/overview), including [Admin API keys](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys), [Invites](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/invites), [Users](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/users), [Projects](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/projects), and [Audit logs](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/audit_logs).

12 

13## Use an Admin API key with the SDK

14 

15To access these endpoints, [create an Admin API key](https://platform.openai.com/settings/organization/admin-keys). Admin API keys cannot be used for non-administration endpoints.

16 

17Support for Admin APIs was added in these SDK versions, which may require updating your SDK version:

18 

19- Node: `6.36.0`

20- Python: `2.34.0`

21- Go: `3.34.0`

22- Ruby: `0.61.0`

23- Java: `4.34.0`

24 

25Set `OPENAI_ADMIN_KEY`, then initialize the SDK for your language.

26 

27## Invite a user by email

28 

29Use the Invites endpoint to send an organization invitation to an email address.

30 

31## Retrieve audit logs

32 

33Use the Audit Logs endpoint to list recent user actions and configuration changes for the organization.

Details

1# Agents SDK1# Agents SDK

2 2 

3Sandbox agents are now available in the Python Agents SDK. Use them when your

4 agent needs a container-based environment with files, commands, packages,

5 ports, snapshots, and memory. [Read the Sandbox agents

6 guide](https://developers.openai.com/api/docs/guides/agents/sandboxes).

7 

8Agents are applications that plan, call tools, collaborate across specialists, and keep enough state to complete multi-step work.3Agents are applications that plan, call tools, collaborate across specialists, and keep enough state to complete multi-step work.

9 4 

10- Use the **OpenAI client libraries** when you want direct API clients for model requests.5- Use the **OpenAI client libraries** when you want direct API clients for model requests.

Details

9commands, previews, and resumable work all need an environment the agent can9commands, previews, and resumable work all need an environment the agent can

10inspect and change.10inspect and change.

11 11 

12Sandbox agents are currently only available in the Python Agents SDK.12Sandbox agents are available in the TypeScript and Python Agents SDKs. They

13 are in beta, so API details, defaults, and supported capabilities may change.

13 14 

14Use sandboxes when the agent needs to manipulate files, run commands, mount a15Use sandboxes when the agent needs to manipulate files, run commands, mount a

15data room, produce artifacts, expose a service, or continue stateful work16data room, produce artifacts, expose a service, or continue stateful work


71## What sandboxes add72## What sandboxes add

72 73 

73`SandboxAgent` is still an `Agent`. It keeps the usual agent surface, including74`SandboxAgent` is still an `Agent`. It keeps the usual agent surface, including

74`instructions`, `prompt`, `tools`, `handoffs`, `mcp_servers`, `model_settings`,75`instructions`, `prompt`, `tools`, `handoffs`, MCP servers, model settings,

75`output_type`, guardrails, and hooks. What changes is the execution boundary:76structured output, guardrails, and hooks. What changes is the execution boundary:

76the runner prepares the agent against a live sandbox session that owns files,77the runner prepares the agent against a live sandbox session that owns files,

77commands, ports, and provider-specific isolation.78commands, ports, and provider-specific isolation.

78 79 


83| Capabilities | Sandbox-native behavior attached to the agent | Which sandbox tools, instructions, or runtime behavior does this agent need? |84| Capabilities | Sandbox-native behavior attached to the agent | Which sandbox tools, instructions, or runtime behavior does this agent need? |

84| Sandbox client | The provider integration | Where should the live workspace run: Unix-local, Docker, or a hosted provider? |85| Sandbox client | The provider integration | Where should the live workspace run: Unix-local, Docker, or a hosted provider? |

85| Sandbox session | The live execution environment | Where do commands run, files change, ports open, and provider state live? |86| Sandbox session | The live execution environment | Where do commands run, files change, ports open, and provider state live? |

86| `SandboxRunConfig` | Per-run sandbox session source, client options, and fresh inputs | Should this run inject, resume, or create the sandbox session? |87| Sandbox run config | Per-run sandbox session source, client options, and fresh inputs | Should this run inject, resume, or create the sandbox session? |

87| Saved state | `RunState`, `session_state`, and snapshots | How should later runs reconnect to work or seed a new workspace? |88| Saved state | `RunState`, serialized session state, and snapshots | How should later runs reconnect to work or seed a new workspace? |

88 89 

89Sandbox-specific defaults belong on `SandboxAgent`. Per-run sandbox-session90Sandbox-specific defaults belong on `SandboxAgent`. Per-run sandbox-session

90choices belong in `SandboxRunConfig`.91choices belong in the run's sandbox configuration.

91 92 

92Sandbox agents also don't change what a turn means. A turn is still a model93Sandbox agents also don't change what a turn means. A turn is still a model

93step, not a single shell command or sandbox action. Some work may stay inside94step, not a single shell command or sandbox action. Some work may stay inside


112| Manifest input | Use it for |113| Manifest input | Use it for |

113| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |114| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |

114| `File`, `Dir` | Small synthetic inputs, helper files, or output directories. |115| `File`, `Dir` | Small synthetic inputs, helper files, or output directories. |

115| `LocalFile`, `LocalDir` | Host files or directories to materialize into the sandbox. |116| Local file or directory | Host files or directories to materialize into the sandbox. |

116| `GitRepo` | A repository to fetch into the workspace. |117| Git repo | A repository to fetch into the workspace. |

117| `S3Mount`, `GCSMount`, `R2Mount`, `AzureBlobMount`, `BoxMount`, `S3FilesMount` | External storage to make available inside the sandbox. |118| `S3Mount`, `GCSMount`, `R2Mount`, `AzureBlobMount`, `BoxMount`, `S3FilesMount` | External storage to make available inside the sandbox. |

118| `environment` | Environment variables the sandbox needs when it starts. |119| `environment` | Environment variables the sandbox needs when it starts. |

119| `users` and `groups` | Sandbox-local OS accounts and groups for providers that support account provisioning. |120| `users` and `groups` | Sandbox-local OS accounts and groups for providers that support account provisioning. |


178| [`Memory`](#persist-memory-across-runs) | Follow-on runs should read or generate memory artifacts. | Requires `Shell`; live memory updates also require `Filesystem`. |179| [`Memory`](#persist-memory-across-runs) | Follow-on runs should read or generate memory artifacts. | Requires `Shell`; live memory updates also require `Filesystem`. |

179| `Compaction` | Long-running flows need context trimming. | Adjusts model behavior and input handling after compaction items. |180| `Compaction` | Long-running flows need context trimming. | Adjusts model behavior and input handling after compaction items. |

180 181 

181By default, a `SandboxAgent` uses `Capabilities.default()`, which includes182By default, a `SandboxAgent` includes filesystem, shell, and compaction

182`Filesystem()`, `Shell()`, and `Compaction()`. If you pass a `capabilities`183capabilities. If you pass a `capabilities` list, it replaces the default list,

183list, it replaces the default list, so include any default capabilities the184so include any default capabilities the agent still needs.

184agent still needs.

185 185 

186Prefer built-in capabilities when they fit. Write a custom capability only when186Prefer built-in capabilities when they fit. Write a custom capability only when

187you need a sandbox-specific tool or instruction surface that the built-ins don't187you need a sandbox-specific tool or instruction surface that the built-ins don't


193the agent starts. Use the `Skills` capability so the agent can discover that193the agent starts. Use the `Skills` capability so the agent can discover that

194working context during the run.194working context during the run.

195 195 

196Load skills

197 

198```typescript

199import {

200 Capabilities,

201 SandboxAgent,

202 gitRepo,

203 skills,

204} from "@openai/agents/sandbox";

205 

206const agent = new SandboxAgent({

207 name: "Tax prep assistant",

208 instructions: "Use the mounted skill before preparing the return.",

209 capabilities: [

210 ...Capabilities.default(),

211 skills({

212 from: gitRepo({

213 repo: "owner/tax-prep-skills",

214 ref: "main",

215 }),

216 }),

217 ],

218});

219```

220 

196```python221```python

197from agents.sandbox import SandboxAgent222from agents.sandbox import SandboxAgent

198from agents.sandbox.capabilities import Capabilities, Skills223from agents.sandbox.capabilities import Capabilities, Skills


207)232)

208```233```

209 234 

235 

210Choose the skill source based on how you want it materialized:236Choose the skill source based on how you want it materialized:

211 237 

212- Use `Skills(lazy_from=LocalDirLazySkillSource(...))` for larger local skill directories when you want the model to discover the index first and load only what it needs.238- Use a lazy local directory source for larger local skill directories when you want the model to discover the index first and load only what it needs.

213- Use `Skills(from_=LocalDir(src=...))` for a small local bundle to stage up front.239- Use a local directory source for a small local bundle to stage up front.

214- Use `Skills(from_=GitRepo(repo=..., ref=...))` when the skills bundle has its own release cadence or many sandboxes use it.240- Use a Git repo source when the skills bundle has its own release cadence or many sandboxes use it.

215 241 

216### Expose previews and ports242### Expose previews and ports

217 243 


2301. Build a `Manifest` that describes the workspace.2561. Build a `Manifest` that describes the workspace.

2312. Create a `SandboxAgent` with the capabilities the model needs.2572. Create a `SandboxAgent` with the capabilities the model needs.

2323. Choose a sandbox client for the environment where work should run.2583. Choose a sandbox client for the environment where work should run.

2334. Run the agent with `RunConfig(sandbox=SandboxRunConfig(...))`.2594. Run the agent with the per-run sandbox configuration.

2345. Inspect, copy, resume, or snapshot the artifacts that matter to your application.2605. Inspect, copy, resume, or snapshot the artifacts that matter to your application.

235 261 

236Start with Unix-local for local development on macOS or Linux. It gives you the262Start with Unix-local for local development on macOS or Linux. It gives you the

237smallest local loop because the runner can create a temporary workspace from the263smallest local loop because the runner can create a temporary workspace from the

238agent's `default_manifest` and clean it up after the run.264agent's default manifest and clean it up after the run.

265 

266Run a Unix-local sandbox agent

267 

268```typescript

269import { run } from "@openai/agents";

270import {

271 Manifest,

272 SandboxAgent,

273 file,

274 shell,

275} from "@openai/agents/sandbox";

276import { UnixLocalSandboxClient } from "@openai/agents/sandbox/local";

277 

278const manifest = new Manifest({

279 entries: {

280 "account_brief.md": file({

281 content:

282 "# Northwind Health\\n\\n" +

283 "- Segment: Mid-market healthcare analytics provider.\\n" +

284 "- Renewal date: 2026-04-15.\\n",

285 }),

286 "implementation_risks.md": file({

287 content:

288 "# Delivery risks\\n\\n" +

289 "- Security questionnaire is not complete.\\n" +

290 "- Procurement requires final legal language by April 1.\\n",

291 }),

292 },

293});

294 

295const agent = new SandboxAgent({

296 name: "Renewal Packet Analyst",

297 model: "gpt-5.5",

298 instructions:

299 "Review the workspace before answering. Keep the response concise, " +

300 "business-focused, and cite the file names that support each conclusion.",

301 defaultManifest: manifest,

302 capabilities: [shell()],

303});

304 

305const result = await run(

306 agent,

307 "Summarize the renewal blockers and recommend the next two actions.",

308 {

309 sandbox: {

310 client: new UnixLocalSandboxClient(),

311 },

312 },

313);

314 

315console.log(result.finalOutput);

316```

239 317 

240```python318```python

241import asyncio319import asyncio


251 entries={329 entries={

252 "account_brief.md": File(330 "account_brief.md": File(

253 content=(331 content=(

254 b"# Northwind Health\n\n"332 b"# Northwind Health\\n\\n"

255 b"- Segment: Mid-market healthcare analytics provider.\n"333 b"- Segment: Mid-market healthcare analytics provider.\\n"

256 b"- Renewal date: 2026-04-15.\n"334 b"- Renewal date: 2026-04-15.\\n"

257 )335 )

258 ),336 ),

259 "implementation_risks.md": File(337 "implementation_risks.md": File(

260 content=(338 content=(

261 b"# Delivery risks\n\n"339 b"# Delivery risks\\n\\n"

262 b"- Security questionnaire is not complete.\n"340 b"- Security questionnaire is not complete.\\n"

263 b"- Procurement requires final legal language by April 1.\n"341 b"- Procurement requires final legal language by April 1.\\n"

264 )342 )

265 ),343 ),

266 }344 }


293asyncio.run(main())371asyncio.run(main())

294```372```

295 373 

296For a complete local example, see [`unix_local_runner.py`][sdk-example-unix-local-runner].374 

375For complete local examples, see the TypeScript [sandbox agent quickstart][sdk-js-example-basic] and Python [`unix_local_runner.py`][sdk-example-unix-local-runner].

297 376 

298### Switch providers377### Switch providers

299 378 


304This example uses Docker for local container isolation. Hosted providers follow383This example uses Docker for local container isolation. Hosted providers follow

305the same pattern with their own client classes and options.384the same pattern with their own client classes and options.

306 385 

386Switch to Docker

387 

388```typescript

389import { run } from "@openai/agents";

390import { SandboxAgent } from "@openai/agents/sandbox";

391import { DockerSandboxClient } from "@openai/agents/sandbox/local";

392 

393const agent = new SandboxAgent({

394 name: "Workspace reviewer",

395 model: "gpt-5.5",

396 instructions: "Inspect the sandbox workspace before answering.",

397});

398 

399const result = await run(agent, "Inspect the workspace.", {

400 sandbox: {

401 client: new DockerSandboxClient({

402 image: "node:22-bookworm-slim",

403 }),

404 },

405});

406 

407console.log(result.finalOutput);

408```

409 

307```python410```python

308from docker import from_env as docker_from_env411from docker import from_env as docker_from_env

309 412 


328)431)

329```432```

330 433 

331For runnable examples, see [`basic.py`][sdk-example-basic] for provider434 

332selection, [`docker_runner.py`][sdk-example-docker-runner] for Docker, and435For runnable examples, see the TypeScript [sandbox clients guide][sdk-js-sandbox-clients] and [basic example][sdk-js-example-basic], plus Python [`basic.py`][sdk-example-basic] for provider selection, [`docker_runner.py`][sdk-example-docker-runner] for Docker, and [`main.py`][sdk-example-dataroom-qa] for a data-room flow in the SDK repository.

333[`main.py`][sdk-example-dataroom-qa] for a data-room flow in the SDK

334repository.

335 436 

336### Advanced patterns437### Advanced patterns

337 438 


357Keep three state concepts separate:458Keep three state concepts separate:

358 459 

359| State surface | Restores | Use when |460| State surface | Restores | Use when |

360| --------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |461| ------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |

361| `RunState` | Harness-side state such as model items, tool state, approvals, and active agent position. | The runner should carry the workflow forward across pauses. |462| `RunState` | Harness-side state such as model items, tool state, approvals, and active agent position. | The runner should carry the workflow forward across pauses. |

362| `session_state` | A serialized sandbox session that a client can reconnect to. | Your app or job system stores provider session state directly. |463| Session state | A serialized sandbox session that a client can reconnect to. | Your app or job system stores provider session state directly. |

363| `snapshot` | Saved workspace contents used to seed a fresh sandbox session. | A new run should start from saved files and artifacts, not an empty workspace. |464| `snapshot` | Saved workspace contents used to seed a fresh sandbox session. | A new run should start from saved files and artifacts, not an empty workspace. |

364 465 

365In practice, the runner resolves the sandbox session in this order:466In practice, the runner resolves the sandbox session in this order:

366 467 

3671. If you pass `run_config.sandbox.session`, the runner reuses that live sandbox session directly.4681. If you pass a live sandbox session, the runner reuses that session directly.

3682. Otherwise, if the run is resuming from `RunState`, the runner resumes from the stored sandbox session state.4692. Otherwise, if the run is resuming from `RunState`, the runner resumes from the stored sandbox session state.

3693. Otherwise, if you pass `run_config.sandbox.session_state`, the runner resumes from that explicit serialized sandbox state.4703. Otherwise, if you pass explicit serialized sandbox state, the runner resumes from that state.

3704. Otherwise, the runner creates a fresh sandbox session. For that fresh session, it uses `run_config.sandbox.manifest` when provided, or `agent.default_manifest` if not.4714. Otherwise, the runner creates a fresh sandbox session. For that fresh session, it uses the per-run manifest when provided, or the agent's default manifest if not.

371 472 

372The sandbox resume example serializes the stopped session state, resumes it473The sandbox resume example serializes the stopped session state, resumes it

373through the same client, and then passes the resumed session back into the next474through the same client, and then passes the resumed session back into the next

374run:475run:

375 476 

477Serialize and resume sandbox state

478 

479```typescript

480import { run } from "@openai/agents";

481import { Manifest, SandboxAgent } from "@openai/agents/sandbox";

482import { UnixLocalSandboxClient } from "@openai/agents/sandbox/local";

483 

484const manifest = new Manifest();

485const client = new UnixLocalSandboxClient({

486 snapshot: { type: "local", baseDir: "/tmp/my-sandbox-snapshots" },

487});

488const agent = new SandboxAgent({

489 name: "Workspace builder",

490 model: "gpt-5.5",

491 instructions: "Inspect the sandbox workspace before answering.",

492});

493 

494const session = await client.create({ manifest });

495let conversation: any[] = [];

496let frozenSessionState;

497 

498try {

499 const firstResult = await run(agent, "Build the first version of the app.", {

500 maxTurns: 20,

501 sandbox: { session },

502 });

503 

504 conversation = firstResult.history;

505 frozenSessionState = await client.serializeSessionState?.(session.state);

506} finally {

507 await session.close?.();

508}

509 

510if (!frozenSessionState || !client.deserializeSessionState || !client.resume) {

511 throw new Error("Sandbox client does not support session resume.");

512}

513 

514const resumedSession = await client.resume(

515 await client.deserializeSessionState(frozenSessionState),

516);

517 

518try {

519 conversation.push({

520 role: "user",

521 content: "Continue from the existing workspace and add tests.",

522 });

523 

524 await run(agent, conversation, {

525 maxTurns: 20,

526 sandbox: { session: resumedSession },

527 });

528} finally {

529 await resumedSession.close?.();

530}

531```

532 

376```python533```python

377async with session:534async with session:

378 first_result = await Runner.run(535 first_result = await Runner.run(


421 579 

422This split lets the harness resume the agent loop while the sandbox provider580This split lets the harness resume the agent loop while the sandbox provider

423restores or recreates the workspace. Current sample code for these paths lives581restores or recreates the workspace. Current sample code for these paths lives

424in [`main.py`][sdk-example-sandbox-resume],582in the TypeScript [resume session state example][sdk-js-example-resume] and

583Python [`main.py`][sdk-example-sandbox-resume] and

425[`sandbox_agent_with_remote_snapshot.py`][sdk-example-remote-snapshot].584[`sandbox_agent_with_remote_snapshot.py`][sdk-example-remote-snapshot].

426 585 

427## Persist memory across runs586## Persist memory across runs


436turn. Resume and snapshots preserve workspace state; memory preserves reusable595turn. Resume and snapshots preserve workspace state; memory preserves reusable

437guidance about work that happened in the workspace.596guidance about work that happened in the workspace.

438 597 

598Enable sandbox memory

599 

600```typescript

601import {

602 Manifest,

603 SandboxAgent,

604 filesystem,

605 memory,

606 shell,

607} from "@openai/agents/sandbox";

608 

609const manifest = new Manifest();

610 

611const agent = new SandboxAgent({

612 name: "Memory-enabled reviewer",

613 instructions:

614 "Inspect the workspace and retain useful lessons for follow-up runs.",

615 defaultManifest: manifest,

616 capabilities: [memory(), filesystem(), shell()],

617});

618```

619 

439```python620```python

440from agents.sandbox.capabilities import Filesystem, Memory, Shell621from agents.sandbox.capabilities import Filesystem, Memory, Shell

441 622 


447)628)

448```629```

449 630 

450`Memory()` enables both reads and generation by default. Memory reads require631 

451`Shell` so the agent can search and open memory files. By default, live memory632Memory enables both reads and generation by default. Memory reads require shell

452updates also require `Filesystem`, so the agent can repair stale memory or633access so the agent can search and open memory files. By default, live memory

634updates also require filesystem access, so the agent can repair stale memory or

453update memory when the user asks.635update memory when the user asks.

454 636 

455Memory reads use progressive disclosure. The SDK injects `memory_summary.md` at637Memory reads use progressive disclosure. The SDK injects `memory_summary.md` at


457relevant, and it opens rollout summaries only when it needs more detail.639relevant, and it opens rollout summaries only when it needs more detail.

458 640 

459| Memory mode | Use it when |641| Memory mode | Use it when |

460| ----------------------- | ----------------------------------------------------------------------- |642| -------------------- | ----------------------------------------------------------------------- |

461| `Memory()` | The agent should read existing memory and generate new memory. |643| Default read/write | The agent should read existing memory and generate new memory. |

462| `Memory(generate=None)` | The agent should read memory but not generate new memory after the run. |644| Read-only memory | The agent should read memory but not generate new memory after the run. |

463| `Memory(read=None)` | The run should generate memory without using existing memory. |645| Generate-only memory | The run should generate memory without using existing memory. |

464| `MemoryReadConfig` | You need to disable live updates with `live_update=False`. |646| Read config | You need to disable live updates. |

465| `MemoryGenerateConfig` | You need to tune generation, such as `extra_prompt`. |647| Generate config | You need to tune generation, such as the extra prompt. |

466| `MemoryLayoutConfig` | Agents need isolated memory layouts in the same sandbox workspace. |648| Layout config | Agents need isolated memory layouts in the same sandbox workspace. |

467 649 

468By default, memory artifacts live in the sandbox workspace:650By default, memory artifacts live in the sandbox workspace:

469 651 


491session state, starting from a snapshot, or mounting persistent storage such as673session state, starting from a snapshot, or mounting persistent storage such as

492S3.674S3.

493 675 

494For multi-turn sandbox chats, use a stable SDK `Session` such as676For multi-turn sandbox chats, use a stable SDK session together with the same

495`SQLiteSession(...)` together with the same live sandbox session. Memory groups677live sandbox session. Memory groups runs by the explicit conversation ID, then

496runs by `conversation_id`, then SDK `Session.session_id`, then678the SDK session ID, then the run group ID, and finally a generated per-run ID.

497`RunConfig.group_id`, and finally a generated per-run ID. The sandbox session679The sandbox session ID identifies the live workspace; it's not the memory

498ID identifies the live workspace; it's not the memory conversation ID.680conversation ID.

499 681 

500For runnable examples, see [`memory.py`][sdk-example-memory] for a local682For runnable examples, see the TypeScript [memory guide][sdk-js-sandbox-memory],

501snapshot flow, [`memory_s3.py`][sdk-example-memory-s3] for S3-backed memory683plus Python [`memory.py`][sdk-example-memory] for a local snapshot flow,

502storage, and [`memory_multi_agent_multiturn.py`][sdk-example-memory-multi-agent]684[`memory_s3.py`][sdk-example-memory-s3] for S3-backed memory storage, and

503for separate memory layouts across agents.685[`memory_multi_agent_multiturn.py`][sdk-example-memory-multi-agent] for separate

686memory layouts across agents.

504 687 

505## Compose sandbox agents688## Compose sandbox agents

506 689 


510workspace-heavy part of a workflow to a sandbox agent. The top-level run693workspace-heavy part of a workflow to a sandbox agent. The top-level run

511continues, but the sandbox agent becomes the active agent for the next turn.694continues, but the sandbox agent becomes the active agent for the next turn.

512 695 

513Use `agent.as_tool()` when an outer orchestrator should call one or more696Use agents as tools when an outer orchestrator should call one or more sandbox

514sandbox agents as nested tools. Each sandbox tool-agent can have its own697agents as nested tools. Each sandbox tool-agent can have its own sandbox run

515`RunConfig(sandbox=SandboxRunConfig(...))`, sandbox client, manifest, and698configuration, sandbox client, manifest, and provider options.

516provider options.

517 699 

518For examples, see [`handoffs.py`][sdk-example-handoffs] and700For examples, see [`handoffs.py`][sdk-example-handoffs] and

519[`sandbox_agents_as_tools.py`][sdk-example-agents-as-tools].701[`sandbox_agents_as_tools.py`][sdk-example-agents-as-tools].


533| Blaxel | `BlaxelSandboxClient` | <a href="https://docs.blaxel.ai/Sandboxes/Overview">Sandbox overview</a> |715| Blaxel | `BlaxelSandboxClient` | <a href="https://docs.blaxel.ai/Sandboxes/Overview">Sandbox overview</a> |

534| Cloudflare | `CloudflareSandboxClient` | <a href="https://developers.cloudflare.com/sandbox/">Sandbox documentation</a><br /><a href="https://docs.cloudflare.com/sandbox/tutorials/openai-agents/">OpenAI Agents tutorial</a><br /><a href="https://github.com/cloudflare/sandbox-sdk/tree/main/bridge/examples">Sandbox Bridge examples</a> |716| Cloudflare | `CloudflareSandboxClient` | <a href="https://developers.cloudflare.com/sandbox/">Sandbox documentation</a><br /><a href="https://docs.cloudflare.com/sandbox/tutorials/openai-agents/">OpenAI Agents tutorial</a><br /><a href="https://github.com/cloudflare/sandbox-sdk/tree/main/bridge/examples">Sandbox Bridge examples</a> |

535| Daytona | `DaytonaSandboxClient` | <a href="https://www.daytona.io/docs/en/sandboxes/">Sandbox documentation</a><br /><a href="https://www.daytona.io/docs/en/guides/openai-agents/openai-agents-sdk-with-sandboxes">OpenAI Agents SDK guide</a> |717| Daytona | `DaytonaSandboxClient` | <a href="https://www.daytona.io/docs/en/sandboxes/">Sandbox documentation</a><br /><a href="https://www.daytona.io/docs/en/guides/openai-agents/openai-agents-sdk-with-sandboxes">OpenAI Agents SDK guide</a> |

536| Docker | `DockerSandboxClient` | <a href="https://docs.docker.com/">Docker documentation</a><br /><a href="https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/docker/docker_runner.py">Docker SDK example</a> |718| Docker | `DockerSandboxClient` | <a href="https://docs.docker.com/">Docker documentation</a><br /><a href="https://github.com/openai/openai-agents-js/blob/main/examples/docs/sandbox-agents/docker-client.ts">TypeScript Docker SDK example</a><br /><a href="https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/docker/docker_runner.py">Python Docker SDK example</a> |

537| E2B | `E2BSandboxClient` | <a href="https://e2b.dev/docs">Sandbox documentation</a><br /><a href="https://e2b.dev/docs/agents/openai-agents-sdk">OpenAI Agents SDK guide</a><br /><a href="https://e2b.dev/blog/e2b-is-now-in-agents-sdk">Launch blog</a> |719| E2B | `E2BSandboxClient` | <a href="https://e2b.dev/docs">Sandbox documentation</a><br /><a href="https://e2b.dev/docs/agents/openai-agents-sdk">OpenAI Agents SDK guide</a><br /><a href="https://e2b.dev/blog/e2b-is-now-in-agents-sdk">Launch blog</a> |

538| Modal | `ModalSandboxClient` | <a href="https://modal.com/docs/guide/sandboxes">Sandbox guide</a><br /><a href="https://modal.com/blog/building-with-modal-and-the-openai-agent-sdk">Integration blog</a><br /><a href="https://github.com/modal-labs/openai-agents-python-example">Example repo</a><br /><a href="https://github.com/modal-labs/openai-agents-python-example?tab=readme-ov-file#modal-extension-reference">Modal extension reference</a> |720| Modal | `ModalSandboxClient` | <a href="https://modal.com/docs/guide/sandboxes">Sandbox guide</a><br /><a href="https://modal.com/blog/building-with-modal-and-the-openai-agent-sdk">Integration blog</a><br /><a href="https://github.com/modal-labs/openai-agents-python-example">Example repo</a><br /><a href="https://github.com/modal-labs/openai-agents-python-example?tab=readme-ov-file#modal-extension-reference">Modal extension reference</a> |

539| Runloop | `RunloopSandboxClient` | <a href="https://docs.runloop.ai/docs/devboxes/overview">Devbox overview</a><br /><a href="https://docs.runloop.ai/docs/devboxes/tunnels">Tunnels</a> |721| Runloop | `RunloopSandboxClient` | <a href="https://docs.runloop.ai/docs/devboxes/overview">Devbox overview</a><br /><a href="https://docs.runloop.ai/docs/devboxes/tunnels">Tunnels</a> |

540| Unix-local | `UnixLocalSandboxClient` | <a href="https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/unix_local_runner.py">Local SDK example</a> |722| Unix-local | `UnixLocalSandboxClient` | <a href="https://github.com/openai/openai-agents-js/blob/main/examples/docs/sandbox-agents/basic.ts">TypeScript local SDK example</a><br /><a href="https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/unix_local_runner.py">Python local SDK example</a> |

541| Vercel | `VercelSandboxClient` | <a href="https://vercel.com/docs/vercel-sandbox">Sandbox documentation</a><br /><a href="https://vercel.com/kb/guide/building-an-agent-with-openai-agents-sdk-and-vercel-sandbox">OpenAI Agents SDK guide</a><br /><a href="https://vercel.com/templates/template/openai-agents-sdk-with-fastapi">FastAPI template</a><br /><a href="https://github.com/vercel-labs/openai-agents-fastapi-starter">Sample app</a> |723| Vercel | `VercelSandboxClient` | <a href="https://vercel.com/docs/vercel-sandbox">Sandbox documentation</a><br /><a href="https://vercel.com/kb/guide/building-an-agent-with-openai-agents-sdk-and-vercel-sandbox">OpenAI Agents SDK guide</a><br /><a href="https://vercel.com/templates/template/openai-agents-sdk-with-fastapi">FastAPI template</a><br /><a href="https://github.com/vercel-labs/openai-agents-fastapi-starter">Sample app</a> |

542 724 

543[sdk-example-agents-as-tools]: https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/sandbox_agents_as_tools.py725[sdk-example-agents-as-tools]: https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/sandbox_agents_as_tools.py


554[sdk-example-sandbox-resume]: https://github.com/openai/openai-agents-python/tree/main/examples/sandbox/tutorials/sandbox_resume736[sdk-example-sandbox-resume]: https://github.com/openai/openai-agents-python/tree/main/examples/sandbox/tutorials/sandbox_resume

555[sdk-example-unix-local-runner]: https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/unix_local_runner.py737[sdk-example-unix-local-runner]: https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/unix_local_runner.py

556[sdk-example-vision-clone]: https://github.com/openai/openai-agents-python/tree/main/examples/sandbox/tutorials/vision_website_clone738[sdk-example-vision-clone]: https://github.com/openai/openai-agents-python/tree/main/examples/sandbox/tutorials/vision_website_clone

739[sdk-js-example-basic]: https://github.com/openai/openai-agents-js/blob/main/examples/docs/sandbox-agents/basic.ts

740[sdk-js-example-resume]: https://github.com/openai/openai-agents-js/blob/main/examples/docs/sandbox-agents/resume-session-state.ts

741[sdk-js-sandbox-clients]: https://openai.github.io/openai-agents-js/guides/sandbox-agents/clients

742[sdk-js-sandbox-memory]: https://openai.github.io/openai-agents-js/guides/sandbox-agents/memory