cwic sandbox runner policy edit [RUNNER-ID] -f policy.json, or send it as the policy field of a runner update. Replace [RUNNER-ID] with the ID of the runner whose policy you want to edit, and replace [GITHUB-ORG] in the image registry examples with your GitHub Container Registry organization or user name.
For the field-by-field walkthrough, see Configure a sandbox policy.
CoreWeave sandboxes are in public preview. For access, contact your CoreWeave account team, CoreWeave Support, or email support@coreweave.com.
GPU data science cluster
A cluster for long-lived per-user work: generous compute, GPU nodes, and internet access for pulling datasets and packages, with the instance metadata endpoint carved out.policy.json
allowedRuntimeClasses fails closed. A sandbox can only pin a class you name, and the two defaults decide what it gets when it pins nothing.
Shared agent cluster with allowlisted egress
A multi-tenant cluster for agent workloads. Agents reach a fixed set of upstreams and each other within the organization, and nothing else.policy.json
Ephemeral CI cluster
Short-lived, small, and narrow. Sandboxes exist for the length of a test run.policy.json
max_lifetime_seconds on the create request where a hard per-job bound matters.
Untrusted code execution
The tightest posture on this page. VM isolation is mandatory, no egress is permitted at all, and the sandbox cannot request its way out of either.policy.json
allowedImages pins one image rather than a registry, so a sandbox cannot select an arbitrary image from a trusted registry.
Internal worker cluster
Long-running background workers that other sandboxes in the organization reach over a service, with outbound access for third-party API calls.policy.json
Inbound access is not policy-controlled yet. Ingress constraints are not enforced, and a sandbox that declares ingress rules is rejected, so this example sets egress only.
Pin admin defaults with the base layer
Any of the policies above can also carry abase fragment: admin attachments applied to every sandbox on the runner, whatever it asks for. This variant of the internal worker policy pins node selection, a pull secret for the private registry, and a cost-attribution label on all sandboxes.
policy.json
base fragment is a Kubernetes pod-specification subset with camelCase keys, unlike the constraint fields around it, and unknown keys are rejected. It accepts scheduling and runtime plumbing only: nodeSelector, tolerations, imagePullSecrets, volumes, topologySpreadConstraints, hostAliases, DNS settings, a single containers entry limited to name, env, envFrom, volumeMounts, and volumeDevices, and pod labels and annotations. Security-sensitive fields are rejected: securityContext, runtimeClassName, initContainers, affinity, host namespaces, hostPath volumes, non-default service accounts, and namespace, which stays runner-owned. Typed concerns such as lifetime, images, and egress belong in constraints, not in base.
On a CKS cluster, template attachments specialize this fragment per template: imagePullSecrets and tolerations are unioned and deduplicated, other lists append, map keys are overridden per key, and same-name conflicts reject the create. For the current enforcement status of base, see the base layer.
Vary the posture across clusters
Because a policy belongs to a cluster, different postures are different clusters rather than different documents on one cluster. A team that needs both an open data science environment and a locked-down execution environment runs two clusters and gives each the matching policy. To vary one dimension by region, apply the same policy to each cluster with the region-specific values changed. There is no shared or inherited policy document, so keep the source of truth in version control and apply it per cluster.See also
- Configure a sandbox policy: every constraint group, with the fields used in these examples.
- Policies overview: how a sandbox resolves against a policy.
- Agentic RL training: reward functions and multi-turn agent rollouts, with working Python.
- Deploy and manage a runner: the rest of the runner configuration.