Intro to Render Sandboxes
Run untrusted code in an isolated, on-demand environment.
Render Sandboxes is in public beta.
APIs, defaults, and limits might change during the beta period.
Render Sandboxes provides managed, ephemeral environments for executing untrusted code. Use sandboxes for AI agents, code interpreters, builds, tests, and other workloads that need an isolated OS environment.
At a glance
- You create a sandbox with the Render CLI or SDK.
- Inside the sandbox, you (and your agents) can execute commands and manage files.
- When your workload completes, terminate the sandbox.
- If you don't, it terminates automatically when its configured lifetime expires.
Termination permanently deletes the sandbox's filesystem. Before terminating, you can download any files you need or capture a snapshot to reuse state in a new sandbox.
Core features
Quickstart
1. Install the CLI or SDK
Requires Render CLI version 2.33.0 or later.
Use any of the following methods to install the Render CLI or upgrade to the latest version:
Homebrew installation
Run the following commands:
WinGet installation
Run the following command:
Installing with curl
Run the following command:
Direct download
- Open the CLI's GitHub releases page.
- Download the executable that corresponds to your system's architecture.
If you use an architecture besides those provided, you can build from source instead.
Building from source
We recommend building from source only if no other installation method works for your system.
-
Install the Go programming language if you haven't already.
-
Clone and build the CLI project with the following commands:
After installation completes, open a new terminal tab and run render with no arguments to confirm.
From your TypeScript project directory:
(Or pnpm install, bun add, etc.)
If you already have the SDK installed, make sure you're using version ^1.5.0 or later:
After installing, make sure @renderinc/sdk is listed as a dependency in your package.json file at version ^1.5.0 or later.
From your Python project directory:
If you already have the SDK installed, make sure you're using version 1.5.0 or later:
After installing, make sure to add render>=1.5.0 as a dependency in your application's requirements.txt, pyproject.toml, or equivalent.
2. Set up credentials
-
Create an API key from your Account Settings page in the Render Dashboard.
-
Set the following environment variables wherever the CLI or SDK will run, replacing values as indicated:
- Replace
rnd_abc123with your API key. - Replace
tea-def456with your workspace's ID, available at the top of its Settings page in the Render Dashboard.
- Replace
-
For the CLI, also set your active workspace:
- Replace
tea-abc123with your workspace's ID.
- Replace
3. Create a sandbox and execute a command
The following example creates a sandbox with a five-minute lifetime, waits until it's running, executes a basic echo command, then terminates the sandbox:
Next steps
After creating your first sandbox, explore how to:
- Execute commands, process their output, and handle command failures.
- Upload and download files, including entire directories.
- Capture and restore snapshots to reuse files, installed packages, and running processes in new sandboxes.
- Configure sandbox behavior, including compute, lifetime, environment variables, and network access.
- Manage sandbox groups to organize workloads and set separate concurrency limits.
References
For detailed command and SDK reference material, see:
Limits
For available compute plans, sandbox lifetimes, concurrency, and API rate limits, see Limits for Render Sandboxes.
Beta limitations
We'll address these limitations during the beta period:
- Sandboxes do not yet support private networking to connect to your other Render services and datastores.
- Sandboxes do not yet provide public URLs for accessing applications running inside them.
- Credential brokering is not yet generally available.
- Scoped API keys are not yet generally available.
Interested in early access to some of these additions?
Reach out with details about your use case: