Render Sandboxes

Run untrusted code in an isolated, on-demand environment.

Render Sandboxes is in early access.

APIs, defaults, and limits might change during the early access period. Before using sandboxes in production workloads, discuss your use case with your Render contact.

Request access

Render Sandboxes provides managed, ephemeral environments for executing untrusted code. Spin up a sandbox, install what you need, and run your workload. Render handles all of the provisioning and cleanup.

  • Enable agents to install packages, write files, and run generated code without touching your infrastructure.
  • Execute user-submitted code to support tools such as code interpreters and notebook backends.
  • Run jobs that benefit from a complete OS, such as builds, tests, data transformations, and scripts.

At a glance

  1. You create a sandbox with the Render SDK or CLI.
  2. Inside the sandbox, you (and your agents) can run commands and manage files without exposing your production infrastructure to untrusted code.
  3. When your workload completes, you can terminate the sandbox.
    • If you don't terminate the sandbox, it eventually times out according to your settings.

Sandboxes have an ephemeral filesystem.

When you terminate a sandbox, its filesystem state is permanently lost. To preserve data from a sandbox, see Snapshots.

Quickstart

1. Confirm access

During the early access period, Render is rolling out sandbox support to select workspaces.

To confirm whether your workspace is enabled, open the + New menu in the upper right of the Render Dashboard:

Confirming sandbox support in the Render Dashboard

If you don't see the Sandbox Group option, Render Sandboxes is not yet enabled for your workspace. Reach out to your Render contact and provide your Workspace ID, available from the top of your workspace's Settings page.

If Render Sandboxes is enabled for your workspace, you're ready to proceed.

2. Install supported clients

You can create and manage sandboxes with the Render CLI or the Render SDK (available for TypeScript and Python).

Install any combination of clients you want to use:

Requires Render CLI version 2.28.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
  1. Open the CLI's GitHub releases page.
  2. 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.

  1. Install the Go programming language if you haven't already.

  2. 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.

Requires Node.js 18+ and SDK version 1.2.0 or later.
Install with npm
Install with bun
Requires Python 3.10+ and SDK version 1.2.0 or later.
Install with pip
Install with uv

3. Configure credentials

Create an API key under Account Settings > API Keys, then export the key and your workspace ID:

Sandboxes require a valid Render API key and workspace ID to start successfully.

You can find your workspace's ID at the top of its Settings page in the Render Dashboard.

The SDKs read the workspace ID from RENDER_WORKSPACE_ID. To select the same workspace for the CLI, run:

Replace tea-abc123 with your workspace ID. In scripts, you can set the CLI's RENDER_WORKSPACE environment variable instead.

4. Create a sandbox, wait for it, and run a command

create returns while the sandbox is still starting. Wait until its status is running before the first exec.

SDK quickstarts

These single-file examples demonstrate the basic flow for creating a sandbox, waiting for it to finish starting, executing a command, and terminating the sandbox:

TypeScript
Python

Snapshots

A snapshot captures the state of a running sandbox. You can use a snapshot to reuse a prepared filesystem or resume a running process in a new sandbox. Creating a snapshot does not stop the source sandbox.

KindCapturesRestore requirements
filesystem (default)The writable filesystemCan restore using the available compute configuration
runtimeThe writable filesystem, memory, and CPU stateMust restore using the snapshot's plan value

Each snapshot belongs to the same sandbox group as its source sandbox. You can restore the snapshot only to a new sandbox in that group.

Snapshot creation returns before the capture completes. Wait for the snapshot's status to change to available before restoring it. If the status changes to failed, check the snapshot's error field.

Snapshots expire three days after creation by default. To determine when an individual snapshot expires, check its expires_at (Python) or expiresAt (TypeScript) value.

Capture and restore snapshots

You can capture the filesystem of an existing running sandbox in a snapshot, then restore that snapshot to create a new sandbox. Wait for the snapshot to become available before restoring it, and wait for the restored sandbox to become running before using it.

First, select the source sandbox's workspace with render workspace set.

To create a runtime snapshot, add --kind runtime to snapshots create. When you restore it, set --plan to the value of the snapshot's plan field.

Before running this example, configure your credentials.

To create a runtime snapshot, pass kind="runtime" to snapshots.create. When you restore it, pass plan=snapshot.plan to sandboxes.create. The sync client, Render, provides the same methods without await.

Before running this example, configure your credentials.

To create a runtime snapshot, pass kind: "runtime" to snapshots.create. When you restore it, pass plan: snapshot.plan to sandboxes.create.

The examples set a five-minute lifetime for the restored sandbox and terminate it after the workload completes. They do not delete the snapshot, so you can reuse it. If a polling deadline expires, check the snapshot or sandbox status before retrying because the operation might still complete.

List and delete snapshots

By default, snapshots get, snapshots list, and snapshots delete use the active workspace's default sandbox group. Pass --group sbg-... to use a different group.

The SDK requires a sandbox group ID for snapshot lookup, listing, and deletion. listGroups() returns zero or one group during the early access period.

The SDK requires a sandbox group ID for snapshot lookup, listing, and deletion. list_groups() returns zero or one group during the early access period.

You cannot delete a snapshot while its status is creating. Deleting a snapshot prevents future restores but does not affect sandboxes that you already restored from it. After the snapshot's expires_at (Python) or expiresAt (TypeScript), you can no longer retrieve or restore it. Snapshot lists omit deleted and expired snapshots.

References

For detailed command and SDK reference material, see:

Early access limits

These limits are subject to change during the early access period.

Render enforces the following resource limits for sandboxes. As indicated below, Render can raise certain limits on request.

PropertyEarly access limitCan be raised?

CPU per sandbox

2

☑️

Memory per sandbox

4 GB☑️

Filesystem storage per sandbox

10 GB☑️

Concurrent sandboxes per workspace

100☑️

API request rate

100 requests / minute☑️

Sandbox groups per workspace

1➖

Timeout per sandbox

24 hours

➖

Supported regions

1 (Oregon)➖

Feedback and support

During the early access period, share feedback with us via email or in your shared Slack channel. To help us investigate quickly, include:

  • Your workspace ID
  • The sandbox ID
  • The command or SDK method you ran
  • What you expected to happen
  • What happened instead, including relevant output or error messages