uv for the Python example.
Run your first sandbox
1
Grant access
Ask your administrator to create or update an Access Policy granting you Sandbox Admin to enable a runner. Users who only run sandboxes need Sandbox User. See Create an access policy.
2
Enable a runner
A runner schedules sandbox Pods on your cluster’s compute. Each cluster can host one managed runner.
- Open the Clusters page and select your cluster.
- In the Sandbox runner card, click Enable sandbox runner.
- Wait for Status to show Ready and Connection to show Connected, then select and copy the Runner ID.
3
Get a credential
On the Tokens page, click Create Token, complete the token details, and click Create. Copy the Token Secret, which is shown only once, and set it in your terminal:For token permissions and setup, see CoreWeave API access token.
4
Run a sandbox
Save the following as Run it with Python 3.11 and the sandbox client. The command installs them if needed:The example prints the following output and stops the sandbox when it finishes:Serverless is the default placement mode. Keep
hello.py, replacing [RUNNER-ID] with your runner’s ID. Set both placement_mode="cks" and runner_ids to target that runner:hello.py
Output
placement_mode="cks" on requests that must run on your cluster. For the TypeScript equivalent, see Select a placement mode.Optional: Manage runners with the CLI
The CoreWeave Intelligent CLI provides an alternative to the cloud console. Install it, then sign in with your API access token:CWSANDBOX_API_KEY instead.
To enable a runner on another cluster, choose a runner ID and start the creation wizard:
INSTALL to show READY and CONN to show CONNECTED. For REST API examples and deployment troubleshooting, see Deploy and manage a runner.
Optional: Customize the sandbox policy
The runner’s policy applies to sandboxes scheduled by that runner. Save this example aspolicy.json. It supplies CPU and memory defaults, limits resource requests, and leaves the default egress list empty. The lifetime default is 15 minutes. It isn’t a maximum.
policy.json
allowedEgress. The defaultEgress field alone sets defaults. See Configure a sandbox policy.
Optional: Disable the runner
Keep the runner enabled to create more sandboxes. When you no longer need it, stop its running sandboxes, then disable it using either interface:- Cloud console
- CLI
- Open your cluster’s Sandbox runner card.
- Click Disable sandbox runner and confirm.
Next steps
Explore the following guides:- Configure a sandbox policy: customize resources, network access, and security settings.
- Deploy and manage a runner: inspect, update, and troubleshoot runners.
- Sandbox placement and spillover: fall back between CKS and serverless capacity.
- Python client: execute commands, work with files, and manage sandbox lifecycles.