Safeguard
Supply Chain•

How does Unity decide which registry a package comes from?

Unity matches a package name to the closest scope in your scopedRegistries list, else the default registry. How it works and what to check first.

Safeguard Security Team
3 min read

Unity's Package Manager compares a package name with the scopes of each scoped registry in your project and uses the closest match. If nothing matches, the package comes from the default registry. That rule decides where code enters your game, so it is worth understanding before you add a registry.

What a scoped registry is

A scoped registry tells Package Manager where a custom package server lives. Unity describes organizations using them to distribute custom packages internally. You add them to the scopedRegistries array in Packages/manifest.json. Each entry has three fields:

FieldMeaning
nameThe label shown in the Package Manager window
urlAn npm compatible registry server
scopesExact package names or namespaces such as com.example

The Unity documentation adds that not every registry provider works, because the server must implement the /-/v1/search or /-/all endpoint. Wildcards and glob patterns are not supported, and Unity does not support npm's @scope notation.

How the closest match works

Here is the documentation's own example, restated. A General registry has the scopes com.example and com.example.tools.physics. A Tools registry has com.example.mycompany.tools.

  • com.example.animation comes from General, matching the com.example namespace.
  • com.example.mycompany.tools.animation comes from Tools, because that scope is a closer match than com.example.
  • com.unity.animation matches nothing, so it comes from the default registry.

The lesson: a longer, more specific scope wins. A broad scope such as com.example claims every package under that namespace, including ones you did not know existed.

Why this is a supply chain question

The Unity page says to install scoped registries only from trusted sources, because the packages in them can contain executable code. It also warns about registries that might collect data without appropriate controls and third parties that falsely claim Unity's approval.

Because a broad scope claims a namespace, a registry you add could become the source for packages you assumed came from elsewhere. That is the same shape as dependency confusion in other ecosystems, so treat each new scope as a trust decision.

A pre-add checklist

  1. Who runs the registry, and who can publish to it?
  2. Is each scope as narrow as it can be?
  3. Does the namespace overlap with a package you already use?
  4. Is authentication configured, as Unity describes, in the Package Manager user configuration file?
  5. In a shared project, did the team review the change? Unity warns you when another user adds a new scoped registry.

Try it yourself

Open the inventory demo and look at how each component is listed with its source. Ask the same question of your manifest: for every package, can you name where it came from?

Click through it at your own pace, or open it full screen.

Quick check

Can a scope use a wildcard?

No. The documentation says wildcards and glob patterns are not supported. Scopes are exact package names or namespaces.

Do scoped registry packages run code?

They can. The documentation says packages in those registries can contain executable code, which is why the source matters.

Safeguard's SBOM and dependency scanning can list the packages a project resolves, so a surprise source shows up. 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.