sub and email on the Claims / Subject mapping for the gcp provider.
For concepts and the shared exchange API, see Workload Identity Federation.
Prerequisites
- A Google Cloud workload that can obtain an identity token (Compute Engine, Cloud Run, GKE with Workload Identity, and similar).
- A Virtual Account or Agent with the permissions the workload needs.
Get a Google identity token
Metadata server (Compute Engine / Cloud Run / attached SA)
Request an identity token with the audience you will register on TrueFoundry (for exampletruefoundry):
GKE projected tokens
If you use GKE projected Kubernetes service-account tokens and the cluster OIDC issuer, you may instead register a Kubernetes Identity Provider and follow Kubernetes. Use the GCP provider when the JWT is issued by Google (accounts.google.com) with sub + email.
Configure TrueFoundry
- Settings > Security & Access > Identity Providers → add provider type GCP.
- Common values for Google-signed identity tokens:
Confirm
iss and jwks_uri against a real token and Google’s discovery document before saving.
- Map the Virtual Account (or Agent):
claims)
gcp: sub, email. 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. For Agents, set tfy_subject to agent:<agent-name>.
Use the returned access_token as Authorization: Bearer on the AI Gateway or APIs. Full exchange details: Workload Identity Federation.
Scope the mapping
- Pin both
subandemailto one Google service account. - Use a dedicated Google service account per application or environment.
- Keep Allowed Audiences aligned with the metadata
audiencequery parameter.