Spin Up a Workspace
- Omit
--nameto auto-generate a slug. - Pass
--team-idif you need to charge a different workspace. - Add
--yesto skip the confirmation prompt in automation.
Idle Timeout
--timeout-minutes caps the total lifetime. --idle-timeout-minutes terminates the sandbox sooner when nothing is using it — useful for agent workflows that might forget to clean up.
exec, upload, download, or file-read request lands within the idle window. Each new request resets the clock; long-running execs stay pinned for their full duration.
- Disabled by default — set
--idle-timeout-minutesto opt in. - Must satisfy
1 ≤ idle ≤ timeoutandidle ≤ 1440. - SSH sessions do not count as activity yet, so a sandbox with an active SSH connection can still be reaped if you set an idle timeout.
prime sandbox get and on the dashboard reads Idle Timeout.
Idle timeout is coming soon to VM sandboxes. Use --container for now.
Environment Variables & Secrets
Use--env for general configuration and --secret for sensitive values. Both accept KEY=VALUE format and can be specified multiple times.
Start Command
Pass a start command after-- to run your own process when the sandbox boots. There is no shell, so every argument must be its own token:
&&), invoke a shell explicitly:
prime sandbox run.
The legacy shell-string form, --start-command "python serve.py --port 8000", works only on container sandboxes (--container).
Network Isolation
Sandboxes can restrict outbound traffic at creation time. Use an allowlist or a denylist.example.com, *.example.com) or IPv4 addresses/CIDRs; IPv6 is not supported. Update the rules on a running sandbox with prime sandbox network <sandbox-id> --allow ... / --deny ....
Network isolation is not available on container sandboxes, which always have full outbound access.
Custom Docker Images
You can build and push custom Docker images to use in sandboxes. See the Prime Images guide for details.Check In on Sandboxes
prime sandbox run --user is coming soon to VM sandboxes. Use --container for now.
Organize with Labels
Labels help you tag and manage groups of sandboxes:- Grouping related experiments or workflows
- Tracking which team or project owns a sandbox
- Bulk cleanup by category (dev, staging, test, etc.)
Move Files Around
prime sandbox reset-cache and retry—the CLI refreshes the gateway token for you.
Expose Ports
Make services running inside your sandbox accessible from the internet. Both HTTP and TCP protocols are supported. Ports must be in the range 22–9000. Ports 8080, 2222, and 8081 cannot be exposed.HTTP
Expose an HTTP service and get a public HTTPS URL:--container for now.
TCP
Expose a raw TCP service and get a publichost:port endpoint:
external_endpoint (host:port) and external_port instead of a URL. Connect using any TCP client.
Use prime sandbox list-ports <sandbox-id> to see both HTTP and TCP exposures along with their protocols and external ports.
TCP exposure is coming soon to VM sandboxes. Use --container for now.
SSH
Connect to a running sandbox with an interactive shell:--container for now.
Clean Up in Bulk
--label, or --all. Deletes are batched behind the scenes, and the CLI prints success/failure per sandbox so you can re-run failed IDs.
Need more ideas? Check the runnable scripts in prime-cli/examples/ for CLI walkthroughs you can customize.
Quick Troubleshooting
- Sandbox stuck in
PROVISIONING? Wait a minute, then rerunprime sandbox list --status RUNNING. If it stays pending, delete and recreate from a known-good image. - Hitting auth issues?
prime sandbox reset-cacherefreshes the gateway token after you rotate API keys.