rwx sandbox
Execute code in a remote sandbox, useful for running complex remote environments or testing untrusted AI-generated code.
An rwx sandbox is a persistent environment that is set up using the same run definitions used for CI/CD, which also means that sandboxes benefit from the same content-based caching, resulting in fast startup of exactly the environment you need for testing.
Sandboxes are unique based on the combination of:
- Their RWX run status
- Your current local working directory
- Your current git branch
- The sandbox configuration file used to start them
This means that repeated calls to rwx sandbox exec with the same combination of working directory, branch, and config file will result in the same sandbox being used, and if you call rwx sandbox start with the same combination, it will confirm whether you want to use the existing one or start a new one.
Sandboxes are designed to work well with coding agents that run in parallel on separate git worktrees, since each worktree will live in its own working directory and therefore can spin up its own sandbox on RWX.
You may also want to consider defining a custom skill that tells your coding agent how your team uses RWX sandboxes. A simple skill might look like this:
---
name: rwx-sandbox
description: Run commands in RWX cloud sandbox. Use when user mentions "sandbox".
---
# RWX Sandbox
Run `rwx sandbox --help` for command documentation. Use `--help` on subcommands for details.
When finished using the sandbox, run `rwx sandbox stop`.
Usage
rwx sandbox <command> [flags]
Subcommands
- exec - Execute a command in a sandbox
- init - Initialize a sandbox configuration file
- list - List sandbox sessions with status
- reset - Stop and restart a sandbox
- start - Start a sandbox without executing a command
- stop - Stop a sandbox session
Global Options
--output <format>
Output format: text or json. Defaults to text.