Safeguard
Security Guides•

What is job authorization scope in Azure DevOps and which setting?

Job authorization scope sets whether an Azure DevOps pipeline runs with a project or collection identity. Turn on the project limit and protect YAML repos.

Safeguard Security Team
4 min read

Job authorization scope decides which identity an Azure DevOps pipeline uses at run time. A collection level identity can reach resources across projects. A project level identity can reach only its own project. Microsoft recommends the project level identity, enabled by limiting job authorization scope to the current project.

Collection or project identity

Pipelines use an identity to reach repositories, service connections, and variable groups. Microsoft describes two types.

IdentityReachTrade off
Collection levelResources across projects in the organizationEasy to set up, larger blast radius
Project levelOnly the pipeline's own projectNeeds explicit grants for cross project access

If a malicious change runs in a pipeline with a collection identity, it can read code in unrelated projects. With a project identity, the same change is boxed in.

The settings to turn on

In Project Settings, under Pipelines then Settings, or in Organization Settings, Microsoft names three toggles.

  1. Limit job authorization scope to current project for non-release pipelines.
  2. Limit job authorization scope to current project for release pipelines, if you have release pipelines.
  3. Protect access to repositories in YAML pipelines, if you have Azure Repos YAML pipelines.

If the setting is on at organization level, a project cannot override it. If it is off there, projects can turn it on themselves. The documentation says the project level limit overrides the Build job authorization scope option on Classic build pipelines, so a Classic pipeline set to Project collection still runs with a project identity once it is on.

What breaks and how to fix it

Expect failures the first time, usually the error TF401019: The Git repository with name or identifier ... does not exist or you do not have permissions. That means the pipeline relied on cross project access. To fix it:

  1. Find which repositories in other projects the pipeline checks out.
  2. Grant the pipeline's project access to the other project.
  3. Grant the pipeline's build identity Read access on each repository it checks out, and on any repository used as a submodule.
  4. If a repository uses another as a submodule, explicitly check out the submodule repository first, then the one that uses it.
  5. For command line git clone steps, switch to the checkout keyword so the permission request can work.

Protect access to repositories in YAML pipelines

This setting makes a YAML pipeline ask for permission to use any repository, in any project, the first time it runs. A person then selects Permit. It does not apply to GitHub repositories. Microsoft also notes that turning it on stops Classic build pipelines from reaching any repository other than the one in their settings, so if you have both kinds of pipelines you may need separate projects.

Further hardening from the same page

  • Disable creation of classic build and release pipelines. Microsoft says these are disabled by default for new organizations.
  • Add a manual approval each time a pipeline requests a repository.
  • Use a protected branch check so pipelines do not run on unauthorized branches.
  • Limit the pipeline access token to repositories listed in the pipeline's resources section.

Quick check

Does the project setting turn off all cross project checkouts?

It blocks them until you grant access. Grant the project access to the other project and the build identity Read on the repository.

Does the YAML repository protection cover GitHub repositories?

No. Microsoft states the Protect access to repositories in YAML pipelines setting does not apply to GitHub repositories.

Safeguard asset discovery and dependency scanning can map which repositories feed which builds, and a free scan is 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.