This guide walks through enabling sandboxes on a CoreWeave Kubernetes Service (CKS) cluster end to end. You’ll do the following:Documentation Index
Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
Use this file to discover all available pages before exploring further.
- Create a profile
- Enable a runner
- Run your first sandbox from the Python client
- Disable the runner when you’re done.
CoreWeave sandboxes are currently in limited availability. Contact CoreWeave Support or email [email protected] for access.
Prerequisites
For the administrator steps, complete the following:- A CKS cluster in your CoreWeave organization, in the
STATUS_RUNNINGstate. View your clusters and their status on the Clusters page in the cloud console. - The
SANDBOX_ADMINaction in Identity and Access Management (IAM), which lets you create profiles and runners. Create or update a policy that grants this action on the Access Policies page in the cloud console. - The CoreWeave Intelligent CLI installed and authenticated.
- The
SANDBOX_USERIAM action, which lets you create sandboxes against the data plane. GrantingSANDBOX_ADMINalso grantsSANDBOX_USER. - A CoreWeave API access token. For more information, see Manage API Access Tokens.
- Python 3.11 or newer in the environment that runs the SDK. The Python version inside the sandbox is independent and is set by the
container_imageyou pass toSandbox.run()or by the profile’s default.
Create a profile
A profile defines the execution environment for sandboxes a runner produces: namespace strategy, network policies, and pod constraints. Use the CoreWeave Intelligent CLI to create one before you enable a runner. The example profile below uses a per-user namespace strategy and denies all outbound network access from sandboxes. Adjust the network policy for your environment: switch the modetype to internet for unrestricted egress, allowlist to permit specific CIDRs, or org, profile, or user to scope traffic to other sandboxes you control. Available egress types are internet, user, org, profile, allowlist, and none.
Create a file profile.yaml:
- Wizard
- From file
The wizard collects display name, description, namespace strategy, and egress modes interactively, then opens your editor with a pre-filled spec to review before submitting:
Enable a runner on a CKS cluster
A runner is the Kubernetes workload that schedules sandbox pods on your cluster. CoreWeave operates the runner. You enable it on a specific cluster.- Cloud console
- CLI wizard
- CLI from file
The cloud console enable flow requires at least one profile template to already exist for your organization. Create a profile template before you use this tab.
- Open the Clusters page in the cloud console.
- Select the cluster you want to enable sandboxes on.
- In the Sandbox runner card, click Enable sandbox runner.
Pending to Ready. The runner then accepts sandbox requests.Run your first sandbox
Wait for the runner to reach theReady state before you send sandbox requests:
- Cloud console: Open the cluster’s Sandbox runner card and watch the status badge until it shows
Ready. - CLI: Run
cwic sandbox runner get [RUNNER-ID]and look forINSTALLto beREADY. For a longer view, usecwic sandbox runner describe [RUNNER-ID].
Ready, anyone in your organization with a CoreWeave API access token can create sandboxes against it.
To install the SDK, run:
CWSANDBOX_API_KEY. For more information, see Manage API Access Tokens.
Hello! appears in the output.
This example does the following:
Sandbox.run()creates a sandbox using the runner’s default profile and returns it inside a context manager. The sandbox tears down on context exit.exec()runs a command inside the sandbox and returns aProcessobject..result()waits for the command to complete and returns the output.
Disable the runner
When you no longer need sandboxes on the cluster, disable the runner. The runner is removed from the cluster and stops accepting sandbox requests. Stop running sandboxes from the Python client before you disable the runner if you need clean teardown.- Cloud console
- CLI
- Open the cluster’s Sandbox runner card.
- Click Disable sandbox runner and confirm.
Next steps
The following resources cover next steps:- The Python client page introduces the SDK and links into reference material.
- The Python client tutorial walks through configuration, command execution, file operations, and cleanup.
- The Python client guides cover lifecycle, streaming, RL training, SWE-bench, SUNK integration, and other advanced topics.