OpenAI's Agents SDK Lets TypeScript Bots Actually Run Code in Sandboxes
OpenAI's TypeScript Agents SDK gains Sandbox Agents in beta, giving JS/TS agents a real filesystem, shell access, and resumable workspace state
Takeaways
- Sandbox Agents now in TypeScript beta: The openai-agents-js SDK adds
SandboxAgent, giving agents an isolated filesystem, shell, and resumable workspace state. - Replaces custom orchestration: The SDK's harness handles tool dispatch, multi-step execution, state persistence, and recovery between model turns automatically.
- Three sandbox clients supported:
UnixLocalSandboxClient(macOS/Linux),DockerSandboxClient, and hosted providers — swap with a single config change. - Full SDK feature set: Text agents, realtime (voice) agents, multi-agent handoffs, guardrails, sessions, human-in-the-loop, MCP tool support, and built-in tracing all included.
- Still in beta: API details may change; code mode and subagents are still in development for both TypeScript and Python.
- Free and open source: MIT license, available now via
npm install @openai/agents zod, requires Node.js 22+.
The OpenAI Agents SDK for JavaScript/TypeScript is a lightweight, provider-agnostic framework for building multi-agent workflows that supports OpenAI APIs and other providers. Its latest addition, Sandbox Agents, is now in beta for TypeScript after launching first in Python. The feature gives agents an isolated execution environment where they can actually manipulate files and run commands, rather than just describing what they would do.
What a Sandbox Agent actually is
A sandbox gives an agent an isolated Unix-like workspace with a filesystem, shell access, mounted data, and resumable state. The practical difference: instead of an agent that describes a fix, you get one that clones a repo, runs the failing test, applies a patch, verifies it passes, and returns a summary. Sandboxes make sense when the agent needs to manipulate files, run commands, mount a data source, produce artifacts, expose a service, or resume stateful work across sessions.
The architecture splits into two planes. The harness is the control layer around the model: it owns the agent loop, model calls, tool routing, handoffs, approvals, tracing, recovery, and run state. The sandbox is the execution layer where model-directed work reads and writes files, runs commands, installs dependencies, uses mounted storage, exposes ports, and snapshots state.
The problem it solves
Building a production AI agent that safely executes code previously meant assembling a model API client, a container runtime, credential isolation, state persistence, tool routing, and approval logic from scratch. Each piece was custom code with its own failure modes.