Skip to main content
Kubernetes issues projected service-account JWTs that identify a pod’s namespace and service account. With Workload Identity Federation, the pod exchanges that JWT for a short-lived TrueFoundry access token — no Virtual Account token in the pod env or secret store. TrueFoundry matches nested claims on the token (kubernetes.io/namespace and kubernetes.io/serviceaccount/name), not only the sub string. For concepts and the shared exchange API, see Workload Identity Federation.

Prerequisites

  • A cluster with projected service-account tokens enabled (default on current Kubernetes).
  • The cluster OIDC issuer and JWKS reachable from the TrueFoundry control plane (or your platform team can expose them).
  • A Virtual Account or Agent with the permissions the workload needs.

Get the cluster issuer and JWKS

On many managed clusters (EKS, GKE, AKS) the issuer is a public HTTPS URL. Use those values as Issuer URL and JWKS URI on the TrueFoundry Identity Provider.

Project a service-account token

Mount a projected token into the pod. Set audience to a value you will also list under Allowed Audiences on the TrueFoundry Identity Provider (for example truefoundry).
A typical projected token includes nested claims TrueFoundry reads with / paths:

Configure TrueFoundry

  1. Settings > Security & Access > Identity Providers → add provider type Kubernetes.
  2. Set Issuer URL and JWKS URI from the cluster discovery document. Set Allowed Audiences to the same audience as the projected token (for example truefoundry).
  3. On the Virtual Account (or Agent), add a mapping for that provider:
Virtual Account — Claims
Agent — Subject (YAML key is still claims)
Required keys for kubernetes: kubernetes.io/namespace, kubernetes.io/serviceaccount/name. Paths use / as the nested-object separator; the dots in kubernetes.io are part of the key name. You may add further claim matches when your token includes them and you want to pin them.

Exchange and call TrueFoundry

<tenant-host-origin> is the issuer origin from OpenID discovery. The exchange path is /{tenant}/oauth2/v1/token (no /api/svc). Prefer token_endpoint from GET https://<tenant-host-origin>/<tenant>/.well-known/openid-configuration. Use the returned access_token as Authorization: Bearer on the AI Gateway or APIs. For Agents, set tfy_subject to agent:<agent-name>. Full exchange details: Workload Identity Federation.

Scope the mapping

  • Pin both namespace and service-account name — do not map a whole cluster to one Virtual Account unless that is intentional.
  • Use the same audience on the projected token and the Identity Provider Allowed Audiences list.
  • Prefer one Virtual Account (or Agent) per workload identity boundary.