For the complete Render documentation index, fetch https://render.com/llms.txt. Every docs page is also available as Markdown at https://render.com/docs/{slug}.md.

  • Docs
  • Changelog
Sign in
Get started

Intro to Render Sandboxes

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

View as Markdown
Open in ChatGPT
Open in Claude

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

  1. You create a sandbox with the Render CLI or SDK.
  2. Inside the sandbox, you (and your agents) can execute commands and manage files.
  3. When you're finished with the sandbox, terminate it.
    • A sandbox also terminates automatically when its configured runtime timeout expires.
    • You can disable a sandbox's timeouts so it runs indefinitely.

Termination permanently deletes the sandbox's local filesystem. Before terminating, you can download any files you need or capture a snapshot to reuse state in a new sandbox.

Core features

  • Isolated execution

    Execute commands and agent-generated code in a contained environment and filesystem.

  • High concurrency

    Run up to 1,000 sandboxes concurrently per sandbox group, with higher limits on request.

  • Flexible lifetime

    Suspend when idle and resume on demand. Or disable timeouts to run indefinitely.

  • Reusable snapshots

    Capture sandbox state to reuse a prepared filesystem or resume a process in a new sandbox.

  • File transfers

    Upload any code and files, then download the output your sandbox produces.

  • Network controls

    Configure access to allow outbound traffic to a specific set of destinations (or none at all).

  • Custom images

    Import a Docker image to customize sandboxes with specific tools and libraries.

  • Configurable compute

    Choose a compute plan with the CPU and RAM each workload needs.

Quickstart

1. Install the CLI or SDK

Requires Render CLI version 2.34.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.

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.9.0 or later:

After installing, make sure @renderinc/sdk is listed as a dependency in your package.json file at version ^1.9.0 or later.

From your Python project directory:

If you already have the SDK installed, make sure you're using version 1.10.0 or later:

After installing, make sure to add render>=1.10.0 as a dependency in your application's requirements.txt, pyproject.toml, or equivalent.

Version 1.9.0 and later of the Python SDK require Python 3.11 or later.

2. Set up credentials

  1. Create an API key from your Account Settings page in the Render Dashboard.

    Set RENDER_API_KEY wherever the CLI or SDK will run, replacing rnd_abc123 with your key:

  2. Find your workspace ID at the top of its Settings page in the Render Dashboard.

    Replace tea-def456 with that ID in the command for your tool:

3. Create a sandbox and execute a command

The following example creates a sandbox with a five-minute runtime timeout, 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 snapshots and restore from them to reuse files, installed packages, and running processes in new sandboxes.
  • Configure sandbox behavior, including compute, timeouts, 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:

  • Sandboxes CLI reference
  • Sandboxes SDK for TypeScript
  • Sandboxes SDK for Python

Limits

For available compute plans, sandbox runtime timeouts, 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.

Interested in early access to some of these additions?

Reach out with details about your use case:

Talk to our teamTalk to our team

View as Markdown
Open in ChatGPT
Open in Claude
Intro to Render Sandboxes
  • At a glance
  • Core features
  • Quickstart
    • 1. Install the CLI or SDK
    • 2. Set up credentials
    • 3. Create a sandbox and execute a command
  • Next steps
  • References
  • Limits
  • Beta limitations
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits & pricing
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Upload & download files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • API keys
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render
All Systems Operational
© Render Inc. All rights reserved.
shell
$ brew update
$ brew install render
shell
$ winget install render.cli
shell
$ curl -fsSL https://raw.githubusercontent.com/render-oss/cli/refs/heads/main/bin/install.sh | sh
shell
$ git clone git@github.com:render-oss/cli.git
$ cd cli
$ go build -o render
shell
$ npm install @renderinc/sdk@latest
shell
$ npm install @renderinc/sdk@latest
shell
$ pip install render
shell
$ pip install --upgrade render
shell
$ export RENDER_API_KEY='rnd_abc123'
shell
$ render workspace set tea-def456
shell
$ export RENDER_WORKSPACE_ID='tea-def456'
shell
# Create a sandbox and wait until it's running.
$ render sandboxes create --timeout=300 --wait
# Replace sbx-abc123 with the ID returned by create.
$ render sandboxes exec sbx-abc123 -- echo hello from Render
# Terminate the sandbox.
$ render sandboxes stop sbx-abc123 --confirm
index.ts
typescript
import { Render } from '@renderinc/sdk'
const sandboxes = new Render().sandboxes
const sandbox = await sandboxes.create({ timeoutSeconds: 300, wait: true })
try {
const events = await sandboxes.exec(sandbox.id, 'echo hello from Render')
for await (const event of events) {
if (event.type === 'output') {
const stream = event.stream === 'stderr' ? process.stderr : process.stdout
stream.write(event.data)
} else if (event.type === 'exit') {
console.log(`Exit code: ${event.exit_code}`)
}
}
} finally {
await sandboxes.terminate(sandbox.id)
}
main.py
python
import sys
from render import Render
from render.sandbox import SandboxExecExit, SandboxExecOutput
sandboxes = Render().sandboxes
sandbox = sandboxes.create(timeout_seconds=300, wait=True)
try:
for event in sandboxes.exec(sandbox.id, "echo hello from Render"):
if isinstance(event, SandboxExecOutput):
stream = sys.stderr if event.stream == "stderr" else sys.stdout
print(event.data, end="", file=stream, flush=True)
elif isinstance(event, SandboxExecExit):
print(f"Exit code: {event.exit_code}")
finally:
sandboxes.terminate(sandbox.id)
main.py
python
import asyncio
import sys
from render import RenderAsync
from render.sandbox import SandboxExecExit, SandboxExecOutput
async def main():
sandboxes = RenderAsync().sandboxes
sandbox = await sandboxes.create(timeout_seconds=300, wait=True)
try:
async for event in sandboxes.exec(sandbox.id, "echo hello from Render"):
if isinstance(event, SandboxExecOutput):
stream = sys.stderr if event.stream == "stderr" else sys.stdout
print(event.data, end="", file=stream, flush=True)
elif isinstance(event, SandboxExecExit):
print(f"Exit code: {event.exit_code}")
finally:
await sandboxes.terminate(sandbox.id)
asyncio.run(main())