Skip to main content
One stored policy governs sandboxes placed on a cluster. It combines a permissive base layer of defaults that every sandbox inherits with typed constraints that bound what a sandbox may request. An administrator can supply it, or the gateway can save a deployment-configured default when the runner has no policy. Automatic assignment preserves an existing policy. Users don’t select a policy, and they don’t need to know one exists. A user describes the sandbox they want. If the policy permits that sandbox, it launches. If the policy forbids part of it, the request is rejected and the error names what was denied.

How a sandbox resolves against a policy

A sandbox resolves in two stages.
  1. Base: The policy supplies runtime defaults and attachments, merged in the order runtime defaults, then policy base, then the sandbox spec. Your spec takes precedence for scalar defaults. Policy attachments still apply, and administrator-pinned Pod metadata takes precedence when annotation keys overlap.
  2. Constraints: Typed clamps are validated against the fully resolved spec. A spec that violates a constraint is rejected, never silently rewritten.
Because constraints validate the resolved spec rather than the submitted one, a value the base supplied is checked on the same terms as a value you supplied. An empty policy is valid and supplies no base defaults or explicit constraints. Platform safety gates still apply, and an absent runtime-class allowlist permits no concrete runtime_class pin. See SecurityConstraints.

What a policy can constrain

Constraints are grouped by what they govern. Every group is optional. Omitting a group adds no explicit constraints of that kind, but platform safety gates and runtime-class restrictions still apply. Network constraints define allowlists for the access a sandbox can request. A sandbox declares the access it requires, and the policy validates that request against what the cluster permits. The policy separately defines what an absent request means. A sandbox also restricts itself through its access declaration. This is useful when you run an untrusted agent and want to narrow its reach below what the policy would allow.

Source IP access controls

A policy can also restrict Sandbox API requests by the caller’s source address through control_plane_access.source_ip_allowlist. The gateway evaluates this control when selecting a runner and before new operations on existing sandboxes, separately from create-time defaults and constraints. Source IP restrictions supplement authentication and authorization. They don’t restrict connections sent directly to a sandbox’s exposed services. For configuration and recovery, see Restrict Sandbox API access by source IP.

What changed from profiles

Policies replace profiles with the following changes. Users no longer choose anything. Under profiles, a user picked a profile by name, which meant knowing which profiles existed and having permission to look. When no profile fit, the user asked an administrator to author one. Under policies, the user declares the sandbox they want and the platform either allows it or explains what it denied. Resolution runs the other way. A profile overrode the values in your sandbox spec. A policy lets your spec override scalar defaults, then constrains the result. Administrator-pinned Pod metadata and other policy attachments still apply.
The inverted resolution is a behavior change, not a rename. A request that a profile would have quietly reshaped might now be rejected outright. Review existing profile configurations against the constraint groups before you migrate them.
Policies are set per cluster. A cluster has no per-team or per-user granularity, so every user resolves against the same policy.

Where reusable configuration lives

Profiles served a second purpose beyond governance. They were a convenient way to save a set of options and reuse it, one per team or per application. That role now belongs to sandbox templates, which hold a reusable partial sandbox specification that you can override when you create a sandbox. Templates carry no authority: they’re a starting point, and the policy remains the only source of enforcement. See Sandbox templates for the workflow and complete example templates.

See also

For related guidance, see the following pages:
Last modified on November 6, 2026