Skip to main content
Every GitHub Actions job can request a signed OIDC JWT from https://token.actions.githubusercontent.com. With Workload Identity Federation, the job exchanges that JWT for a short-lived TrueFoundry access token — no long-lived Virtual Account token stored as a repository secret. TrueFoundry requires a repository claim match on the Virtual Account Claims (or Agent Subject) mapping. For concepts and the shared exchange API, see Workload Identity Federation.

Prerequisites

  • A GitHub repository where you can edit workflows and grant id-token: write.
  • A Virtual Account or Agent with the permissions the job needs.

Configure the workflow

GitHub only issues an identity token when the job requests it:
Fetch a token with the audience you will register on TrueFoundry (for example truefoundry):
Or with actions/github-script:
Typical claims on the JWT:

Configure TrueFoundry

  1. Settings > Security & Access > Identity Providers → add provider type GitHub.
  2. Set:
  1. Map the Virtual Account (or Agent):
Virtual Account — Claims
Agent — Subject (YAML key is still claims)
Required key for github: repository. You may add further claim matches (for example ref) when your token includes them and you want to pin them.

Exchange and call TrueFoundry

Use TFY_ACCESS_TOKEN as Authorization: Bearer against the AI Gateway or APIs. For Agents, set tfy_subject to agent:<agent-name>. Full exchange details: Workload Identity Federation.

Scope the mapping

  • Prefer repository: your-org/your-repo over a broad org-wide pattern.
  • Add optional claim matches (for example a protected branch ref) when only specific workflows should authenticate.
  • Do not store a long-lived VAT in GitHub Secrets when federation is available.