Safeguard
Security Guides•

What is workload identity federation, in plain words?

Workload identity federation lets software outside a cloud, like a CI job, trade a signed token from its own platform for short lived cloud credentials.

Safeguard Security Team
4 min read

Workload identity federation lets software that runs outside a cloud, such as a CI job, prove who it is with a signed token from its own platform and trade that token for short lived cloud credentials. No long term key is stored. The cloud trusts the platform, then checks the details.

The idea

Normally a pipeline reaches your cloud with a secret key you created and pasted into a settings page. Federation replaces the pasted secret with a conversation:

  1. The CI platform signs a token for the job: this is repository X, running on branch Y.
  2. The job sends that token to the cloud's token service.
  3. The cloud checks the signature against the platform's published keys.
  4. The cloud checks the claims against a trust rule you wrote.
  5. If everything matches, it returns credentials that expire.

Microsoft describes it as a trust relationship between an app and an external identity provider, letting an external workload access protected resources without managing secrets or certificates in supported scenarios.

Terms

TermMeaning
Identity provider (issuer)The platform that signs tokens, such as your CI service
Subject (sub)Who the token describes, for example a repository and branch
Audience (aud)Which service the token is for
Trust policy or federated credentialYour rule about which tokens to accept
Temporary credentialsWhat you get back, valid for a limited time

Same idea, different names

AWS calls it assuming a role with web identity. Its best practices page lists the web identity exchange as one way to deliver temporary credentials to workloads outside AWS, including managed CI/CD platforms. Microsoft calls the trust object a federated identity credential. GitLab and GitHub both issue the tokens, and each documents which claims they contain.

Why teams adopt it

  • No stored secret to leak. Nothing in the repository or the secret store grants cloud access by itself.
  • Expiry by default. AWS recommends relying on temporary credentials over long term ones where possible.
  • Fine grained control. The trust rule can require a specific repository, branch, environment or protected ref.
  • Clear audit trail. On AWS, CloudTrail logs the web identity role assumption and information from the identity provider.

What it does not do

Federation does not make a job safe. It proves where a job came from, not what the job will do. If a trusted repository runs malicious code, the code gets whatever the role allows. You still need least privilege, protected environments and review of workflow changes. A loose trust rule can also undo the benefit: GitHub's AWS guide notes a repository wildcard allows any branch, pull request merge branch or environment to assume the role.

Getting started

  1. Choose the lowest risk pipeline to move first.
  2. Register the platform as an identity provider in your cloud.
  3. Create a role with only the permissions that pipeline needs.
  4. Write an exact trust rule on audience and subject.
  5. Turn on logging so you can see assumptions.
  6. Move the next pipeline once the first runs cleanly.

Our guide to moving CI from access keys to OIDC walks through the cutover.

Quick check

Is federation the same as OIDC?

OIDC is the token format and protocol most CI platforms use. Federation is the broader idea of trusting an outside identity provider.

Does federation remove the need for least privilege?

No. It removes a stored secret, but the role's permissions still decide what a compromised job can do.

Safeguard does not manage your cloud accounts. It scans your code and dependencies, applies pull request policies and gates, and automates compliance evidence. Free scan: gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.