OpenAI Agents SDK Sandboxes: Isolation and Its Limits

Published · Updated • articles
OpenAIAI AgentsCybersecurity

The official Sandbox Agents documentation describes Agents SDK workflows that use files, commands and resumable workspace state with a selected sandbox provider. It distinguishes those workflows from a basic SDK runtime and an OpenAI-managed Agents API harness.

Correction, 21 October 2026: This page previously claimed sandboxing ensured an agent could never leak data or disrupt operations. That guarantee was unsupported and has been removed. A sandbox's protection depends on the environment and the access granted to it.

Define the boundary you are relying on

A sandbox can separate an execution workspace from other resources. It does not answer every question about what the agent can read or do. A mounted directory, a network destination or an external tool can create a path beyond the local process boundary.

OpenAI's self-hosted environment documentation concerns the Agents API rather than the SDK, but illustrates an important credential distinction: keep the application API key outside the sandbox and use an appropriately scoped environment credential for its intended connection. Do not copy configuration between those two products without checking the relevant documentation.

Review the complete action path

Before relying on an agent workflow, record:

SurfaceQuestion to answer
FilesWhich paths can be read or modified, and what persists after the run?
NetworkWhich destinations are reachable, including through tools outside the sandbox?
CredentialsWhat can each credential authorize, and can generated code read it?
ActionsWhich changes affect external systems and how are they controlled?
RecoveryWhat can be restored after a mistake, and what requires a separate corrective action?

The table is a review method, not a claim about every provider's default configuration. A workspace snapshot should not be assumed to reverse a message, payment or remote database write that already occurred.

Test the intended environment

Use a disposable task and verify both an allowed action and an action intended to be denied. Keep the configuration and observations with the result. Retest when mounts, tools, credentials or provider settings change, because the effective boundary can change even when the model stays the same.

For related application-layer failures, see our analysis of agent trust surfaces. AI Mastery has not penetration-tested every provider supported by the SDK; this article explains the documented architecture and the questions a deployment review should resolve.

Free interactive tools for the decisions this piece raises.

Related Reading