@@ -220,8 +220,9 @@ token is reported as connected but unauthenticated.
220220Sandbox supervisor RPCs authenticate with explicit sandbox credentials; mTLS
221221does not grant sandbox identity. Kubernetes deployments use the
222222gateway-minted JWT bootstrap path: the supervisor starts with a projected
223- ServiceAccount token, exchanges it for a gateway-minted sandbox JWT, and uses
224- that JWT on subsequent gateway RPCs.
223+ ServiceAccount token, registers the pod with the gateway, receives a
224+ gateway-minted sandbox JWT after activation, and uses that JWT on subsequent
225+ gateway RPCs.
225226User-facing RPCs are authorized by descriptor-declared role and scope policy
226227when OIDC or edge identity is enabled. The OIDC admin role grants platform-wide
227228access and bypasses workspace membership checks. Workspace Admin and Workspace
@@ -235,22 +236,43 @@ identity inspection without client-side token decoding.
235236Sandbox secrets are gateway-signed JWTs bound to a single sandbox ID. Docker,
236237Podman, and VM drivers deliver the initial token through supervisor-only
237238runtime material; Kubernetes supervisors exchange a projected ServiceAccount
238- token through ` IssueSandboxToken ` . The gateway delegates that opaque credential
239- to the selected compute driver's ` AuthenticateSandbox ` RPC. A capable driver is
240- trusted to return the authenticated sandbox ID, while the gateway still requires
241- a matching durable sandbox record before minting a JWT. The Kubernetes driver
242- uses its own named configuration to run TokenReview and verify the live pod and
243- controlling Sandbox CR. The bootstrap path accepts
244- both ` agents.x-k8s.io/v1beta1 ` ownerReferences from newer Agent Sandbox
245- controllers and ` agents.x-k8s.io/v1alpha1 ` ownerReferences from existing
246- deployments. Supervisors renew gateway JWTs in memory before expiry only while
247- the sandbox record still exists. Older tokens are not server-revoked; shared
248- deployments bound replay exposure with short ` gateway_jwt.ttl_secs ` lifetimes.
239+ token through ` RegisterSupervisor ` . The gateway delegates that opaque
240+ credential to the selected compute driver's ` AuthenticateSandbox ` RPC. The
241+ driver verifies the credential and returns either a bound sandbox ID or a
242+ warm-pending supervisor instance with an opaque activation guard. For
243+ already-bound pods, the gateway still requires a matching durable sandbox record
244+ before sending an activation message with the gateway JWT. For warm-pooled
245+ Kubernetes sandboxes, the same check is re-anchored through the claim that
246+ adopted the warm pod: the live pod must still be controlled by a live
247+ ` Sandbox ` , that ` Sandbox ` must be associated with the live ` SandboxClaim ` , and
248+ the sandbox-id metadata on that claim must identify the same OpenShell sandbox
249+ record before activation can complete. Activation must present the same opaque
250+ guard returned during registration. Both paths depend on the same Kubernetes
251+ RBAC boundary: sandbox workloads and untrusted users must not be able to create
252+ or mutate trusted Agent Sandbox objects, pod metadata, or the configured
253+ sandbox ServiceAccount in the gateway-managed namespace. ` IssueSandboxToken `
254+ remains as a compatibility shim for older supervisor images and mints through
255+ the same driver authentication path, but only for already-bound responses.
256+ Supervisors renew gateway JWTs in
257+ memory before expiry only while the sandbox record still exists. Older tokens
258+ are not server-revoked; shared deployments bound replay exposure with short
259+ ` gateway_jwt.ttl_secs ` lifetimes.
249260The config default is
250261` gateway_jwt.ttl_secs = 0 ` for local single-player Docker, Podman, and VM
251262gateways; those tokens carry ` exp = 0 ` and do not expire. Kubernetes and other
252263shared deployments should set a positive TTL.
253264
265+ Warm supervisors begin capturing logs before activation but do not open the log
266+ stream until registration supplies the authoritative sandbox ID and installs
267+ the gateway JWT. A bounded pre-activation queue is rebound to that identity,
268+ which avoids both missing startup records and a second bootstrap race. In
269+ sidecar topology, the registering network supervisor also sends the activated
270+ sandbox ID and name together with the main-process command, TTY, and attachment
271+ state to the process supervisor over the authenticated local control socket.
272+ The process supervisor applies that identity before initializing its OCSF
273+ context and rejects conflicts with any identity already present in its
274+ environment.
275+
254276Gateway JWT signing-key rotation is currently an offline operator action. The
255277runtime loads one active signing key and one matching public verification key
256278from the configured secret at startup. To rotate that key material today,
@@ -375,6 +397,15 @@ created from a template resolves that resource once and persists an ordinary
375397name, labels, annotations, provider attachments, and policy. The sandbox stores
376398template provenance as the template name and resource version used for the
377399snapshot, so later template edits or deletes do not mutate existing sandboxes.
400+ For drivers that opt into template reconciliation, a background worker reads
401+ the complete template set and sends it as authoritative desired state through
402+ the optional ` SandboxTemplateReconciler ` driver service. The required
403+ ` ComputeDriver ` service remains limited to common sandbox lifecycle operations.
404+ The worker runs at startup, after template mutations, and periodically, so a
405+ failed driver call or missed notification is retried from the source of truth.
406+ The driver applies the supplied set idempotently and prunes backend resources it
407+ owns for absent templates. Template create and delete therefore need no hidden
408+ delivery rows or tombstones.
378409
379410OAuth refresh failures retain a gateway-owned recovery classification alongside
380411the refresh state. The gateway reads only a bounded error response and maps
0 commit comments