- Deploy a runner and set the policy it carries.
- Run your first sandbox from the Python client.
- Delete the runner when you’re done.
cwic) and through direct curl calls against the control plane REST API. Pick whichever fits your workflow. The wizard and from-file cwic tabs are equivalent. The from-file and curl tabs accept YAML or JSON bodies, which makes them a natural interface for CI scripts and for agents (such as Claude Code or Codex) that author runner and policy documents on your behalf.
CoreWeave sandboxes are in public preview. For access, contact your CoreWeave account team, CoreWeave Support, or email support@coreweave.com.
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. Note the cluster’s zone and name. Both are reused in later steps. - The
SANDBOX_ADMINaction in Identity and Access Management (IAM), which lets you create runners and set their policy. Create or update an access policy that grants this action on the Access Policies page in the cloud console. - A CoreWeave API access token. Generate one from the Tokens page in the cloud console and copy the Token Secret value. For more information about tokens, see Manage API Access Tokens.
- cwic
- curl
Install the CoreWeave Intelligent CLI (The token is stored in your local cwic config. Subsequent cwic commands read it automatically. No environment variable is required.
cwic), then sign in with the token:- 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().
Deploy a runner and set its policy
A runner is the Kubernetes workload that schedules sandbox pods on your cluster. CoreWeave operates the runner; you deploy it on a specific cluster. Every runner carries exactly one policy, and a cluster hosts at most one runner, so this policy governs every sandbox on the cluster. The policy states what sandboxes may request and what they get by default. A policy must bound sandbox lifetime. The following example policy denies all outbound network access and caps sandboxes at one hour. Adjust it for your environment: widenallowedEgress to permit specific destinations, and raise the resource ceilings as needed. For every constraint group, see Configure a sandbox policy.
Save it as policy.json:
policy.json
- Cloud console
- cwic
- curl
- Open the Clusters page in the cloud console.
- Select the cluster you want to deploy a runner on.
- In the Sandbox runner card, click Enable sandbox runner.
Pending to Ready. The runner then accepts sandbox requests.Set the policy afterward with cwic or curl, using one of the following tabs.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. -
cwic: Run
cwic sandbox runner get [RUNNER-ID]and look forINSTALLto beREADY. For a longer view, usecwic sandbox runner describe [RUNNER-ID]. -
curl: Poll the runner until
installStatusisREADY:
Ready, anyone in your organization with a CoreWeave API access token can create sandboxes against it. The remaining steps cover the researcher workflow: install the Python SDK, set an API token, and run a sandbox against the runner.
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 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. For a clean teardown, stop running sandboxes from the Python client before you disable the runner.- Cloud console
- cwic
- curl
- 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.