The Celesto SDK ships with two ready-made sandbox providers for the OpenAI Agents SDK. With one of them plugged in, an OpenAIDocumentation Index
Fetch the complete documentation index at: https://docs.celesto.ai/llms.txt
Use this file to discover all available pages before exploring further.
SandboxAgent can read files, run shell commands, and create artifacts in an isolated computer instead of on your laptop or server.
You get to pick where that computer lives:
- Hosted Celesto computer for cloud runs you can share, persist, and resume from any machine.
- Local SmolVM sandbox for fast, private runs that stay on your own hardware.
SandboxAgent, SandboxRunConfig, Runner), so you can swap providers without changing the rest of your agent code.
When to use this
Reach for these integrations when you want an OpenAI agent to:- Run untrusted or model-generated commands without touching your machine.
- Inspect, edit, or build files in a clean, throwaway workspace.
- Pause a session, save it, and resume it later from a different process.
Installation
Install the Celesto SDK with theopenai-agents extra. This pulls in the OpenAI Agents SDK and SmolVM alongside Celesto:
The hosted provider needs a Celesto API key. Set
CELESTO_API_KEY or pass api_key= when you create the client. The SmolVM provider runs locally and does not need an API key.Hosted Celesto sandboxes
UseCelestoSandboxClient when you want OpenAI to spin up a fresh Celesto computer for the agent’s session. The client creates the computer on create(), runs every shell command and file operation against it, and tears it down on delete().
Define your SandboxAgent
A
SandboxAgent is an OpenAI agent that always works inside a sandbox you provide.Client options
Pass aCelestoSandboxClientOptions to control how the computer is created.
Number of virtual CPUs for the new computer. Range: 1-16.
Memory in MB for the new computer. Range: 512-32768.
OS image to boot. Match this to the Computers API images.
Reuse an existing Celesto computer instead of creating a new one. When set, the session attaches to that computer and starts it if needed.
Whether to delete the computer when the session closes. Defaults to
true if the client created the computer, and false if you passed in an existing computer_id.Authenticate the client
By defaultCelestoSandboxClient uses your CELESTO_API_KEY environment variable. You can also pass credentials directly or share an existing Celesto instance:
Resume a session later
Save the session state when your process exits and resume it on the next run. This keeps the same computer attached to the same agent identity:Local SmolVM sandboxes
SmolVMSandboxClient runs the agent in a SmolVM on your own machine. It is a drop-in replacement for CelestoSandboxClient and uses the same SandboxAgent, SandboxRunConfig, and Runner flow.
Client options
OS image to boot inside SmolVM (for example,
ubuntu-24.04). Defaults to SmolVM’s default image.Which SmolVM backend to use (such as
firecracker or qemu). Defaults to SmolVM’s auto-selected backend for your platform.Memory in MB for the local sandbox.
Disk size in MB for the local sandbox.
Guest ports to expose to your host. Use this when the agent runs a server (for example, a dev server or web app) you want to reach from your machine.
Reuse an existing SmolVM instead of creating a new one. The session attaches to that VM and starts it if needed.
Whether to delete the VM when the session closes. Defaults to
true if the client created the VM, and false if you passed in an existing vm_id.Choosing between hosted and local
Hosted Celesto
Use when you want managed infrastructure, shared computers, longer-lived sessions, or runs that originate from servers without local virtualization.
Local SmolVM
Use when you want fast iteration, private runs, no API key, or development on a single workstation.
Common patterns
Read and write files in the sandbox
SandboxAgent operations call read() and write() on the session. The Celesto and SmolVM providers map those calls to the underlying computer or VM:
Save and restore the workspace
Both providers can snapshot the sandbox workspace as a tarball and rehydrate it later:Troubleshooting
ImportError: OpenAI Agents support is not installed
ImportError: OpenAI Agents support is not installed
The integration is an optional extra. Install it with
pip install "celesto[openai-agents]". This adds the openai-agents and smolvm packages alongside Celesto.The agent can't find files I expected
The agent can't find files I expected
Files written through
session.write() land inside the sandbox workspace, not on your host. Use session.read() or session.persist_workspace() to pull them out.Commands time out
Commands time out
Long-running commands need a longer timeout. Pass
timeout= when calling sandbox operations, or split the work into shorter steps in the agent’s instructions.