Deliver k8s groups via a scoped optional scope, not a blanket mapper
Date: 2026-07-03 Status: Accepted Decision: hl-ndh5 Deciders: Sean Brandt
Context
Section titled “Context”DCR-issued tokens carry no groups claim because the groups client scope is only a per-client default on static clients, leaving k8s RBAC unusable for DCR sessions (which the hosted k8s MCP uses via identity passthrough). The precedent for a similar DCR claim gap — engram’s email/email_verified (hl-9az6) — was solved with a blanket mapper on the basic scope. This decision goes the opposite way for groups.
Decision
Section titled “Decision”Promote groups to a realm optional client scope and bundle it into the k8s route’s scopesSupported advertisement, so a DCR client requesting the k8s scopes also receives groups — only on k8s connections. groups is NOT added to the blanket basic default scope.
Rationale
Section titled “Rationale”- Solves the DCR RBAC gap via the same per-resource mechanism as the audience, delivering
groupsonly when a k8s connection is made. - Establishes the pattern Phase C (hl-05xz) reuses to re-home the blanket
emailmapper off thebasicscope. - Avoids widening an already-flagged least-privilege concern (the blanket
basic-scope mappers apply to every realm token).
Alternatives Considered
Section titled “Alternatives Considered”- Bundle
groupsinto the k8s-specific advertised optional scope (chosen): groups delivered only on k8s connections; reuses the audience mechanism; sets the Phase C pattern for re-homingemail. - Add
groupsto the blanketbasicdefault scope, mirroring theemail/hl-9az6 precedent (rejected): simpler and matches prior art, but every realm token would gain agroupsclaim regardless of resource, widening the least-privilege concern this design is narrowing.
Consequences
Section titled “Consequences”- Positive: k8s RBAC works for DCR sessions without widening
groupsexposure on unrelated tokens. - Negative: a second claim (after the audience) now depends on the client correctly forwarding advertised scopes.
- Neutral: static clients keep
groupsas a per-client default and are unaffected.