Safeguard
Developer Tools•

How do automatic vulnerability fix pull requests work?

An automatic fix pull request finds the fixed version in an advisory, edits your lockfile, runs tests and waits for review. Each step explained.

Safeguard Security Team
3 min read

An automatic fix pull request reads the fixed version from a vulnerability advisory, changes your manifest or lockfile to that version, runs your existing tests in a branch, and opens a pull request for a person to review. Merging stays under your rules. The tool proposes; your policy decides.

The five steps behind the pull request

  1. Match. The scanner finds a component and version in your dependency inventory that falls inside an advisory's affected range.
  2. Find the fix. Advisories in the OSV format record where a range ends with a fixed event, which "precisely identifies the version which contains the fix." If only a last affected version is given, there is no confirmed fix version to move to.
  3. Choose a target. The tool picks the smallest upgrade that clears the range. Semantic versioning helps here: a patch bump is meant to hold only backward compatible bug fixes, a minor bump adds compatible features, and a major bump may break callers.
  4. Edit and test. It changes the manifest or lockfile in a branch and runs your CI. Green tests are evidence, not proof.
  5. Open the pull request. The description should say which CVE, which versions, and what changed.

Which fixes are safe to automate?

Change typeTypical riskSensible default
Lockfile only, patch versionLowReview, then merge on green CI
Manifest change, minor versionMediumReview by code owner
Major versionHigh, API may changeManual, with migration notes
No fixed version existsNot a bump at allMitigation or ticket, not a PR

The semver promise is only a promise. Maintainers sometimes break it, so tests and a human read still matter for anything touching production paths.

What to check before merging

  • The pull request touches only dependency files unless you expect more.
  • CI ran against the branch, and covers the code that uses the package.
  • The new version is the fixed version in the advisory, not just the latest.
  • No new transitive packages you do not recognise appeared in the lockfile diff.

Try it yourself

Open the demo and follow a finding from advisory to proposed upgrade. Look at how the fix version is chosen and what the diff contains.

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

Where Safeguard fits

Safeguard's autonomous remediation opens fix pull requests. It is off by default and every category starts on Manual, so nothing merges until you choose. Policies and gates control what is allowed. A free scan shows which of your findings have a fixed version today.

Quick check

Does a fix pull request replace code review?

No. It replaces the manual lookup and edit. Someone still needs to read the diff and confirm tests cover the affected code.

What if the advisory has no fixed version?

Then there is nothing to upgrade to. Use a mitigation, replace the package, or track an exception with an owner and a date.

Sources

  • OSV schema, ossf.github.io/osv-schema (introduced, fixed and last_affected events).
  • Semantic Versioning 2.0.0, semver.org (meaning of major, minor and patch).

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.