Skip to main content

auditclean

npm audit cries wolf. auditclean tells you what to actually fix. A typical audit report is ~80% noise — dev-only CVEs that never ship, transitive advisories with no available fix, low-severity findings buried under two screens of red text. auditclean keeps only what's actionable: production dependencies, at or above a severity threshold, with a fix available. Zero dependencies.

pip install auditclean
auditclean
auditclean — 2 of 47 advisories need action (≥ high, production, fixable)

  ● critical  lodash    <=4.17.20   Prototype Pollution in lodash    → npm audit fix
  ● high      minimist  <1.2.6      Prototype Pollution in minimist  → upgrade minimist to 1.2.8

45 hidden (below high · dev-only · no fix). See everything: auditclean --all

Why

npm audit was famously called "broken by design": it reports every advisory in your entire dependency tree, including ones in build tooling that never reach production and ones with no fix you can apply. The result is alert fatigue — a wall of output you learn to || true past in CI, which is exactly how a real critical slips through.

The existing alternatives want a config file (audit-filter), interactive prompts (npm-audit-resolver), or an account (a SaaS scanner). auditclean wants nothing: run it, get the short list.

How it works

By default it runs npm audit --omit=dev --json for you (so you only see production vulnerabilities), then filters to high+ severity with a fix:

auditclean                      # run audit, show prod high+ fixable
auditclean --level critical     # only critical
auditclean --all                # show everything (low+, dev, unfixable), just cleaned up

You can also feed it a report you already have:

npm audit --json | auditclean
npm audit --omit=dev --json | auditclean   # prod-only on piped input

It understands both npm audit JSON schemas — v2 (npm 7+, vulnerabilities) and v1 (npm 6, advisories) — and normalizes the fix advice, including isSemVerMajor upgrades flagged as (breaking).

In CI

auditclean exits non-zero only when something actionable is left after filtering, so it gates on signal instead of noise:

# fails the build only on production, high+, fixable vulnerabilities
- run: npx auditclean
Exit code Meaning
0 nothing actionable at the threshold
1 actionable vulnerabilities found
2 error (npm missing, unparseable input)

Options

--level <sev>         minimum severity: low | moderate | high | critical (default: high)
--include-unfixable   also show vulns with no fix available
--include-dev         also include devDependencies (when reading piped full JSON)
--all                 shorthand for --level low --include-unfixable --include-dev
--format text|json    output format (default: text)
-v, --version
-h, --help

--format json emits { format, level, total, actionable, hidden, counts, vulnerabilities } for programmatic use.

Notes

  • Production filtering comes from running npm audit --omit=dev. If you pipe a full npm audit --json, the npm 7+ schema doesn't tag dev per-vuln — pipe npm audit --omit=dev --json to get the same result on stdin.
  • Zero dependencies. It shells out to your npm and parses JSON with the standard library. Nothing to install, nothing to audit.

Also available for Node

npx auditclean

Same filtering, same flags, same exit codes — auditclean on npm.

Note: this Python package shells out to your installed npm to read the audit report, so Node/npm must be on PATH. It's handy in Python-based CI that audits a Node sub-project.

License

MIT

Metadata

Release files for auditclean 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auditclean 0.1.0
File Size Uploaded Provenance Actions
auditclean-0.1.0.tar.gz 11.2 kB Without provenance Details for auditclean-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for auditclean 0.1.0
File Interpreter ABI Platform Actions
auditclean-0.1.0-py3-none-any.whl Python 3 none any Details for auditclean-0.1.0-py3-none-any.whl

Total release size: 21.3 kB

Release files / auditclean-0.1.0.tar.gz

Download URL auditclean-0.1.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
be9cb9e66ebaf475e5340c6a5413eff49e9572a5aab0b31b72b2069aa10e99b3
BLAKE2b-256 checksum
How to use checksums
044dd43808d21df821695793eca211480ff31d90328a03df3847cd123ef99a25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / auditclean-0.1.0-py3-none-any.whl

Download URL auditclean-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9bd35994cf19a408408c03642b9d9404f68d2d39d0ce998fa2c514460ba45df
BLAKE2b-256 checksum
How to use checksums
00eb538f79ff73fcf7d27e1eef332b2de564e6833e5c62a366489108908c8e84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for auditclean 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page