How a sandbox resolves against a policy
A sandbox resolves in two stages.- 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.
- Constraints: Typed clamps are validated against the fully resolved spec. A spec that violates a constraint is rejected, never silently rewritten.
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 throughcontrol_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. 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:- Sandboxes architecture: the resources that build a sandbox and the gateway that brokers every request.
- Deploy and manage a runner: the runner lifecycle and the configuration a runner carries.
- Control plane API overview: authentication, field masks, heartbeats, and the endpoint contract.