[KongchangAI]
· 1 min read· 871 words

Vercel CLI Now Supports OIDC Token Exchange: Say Goodbye to Long-Lived PATs

Vercel CLI Now Supports OIDC Token Exchange: Say Goodbye to Long-Lived PATs

Vercel CLI supports OIDC token exchange for short-lived tokens, freeing CI/CD from long-lived PATs.

Vercel CLI now supports obtaining short-lived access tokens through OIDC token exchange, allowing CI/CD workflows to no longer rely on long-lived Personal Access Tokens (PATs). Based on Workload Identity Federation (WIF), this mechanism lets OIDC tokens from trusted workloads like GitHub Actions be exchanged for short-lived Vercel CLI tokens. Token permissions are determined by the team's OIDC policies rather than tied to specific member roles, embodying the principles of least privilege and short-lived credentials. Vercel officially recommends migrating CI/CD workflows from PATs to OIDC, but some CLI commands still require user tokens, so migration should be gradual. Teams can create policies through the settings UI or the `vercel oidc-policies` command and adjust authentication in their CI/CD configuration.

Vercel CLI now supports obtaining short-lived access tokens through OIDC token exchange, a change that lets CI/CD workflows completely eliminate long-lived Personal Access Tokens (PATs). For teams that frequently deploy on platforms like GitHub Actions, this is not just a security improvement but a shift in how permissions are managed.

From PAT to OIDC: A More Secure Authentication Approach

In the past, developers typically configured a long-lived PAT in their CI/CD pipelines to call the Vercel CLI. If such a token leaked, an attacker could continue accessing account resources for its entire validity period, and permissions were often tied to a specific member, making fine-grained control difficult.

The Workload Identity Federation (WIF) mechanism introduced by Vercel allows you to exchange an OIDC token from a trusted workload (such as a GitHub workflow) for a short-lived Vercel CLI access token. According to the official documentation, these short-lived tokens have an extremely brief lifespan, and their permissions are determined entirely by the team's OIDC policies rather than by a specific team member or their role.

This means the permission boundaries of tokens are clearer: each token can only perform the operations its policy allows, and even if leaked, the impact window is greatly reduced.

OIDC (OpenID Connect) is an identity authentication layer built on top of OAuth 2.0. By introducing a standardized ID Token (in JWT format), it allows one party to verify the identity of another. In CI/CD scenarios, platforms like GitHub Actions can natively generate a short-lived OIDC token (JWT) that carries metadata about the workload (such as repository, branch, and environment). Vercel, as the trusting party, can verify the token's signature and claims once an OIDC policy is configured, thereby confirming identity without pre-provisioned long-term secrets.

Workload Identity Federation (WIF) is a more general mechanism that allows external workloads to exchange their own identity credentials (such as OIDC tokens) for short-lived access tokens from the target platform. Its core idea is to move the trust anchor from "static keys" to "the identity attributes of the workload itself," enabling zero long-term keys and more fine-grained authorization. Vercel's implementation is based on this model.

How OIDC Policies Work

OIDC policies are the core of this mechanism. You need to create a policy in Vercel's settings under Settings → Build and Deployment → OIDC Policies, or use the newly provided vercel oidc-policies command directly.

A policy defines which external workloads can exchange tokens and what permissions the exchanged tokens have. In other words, permissions no longer depend on "who" is operating but on "what workload" is operating. This model better aligns with modern CI/CD security practices, namely the principle of least privilege and the principle of short-lived credentials.

Interestingly, Vercel officially recommends migrating CI/CD workflows from PATs to OIDC. However, it also notes that some CLI commands still require user tokens. This means the migration is not one-size-fits-all; teams need to assess which commands in their workflows depend on user identity and which can be fully policy-driven.

The Principle of Least Privilege requires that each principal have only the minimum permissions necessary to complete its task. In OIDC policies, this means you should precisely limit the operations a token can perform (such as deploying only a specific project) rather than granting broad account-level permissions. The Principle of Short-Lived Credentials further requires that credentials have as short a validity period as possible to minimize the attack window after a leak. Vercel's short-lived tokens have an extremely brief lifespan, embodying this principle. Together, these two principles make OIDC policies a core configuration for modern CI/CD security practices.

How to Get Started with Migration

The first step in migration is to create an OIDC policy in the Vercel console or via the CLI. After the policy is created, you need to adjust the authentication method in your CI/CD configuration to use OIDC token exchange to obtain short-lived access tokens. For specific configuration details, refer to the official Vercel documentation.

For teams using GitHub Actions, this process integrates seamlessly because GitHub natively supports generating OIDC tokens. Other trusted workloads can also be onboarded in a similar way.

Official contributors Alice Hawthorne, Melkey Moksyakov, and Bel Curcio participated in the development of this feature.

GitHub Actions natively supports OIDC, but you need to explicitly enable permissions in the workflow: set permissions: id-token: write at the job level, then request an OIDC token via the ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL environment variables. Once you have the token, pass it to the Vercel CLI's token exchange interface to obtain a short-lived access token. For specific exchange commands and parameters, refer to the OIDC integration guide in the official Vercel documentation.

Impact on Development Teams

Moving from long-lived PATs to short-lived OIDC tokens reflects the growing emphasis on supply chain security and credential management in the infrastructure space. For teams, this means less burden of managing long-term secrets and more fine-grained permission control.

However, during migration, teams should pay attention to commands that still rely on user tokens. Teams can gradually migrate automated processes to OIDC while retaining the necessary manual operation paths.

This Vercel update provides a practical template for CI/CD security and signals that more platforms may follow with similar workload identity federation solutions in the future.

#Vercel CLI#OIDC token exchange#Workload Identity Federation#CI/CD security#Personal Access Token#short-lived tokens
Share:

Related articles