@@ -169,6 +169,15 @@ The driver reports this behavior through
169169in-process and external drivers. Older drivers omit the field and retain the
170170conservative operator-managed behavior.
171171
172+ Drivers that can verify a platform-native sandbox credential advertise
173+ ` GetCapabilities.supports_sandbox_authentication ` . On the path-scoped
174+ ` IssueSandboxToken ` exchange, the gateway forwards the opaque bearer credential
175+ to that selected driver through ` AuthenticateSandbox ` . The driver returns only
176+ the authenticated sandbox ID. The gateway then verifies that its durable
177+ sandbox record exists and mints the gateway JWT. The driver socket is therefore
178+ a sandbox-identity trust boundary, but it does not grant user or administrator
179+ authority.
180+
172181## Deletion Lifecycle
173182
174183Lifecycle requests use per-sandbox gates to serialize stop, start, and
@@ -457,20 +466,23 @@ watcher emits only sandbox CR changes, not platform events.
457466
458467### SA Token Authentication
459468
460- The gateway 's ` K8sServiceAccountAuthenticator ` adapts its ` NamespaceValidator `
461- per mode ( ` crates/ openshell-server/src/auth/k8s_sa.rs ` ) :
469+ The Kubernetes driver 's ` AuthenticateSandbox ` implementation applies its named
470+ ` [ openshell.drivers.kubernetes] ` configuration per mode :
462471
463472- ** Shared:** ` Exact ` — accepts only the single configured namespace.
464473- ** Managed:** ` Prefix ` — accepts any namespace starting with ` openshell-{gateway_id}- ` .
465474- ** Operator:** ` Allowlist ` — accepts namespaces present in the dynamic
466475 ` BTreeSet ` populated by the label/file watchers. Starts empty (fail-closed)
467476 until the first watcher update.
468477
469- These checks rely on an ownership invariant. In shared and managed modes, the
470- gateway and its trusted Agent Sandbox controller exclusively administer the
471- sandbox namespace, Sandbox CRs, sandbox pods, and configured sandbox
472- ServiceAccount. Other principals must not create or mutate those resources or
473- use that ServiceAccount. In operator mode, the platform operator retains
478+ It validates the projected token with Kubernetes ` TokenReview ` , checks the live
479+ pod UID, and verifies the pod's controlling Sandbox CR UID and sandbox ID before
480+ returning the identity to the gateway. These checks rely on an ownership
481+ invariant. In shared and managed modes, the Kubernetes driver and its trusted
482+ Agent Sandbox controller exclusively administer the sandbox namespace, Sandbox
483+ CRs, sandbox pods, and configured sandbox ServiceAccount. Other principals must
484+ not create or mutate those resources or use that ServiceAccount. In operator
485+ mode, the platform operator retains
474486namespace lifecycle ownership, but must preserve the same exclusive control of
475487Sandbox CRs and the pods and ServiceAccount used for sandbox token bootstrap.
476488An allowlisted namespace is therefore a trust grant, not a tenant isolation
0 commit comments