depdrift
Review what actually changed between two lockfiles, and what is risky about it. One markdown report: typosquats, install scripts, git dependencies, mirror registries, version jumps. Local, offline, no API key.
The demo above is a fixture lockfile. The pattern it catches is the real thing: expresss instead of express, carrying an install script, plus a package resolved from a mirror that is not npm.
Install
pipx install git+https://github.com/mgkvibez/depdrift.git
Three ways to use it
# 1. What changed in this PR's lockfile?
git show origin/main:package-lock.json > /tmp/before.json
depdrift review /tmp/before.json package-lock.json
# 2. Gate a CI job on high severity and above
depdrift review /tmp/before.json package-lock.json --fail-on high
# 3. Machine-readable, for a bot or an agent skill
depdrift review /tmp/before.json package-lock.json --json
Why it exists
A lockfile diff is thousands of lines and nobody reads it. That is exactly the surface a supply-chain attack wants: a package that looks like one you trust, a postinstall script, a tarball from somewhere else. Reviewers approve it because "it's just a lockfile bump".
depdrift answers the only two questions that matter after a dependency change: what arrived, and what about it deserves a human's eyes.
How it works
Parses npm package-lock.json (lockfileVersion 1, 2 and 3) into a package map and diffs the two.
| Rule | Severity | Fires when |
|---|---|---|
typosquat |
critical | new name is within edit distance 2 of a popular package and is not it |
install-script |
high | new package declares an install/postinstall script |
git-dependency |
high | resolved from a git ref instead of a published tarball |
non-default-registry |
medium | resolved from a host that is not registry.npmjs.org |
major-version-jump |
medium | an existing package crosses a major version |
diff-size |
low | more than 50 packages changed at once |
The popular-name list ships in depdrift/popular.py, so nothing leaves the machine. No registry calls, no token, no telemetry. Read the report and decide.
Contributing
Read CONTRIBUTING.md. Tests:
python -m pytest -q
License
MIT. See LICENSE.
Metadata
Release files for depdrift 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| depdrift-0.1.1.tar.gz | 9.4 kB | With provenance | Details for depdrift-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| depdrift-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for depdrift-0.1.1-py3-none-any.whl |
Total release size: 18.9 kB
Release files / depdrift-0.1.1.tar.gz
| Download URL | depdrift-0.1.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a65020f8645b71df135ebd3040266a63ce13fcf099e38c5c00eeef3d7959e3b1
|
|
BLAKE2b-256 checksum How to use checksums |
bbaeee09a2b634b12fcfc9374c24225ad9a7006e5830915c02742bfa42afebd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logRelease files / depdrift-0.1.1-py3-none-any.whl
| Download URL | depdrift-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1852474093c960e72b76fd987190eac86660b18d9932e9caba1ed5d5ce2efb9
|
|
BLAKE2b-256 checksum How to use checksums |
f3d91227c234ee01596b0389b88814221bb5e035bce4702015f3470d4f7493b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logSecurity for depdrift 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for depdrift-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.