Skip to main content
The OpenAI Agents SDK is OpenAI’s framework for building agents with tool-use loops. Expose sandbox.commands.run as a function tool so every command the agent generates runs in an isolated VM instead of on your machine.

Setup

Wire the sandbox into the agent

The highlighted block defines a bash tool backed by the sandbox. Everything else is standard OpenAI Agents SDK usage.
Add equivalent tools for file reads/writes the same way; see Run commands and Read & write files.