What are Sandboxes?
Sandboxes are isolated execution environments. They are temporary, disposable computers that are spin up when needed and shut down when finished.
When you run AI-generated code, sandboxes provide:
- Isolation: Code runs in its own container, separated from your system
- Security: Malicious code can’t access your files or network
- Reproducibility: Each sandbox starts fresh with a clean state
- Scalability: Spin up hundreds of sandboxes simultaneously
Sandboxes in Environments
Environments can be powerful with custom tools alone, but sandboxes unlock a new level of capability by giving agents access to a full computer environment.
Sandboxes enable agents to:
- Execute code: Run Python, JavaScript, shell scripts, and more
- Use command-line tools: Install packages, run git commands, process files
- Test solutions: Write code, run it, debug errors, and iterate
- Access file systems: Read, write, and manipulate files across multiple tool calls
For example, in a mathematics environment, an agent might:
- Write Python code to solve an equation
- Execute the code in a sandbox
- Get the result back
- Submit the final answer
This workflow requires code execution, which sandboxes provide. Without sandboxes, you’d need to define custom tools for mathematical operations instead.
Sandbox Providers
ORS environments work with any sandbox provider.
OpenReward provides a sandbox solution that plays nicely with mounting agent filesystems. We show how to use this in
the Sandboxes documentation, as well as the Building agentic environments tutorial.
But ORS environments work just as well with standard sandbox providers in the community. Some examples include:
All three providers work the same way from your agent’s perspective. The only difference is how you initialize the sandbox in your environment.
Work in Progress. Right now OpenReward environment files can only be mounted to OpenReward sandboxes, but we are working on a solution that allows you to mount it
to any sandbox provider. Likewise, we are working on a way to mount external filesystems (e.g. AWS S3, GCP, Azure) to OpenReward sandboxes.