Safeguard
Developer Tools•

Should you yank or delete a bad release?

Yanking steers new installs away from a faulty release while keeping it available to people who pinned it. Deleting can break them. How to choose.

Safeguard Security Team
3 min read

Prefer yanking over deleting. A yanked release stays downloadable for people who pinned that exact version, but installers steer new installs to a good version. Deleting a release breaks anyone who pinned it, and it removes evidence customers need to check whether they are affected.

Definitions

Yanking, as defined for Python package indexes in PEP 592, marks a file so installers should not normally select it. The PEP says installers must ignore a yanked file when the constraints can be met by a non-yanked version. The state is reversible, so clients must cope with a file being yanked, unyanked and yanked again. Deleting removes the file.

Why deleting hurts

The PEP describes a catch-22. If you delete a broken release, users who pinned it can no longer build. If you leave it, new users may pick it up. Yanking solves both. Installers may ignore a yanked file unless it is the only match for an exact pin, or unless a lock file names it, and they should warn when someone installs a yanked file. The yank can carry a reason string that installers may show.

When each applies

SituationAction
Release has a serious bug, no secret exposedYank, publish a fixed version, explain in the notes
Release contains a vulnerabilityYank, publish a fixed version, publish an advisory naming affected and fixed versions
Release contains a leaked secretYank, rotate the secret first, then decide on removal with legal advice
Release is malicious or must not be redistributedRemove it, keep a record, and notify customers directly

The point is that yank is a signal and removal is a last resort. Not every channel supports yanking. For your own download site, you can mimic it: keep the file, remove it from the "latest" pointer, and put a banner on its page.

Steps for your own download site

  1. Mark the release as withdrawn on its page with the reason and the replacement.
  2. Take it out of update manifests so clients stop offering it.
  3. Leave the file and its hash available, so customers can identify what they run.
  4. Send the notice to your advisory list.
  5. Record the dates, so your support team can answer "since when".

Mirrors

The PEP says mirrors must not mirror a yanked file without also mirroring the yank marker. If customers run internal mirrors, tell them to preserve it.

If you want a second look at what you ship, Safeguard can generate and scan an SBOM and run dependency scanning with reachability analysis, and you can try the free scan.

Quick check

Does yanking remove a release from customers who already installed it?

No. It only changes what installers select. Customers need your advisory or notice to know to move off it.

When is deletion justified?

When the release is malicious or cannot lawfully be redistributed. Even then, keep a private record and notify customers.

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.