Skip to main content
This page covers creating sandboxes and managing them. For background on what sandboxes are and how isolation works, refer to Architecture.
Docker must be running before you create a gateway or sandbox. If it is not, the CLI returns a connection-refused error (os error 61). Start Docker and try again.

Create a sandbox

1

Run the create command

Create a sandbox with a single command. To create a sandbox with Claude:
Every sandbox requires a gateway. If none exists, the CLI auto-bootstraps a local gateway.
2

Wait for provisioning

The sandbox moves through the Provisioning phase while the runtime sets up the environment, injects credentials, and applies your policy. When it reaches Ready, the agent process is active.

Choose your agent

Pass any supported agent as the trailing command:

Use the --from flag

Create a sandbox from a community package, a local directory, or a container image:
The CLI resolves community names against the OpenShell Community catalog, pulls the bundled Dockerfile and policy, builds the image locally, and creates the sandbox. For the full catalog, refer to Community sandboxes.

Run on a remote gateway

If you plan to run sandboxes on a remote host or a cloud-hosted gateway, set up the gateway first, then create the sandbox as normal. Refer to Gateways for deployment options.

Request GPU resources

GPU passthrough is experimental. Expect rough edges and breaking changes.
Add --gpu to request GPU resources:
NVIDIA drivers and the NVIDIA Container Toolkit must be installed on the host. The sandbox image must also include the appropriate GPU drivers and libraries.

Apply a policy at creation

Pass a policy YAML file with --policy:
To avoid passing --policy every time, set the OPENSHELL_SANDBOX_POLICY environment variable. Refer to Policies for the full policy workflow.

Forward a port at creation

Connect to a sandbox

Open an SSH session into a running sandbox:

Monitor and debug

List all sandboxes:
Get detailed information about a specific sandbox:
Stream sandbox logs to monitor agent activity and diagnose policy decisions:

Terminal UI

OpenShell Terminal combines sandbox status and live logs in a single real-time dashboard:
Navigate with Tab to switch panels, j/k to move through lists, Enter to select, and : for command mode. Use it to spot blocked connections marked action=deny and inference-related proxy activity. If a connection is blocked unexpectedly, add the host to your network policy — refer to Policies.

Port forwarding

Forward a local port to a running sandbox to access services inside it, such as a web server or database:
List and stop active forwards:

Transfer files

Upload files from your host into the sandbox:
Download files from the sandbox to your host:
You can also upload files at creation time with the --upload flag on openshell sandbox create.

Delete sandboxes

Deleting a sandbox stops all processes, releases resources, and purges injected credentials:

Next steps

Providers

Supply API keys and tokens to sandboxes.

Policies

Control what the agent can access on the network and filesystem.

Community sandboxes

Use a pre-built environment from the community catalog.

GitHub sandbox tutorial

End-to-end walkthrough with scoped GitHub repo access.