Skip to main content
Google Cloud workloads can present a short-lived OIDC JWT from the metadata server (or a GKE projected service-account token) and exchange it for a short-lived TrueFoundry access token — without baking a Virtual Account token into the environment. TrueFoundry requires both 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 example truefoundry):
Typical claims when using Google-signed identity tokens:

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

  1. Settings > Security & Access > Identity Providers → add provider type GCP.
  2. Common values for Google-signed identity tokens:
Confirm iss and jwks_uri against a real token and Google’s discovery document before saving.
  1. Map the Virtual Account (or Agent):
Virtual Account — Claims
Agent — Subject (YAML key is still claims)
Required keys for 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 sub and email to one Google service account.
  • Use a dedicated Google service account per application or environment.
  • Keep Allowed Audiences aligned with the metadata audience query parameter.