Safeguard
Developer Tools•

Yanked, retracted, deprecated, archived: which flag should block a build?

Registries use different words for a dependency that should not be used. What yank, retract, deprecate and archived mean to a consumer, and which should fail a build.

Safeguard Security Team
4 min read

Block builds on yanked or retracted versions, because their authors say not to use them. Warn on deprecated versions and archived projects, and plan a replacement. The flags differ by ecosystem, and each one is a signal the maintainer or registry chose to send, which makes it more reliable than guesswork.

What each flag means

FlagEcosystemWhat the documentation says
YankCargoRemoves a version from the index. No data is deleted and the crate stays downloadable. New projects without a lockfile will not use it
RetractGo modulesA version or range should not be depended upon, for example when published prematurely or a severe problem was found. Versions remain available
DeprecatenpmPrints a message on install. The message can say anything, such as pointing to a supported alternative
Deprecated commentGo modulesA comment in go.mod marks the module as deprecated, and go list can surface it
ArchivedPython packagingThe project does not expect updates. The index must not accept new uploads and installers may warn
QuarantinedPython packagingThe project is considered generally unsafe, for example due to malware

The Cargo book describes yanking as a way to stop new dependencies on a version while builds that already have a lockfile keep working.

A policy that matches the intent

  1. Fail the build on a yanked version, a retracted version, or a quarantined project. The signal says do not use it, and fixing it usually means a version bump.
  2. Warn on a deprecated version, and open a ticket with an owner and a date. Read the message, since it often names the replacement.
  3. Warn on an archived project and treat it as end of life. Plan to replace or fork it.
  4. Re-evaluate when the replacement exists, not only when something breaks.

Note one nuance. A yanked version still installs from a lockfile in Cargo, so a policy that only trusts the resolver will miss it. A scanner or a check that reads registry metadata is needed.

Where the signals come from

Registry flags are metadata. The deps.dev API exposes isDeprecated and deprecatedReason for package versions across supported systems. For Go, go list with the update flag reports deprecated modules. In Cargo, the yank status appears in the index. Choose the source that your build can query without extra credentials.

Why not block on every flag

A deprecated package may be fine for a while, and an immediate failure creates pressure to silence the check. The aim is to make unsafe states loud and uncomfortable states visible. Reserve hard failures for flags that mean do not use.

Try it yourself

Click through it at your own pace, or open it full screen. See how a finding with a ready upgrade is presented, which is the shape of a good response to a yank or retract.

Where Safeguard fits

Safeguard provides SBOM and dependency scanning, policies and gates, and autonomous remediation with fix PRs, which is off by default and set per category. A free scan is at gold.safeguard.sh/scan.

Quick check

Does yanking delete a package?

In Cargo it does not delete data. It stops new projects without a lockfile from picking that version.

Is deprecated the same as vulnerable?

No. Deprecated is the maintainer's message. A vulnerability is a separate record. Check both.

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.