Safeguard
Security Guides•

Which Azure DevOps policies control personal access tokens?

Azure DevOps has tenant and organization policies to restrict global and full scoped PATs, cap lifetime, limit creation, and auto revoke leaked tokens.

Safeguard Security Team
3 min read

Azure DevOps offers four tenant policies and one organization policy for personal access tokens: restrict global PATs, restrict full scoped PATs, enforce a maximum lifespan, automatically revoke leaked PATs, and restrict PAT creation per organization. Four are off by default. Only the leaked token policy is on.

The policies at a glance

PolicyLevelDefaultEffect
Restrict global personal access token creationTenantOffNew PATs must be tied to specific organizations
Restrict full-scoped personal access token creationTenantOffNew PATs must use a custom set of scopes
Enforce maximum personal access token lifespanTenantOffSets a maximum lifetime in days for new PATs
Automatically revoke leaked personal access tokensTenantOnRevokes PATs found in public GitHub repositories
Restrict personal access token (PAT) creationOrganizationOffControls who can create and regenerate PATs

Tenant policies are managed by an Azure DevOps Administrator under Organization settings, then Microsoft Entra. The organization policy is managed by a Project Collection Administrator under Policies, and it is only available for Entra backed organizations.

Allowlists and exceptions

Each policy has its own allowlist. People or groups on it are exempt. Microsoft advises using groups, because a named user adds an identity reference stored in the United States, Europe, and Southeast Asia. To exempt someone from every policy, add them to every list.

The organization policy has a sub option to allow creation of PATs with packaging scope only, because many packaging scenarios still rely on PATs. The policy also blocks use of global PATs in the organization unless the user is allowlisted.

What the policies do not do

Existing PATs, created through the UI or APIs, stay valid for their remaining life. To comply, they have to be regenerated or replaced. Also, none of this changes the fact that a PAT is tied to a user, so a token stops working in terms of access when the user is disabled, but is not deleted automatically.

A rollout order that avoids breaking builds

  1. Inventory current PATs, their owners, scopes, and which pipelines or tools depend on them.
  2. Replace PATs used by automation with Microsoft Entra tokens, managed identities, or service principals where possible. Microsoft advises avoiding PATs when a stronger method exists.
  3. Turn on the restriction on full scoped PATs.
  4. Set a maximum lifespan. Pick a number your teams can live with, then tighten.
  5. Turn on the organization creation policy in organizations that do not need PATs, with the packaging sub option if needed.
  6. Leave automatic revocation of leaked PATs on. Microsoft warns that disabling it keeps leaked tokens active, though you still get an email.

Watch the calendar

Microsoft states that global PATs stop working on 1 December 2026. See the next post on global PAT retirement.

Quick check

Do these policies cancel existing tokens?

No. Existing PATs remain valid for the rest of their lifespan. Update them to comply before they need renewal.

Which policy is on by default?

Automatic revocation of leaked PATs. The other policies listed here default to off.

Safeguard dependency scanning and compliance evidence automation can support the review work around credentials, and you can run a free scan at 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.