Review Dependency Changes Before You Merge a Pull Request
Short answer: To review dependency changes, paste the old and new version of a dependency file into the Dependency Change Reviewer and it lists what was added, removed or changed, with the version from and to, and raises flags for changes that deserve a closer look. It is a text comparison with hints, not a security scan or a verdict, and nothing is uploaded or looked up.
Which files it reads
package.json(all four dependency groups and the install scripts);package-lock.json(lockfile versions 2 and 3; version 1 gets a clear message);requirements.txt(including-r,-c,--index-url,--extra-index-url,--find-linksand--trusted-host);pyproject.toml(PEP 621, dependency groups and Poetry, plus Poetry and uv sources; for TOML errors see fixing invalid pyproject.toml and Cargo.toml);go.mod(require,replace,exclude,retract);Cargo.toml(dependencies, dev, build and workspace dependencies, target-specific tables).
The format is detected from the text. If it guesses wrong, choose it by hand.
What it flags
| Area | Example flags |
|---|---|
| Version ranges | no constraint, *, latest, ranges with no upper limit (>=), very broad 0.x ranges |
| Source | git repositories (lower severity if pinned to a commit), tarball URLs, plain http, local paths, Go replace |
| Install scripts | new, changed or removed preinstall, install, postinstall, prepare; lockfile entries marked hasInstallScript |
| Registries | a changed or added --index-url or --extra-index-url, the usual route of dependency confusion; added download locations and trusted hosts |
| Versions | major version jumps and downgrades |
| Moves | a package moved from dev to runtime, or listed twice in different sections |
| Lockfiles | entries from a host other than the official npm registry, missing integrity hashes, same version with a different hash |
Why install scripts and indexes matter most
An install script runs code on your machine or your build server when someone installs the package. A changed package index can make a build fetch a package from somewhere you did not intend. Both are worth reading line by line in a pull request.
What it cannot catch
- Existence and reputation. It never looks anything up, so it cannot tell whether a package exists, is a typo of a popular one, is new, or has known vulnerabilities. For that, use the Package Checker; see AI hallucinated packages.
- What the new code does. A change without flags is not a safe change; see insecure patterns in AI-generated code for what to read in new code.
- Transitive dependencies in manifests. A manifest lists only direct dependencies. Use the lockfile for the rest.
- Anything outside the supported syntax. Unknown lines are reported as notes where possible.
The version rules are heuristic: they compare the first number of a range, not real resolved versions.
How to review dependency changes with the Dependency Change Reviewer
- Open the Dependency Change Reviewer.
- Paste the old file on one side and the new one on the other, for example the two sides of a pull request.
- Read the added, removed and changed lists, split into runtime and development.
- Work through each flag, newest and most severe first.
- Copy the Markdown summary into the pull request description.
If a file cannot be read, the tool names the box and shows the line and column where the format allows it.
Limits to know
- Files up to 8,000,000 characters each; at most 5,000 changes and 2,000 flags are kept.
- A comparison that takes longer than 20 seconds is stopped.
- No network requests are made.
Frequently asked questions
Is this a vulnerability scanner? No. It compares text and raises hints.
How do I compare two package-lock.json files? Paste both. Lockfile versions 2 and 3 are supported.
What is dependency confusion?
A build that pulls a package from an unintended index. A changed --extra-index-url is one common route.
Does a clean result mean the update is safe? No. It means no flags were raised.
Where do I check if a package is real? In the Package Checker.