Before you begin
The CLI,curl, and Terraform examples on this page authenticate with a CoreWeave API access token. Generate one from the Tokens page in the cloud console and copy the Token Secret value. For more on tokens, see Manage API access tokens.
CLI: install the CoreWeave Intelligent CLI (cwic), then run cwic auth login and paste the token when prompted. The token is stored in your local cwic config. Subsequent commands read it automatically. You don’t need to set an environment variable.
curl: export the token in your shell so the examples on this page can pick it up. Replace [API-ACCESS-TOKEN] with your CoreWeave API access token:
sandbox_admin permission. The deployment example uses provider 0.26.0 or later in the 0.x series. Set the provider’s authentication variable from the token exported in the preceding shell command:
Runner commands
Thecwic sandbox runner group manages runners. The following table maps each lifecycle task to the command that performs it. Later sections walk through these commands in context.
All input accepts YAML or JSON.
Deploy a runner
Within your organization, each CKS cluster hosts at most one managed runner. To deploy one, supply:- Runner ID: a client-assigned human-readable ID, unique within your organization.
- Zone: the geographic zone the cluster belongs to.
- Cluster ID (or cluster name): which CKS cluster the runner runs on. You can find both on the Clusters page in the cloud console.
- Policy: the rules the runner enforces for sandboxes on its cluster. A policy is required to run sandboxes. If you omit it, CoreWeave supplies a default when the runner connects. The policy can supply a default sandbox lifetime; the platform enforces the 30-day maximum. See Configure a sandbox policy.
- CLI
- curl
- Terraform
The wizard collects cluster, release channel, and maintenance windows interactively, then opens your editor with a pre-filled spec before submitting:File mode accepts YAML or JSON, which makes it the preferred path for repeatable setups and a good fit for agents like Claude Code or Codex that generate runner specs on your behalf. The CLI also reads from stdin with Submit the spec:
-f -. Replace [CLUSTER-NAME] with the name of the CKS cluster to deploy the runner on:runner.yaml
maintenance_policy.windowsis optional. When set, automatic updates apply only during the specified cron windows.runner_group_idis optional. Use it for scheduling affinity when you have multiple runners in the same zone.
Common validation errors
Check runner status
After creation, check the runner’s status to confirm it rolled out successfully and to diagnose problems if it did not.- CLI
- curl
- Terraform
get:prod-us-east-1) or the server-assigned UUID.installStatus: progress of the runner deployment into your cluster (PENDING,PROVISIONING,READY, orFAILED).connectionStatus: live connectivity (CONNECTEDorDISCONNECTED). The runner’s heartbeat updates this value. Expect up to 30 seconds of lag.
installStatus == FAILED, the response includes a structured installError:
remediationHints are the actions you should take. diagnosticDetail also contains internal logs that are useful to attach if you open a support ticket.
Update a runner
For a runner managed with Terraform, edit its resource configuration, reviewterraform plan, and apply the plan. Keep the complete desired policy and overrides in the configuration. Later applies can revert changes made through the CLI or API. For drift and replacement behavior, see Update the Terraform configuration.
The runner edit command supports both an interactive wizard and a file-driven patch. Internally, updates use a field mask: only the fields you change are applied. Everything else is read-only, including installStatus, connectionStatus, timestamps, and the resolved deployment spec.
The following paths are mutable:
identity.zoneidentity.runner_group_idspec(whole object)spec.release_channelspec.maintenance_policyspec.overridesspec.overrides.affinityspec.enforce_resource_limitspolicy(whole document)
PATCH body is the managed runner itself, with no request wrapper, and the field mask travels as the updateMask query parameter. An absent mask, or updateMask=*, replaces the whole mutable resource.
Two paths are accepted only on the legacy v1beta2 surface and are rejected by v1 managed-runner writes: profile_bindings (configure policy instead) and spec.allow_privileged_profile_annotations.
Common runner updates
The following examples show the most frequent edits applied to a runner: switching release channels, replacing the policy it carries, tuning where the runner pod lands in your cluster, and allowing legacy profile templates to carry a privileged posture.Example: switch release channel
- CLI
- curl
Apply a one-line patch from stdin:Or write the patch to a file and submit it:
patch.yaml
Example: replace the policy
The policy is replaced as a whole document. Read the current one, change what you need, and send it back. There is no field-level mask insidepolicy, so a partial body clears the groups you leave out.
A policy update also carries an etag, the opaque revision token the runner returns when you read it. Send the value from the read your edit was based on, not a fresher one. A stale token fails with FAILED_PRECONDITION and changes nothing, so a concurrent edit is reported rather than silently overwritten.
- CLI
- curl
policy.json, then submit it pinned to the etag from that same read:policy get exports the policy without its etag, and policy edit -f without --etag reads the runner’s current revision as it submits, so neither pins the revision your file came from. Reading the token separately, for example with policy describe after the export, has the same gap: a token newer than your document passes the check and overwrites the change made in between. The cwic sandbox runner edit template avoids the extra step: --print-template exports the mutable settings, the policy, and its etag together, and -f uses the value in the file.Example: pin node placement through deployment overrides
Thespec.overrides field tunes the runner’s own pod, not sandbox pods. Use it when the runner pod requires specific tolerations, node selectors, or runtime classes to land on the right nodes.
A common case is routing the runner pod through the SUNK Pod Scheduler so it can run in your SUNK cluster alongside Slurm jobs. Set the scheduler name and the SUNK annotations on the runner overrides. See SUNK Pod Scheduler integration for the available annotations and required setup.
- CLI
- curl
overrides.yaml
Example: configure runner affinity
Usespec.overrides.affinity to set Kubernetes node affinity, Pod affinity, or Pod anti-affinity for the runner’s own Pods. The value is a Kubernetes Affinity object, with Kubernetes camel case keys inside it. Runner affinity doesn’t configure sandbox Pod placement or change node budgets.
The following example prefers Nodes labeled example.com/capacity-class: on-demand while leaving other eligible Nodes available. Replace this illustrative label with one used by your cluster.
- CLI
- REST
- Terraform
Use a version of the CoreWeave Intelligent CLI that supports runner affinity. If the command reports an unknown
affinity field, upgrade the CLI or use the REST example.-
Save the affinity patch:
affinity.yaml
-
Apply it to your runner:
spec.overrides.affinity, preserving other overrides. If the same patch includes other override fields, the CLI replaces the whole spec.overrides object. Include every sibling override you want to keep.node_selector restrictions still apply. Nodes with NoSchedule or NoExecute taints require matching tolerations. To allow spot fallback, don’t use a node selector that excludes spot Nodes.
For a hard placement restriction, use requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms. Required node affinity and node_selector must both match. Terms are combined with logical OR. Expressions within a term are combined with logical AND. Required node affinity participates in runner preflight checks. Kubernetes evaluates preferred affinity and Pod affinity or anti-affinity during scheduling.
After an update, use cwic sandbox runner describe prod-us-east-1 to check rollout progress. In the API response, verify that activeRevision matches targetRevision, installStatus is RUNNER_INSTALL_STATUS_READY, and connectionStatus is RUNNER_CONNECTION_STATUS_CONNECTED. The resolved configuration appears in the output-only deploymentSpec.affinity field.
Affinity is replaced as a whole, rather than merged rule by rule. To remove all affinity rules, including inherited rules, apply an explicit empty object:
affinity: null in an affinity-only CLI patch. For REST, keep updateMask=spec.overrides.affinity and send {"spec":{"overrides":{}}}. Clearing affinity leaves node selectors and tolerations unchanged.
The legacy v1beta2 field is managed_spec.overrides.affinity. New integrations use the v1 field spec.overrides.affinity shown here.
Example: allow a privileged profile posture
allow_privileged_profile_annotations controls whether the legacy profile templates bound to a runner may carry a privileged posture. It applies to runners that still use profile bindings rather than a policy, so the request goes to the v1beta2 surface. It defaults to false, and a template that carries one is rejected on a runner where the flag is not set.
Despite the name, the flag governs two kinds of content:
- Privileged pod annotations, meaning the runtime and scheduler prefixes.
- Privileged structured pod-spec fields, such as
serviceAccountName, host namespaces,hostPathvolumes, and privileged or escalating containers.
permission_denied and names the offending fields. For example, a template that sets securityContext.appArmorProfile and securityContext.seccompProfile fails with the following:
Example output
- CLI
- curl
Trigger an on-demand runner update
WhenupdateAvailable is true on the runner, you can apply the update immediately rather than wait for the next maintenance window:
- CLI
- curl
target_revision. The in-cluster controller rolls it out.
List runners
To see every runner in your organization, or to narrow the view to a specific zone, cluster, or connection state, use the following list commands.- CLI
- curl
Delete a runner
Remove a runner when you no longer need sandbox capacity on its cluster, or before you redeploy a fresh runner on the same cluster.- CLI
- curl
- Terraform
--yes to skip the prompt for scripted use:See also
- Configure Node allocation budgets: limit sandbox CPU and memory requests by Node Pool or group of Nodes.
- Sandboxes architecture: the resource model, control plane compared to data plane, and multi-cluster topology.
- Policies overview: how a sandbox resolves against a policy.
- Configure a sandbox policy: every constraint group, with worked examples.
- Control plane API overview: authentication, field masks, and the request and response shapes for every endpoint.
- Policy reference: every field you can set in a policy.