lockfile-guardian πŸ”’

Audit your package-lock.json for supply-chain attacks before you run npm install.
MCP serverx402 pay-per-callread-onlyUSDC Β· Baseintegrity checkPR-diff mode

Your lockfile is the artifact npm install actually executes. lockfile-guardian cross-checks every resolved dependency against the live npm registry and tells you what's about to run on your machine. It completes the guardian trio: npm-guardian vets a chosen package, import-guardian catches hallucinated imports, license-guardian audits licenses β€” lockfile-guardian audits the resolved tree.

What it catches

πŸ”΄ Integrity mismatchthe lockfile's sha512 doesn't match what npm serves for that version β€” the resolved tarball was swapped (lockfile poisoning). BLOCK.
πŸ”΄ Not on registrythe lockfile points at a package/version that doesn't exist or was unpublished. BLOCK.
🟠 New install scripta newly-introduced dependency that runs preinstall/postinstall β€” the Axios / plain-crypto-js attack signal.
🟠 Hidden gyp buildnative build via binding.gyp / node-gyp that executes on install and dodges plain postinstall monitoring.
🟠 Fresh + executinga version published in the last 30 days that runs an install script β€” disproportionately used in attacks.

PR-diff mode (the differentiator)

Pass the previous lockfile too and lockfile-guardian audits only what the change introduces. A first-seen dependency with an install script is the single highest-signal supply-chain tell β€” this surfaces it in one call.

Free HTTP API

POST /audit    { "lockfile": "{…package-lock.json…}", "previous_lockfile": "{…}" }
POST /scripts  { "names": ["sharp@0.33.0","esbuild","node-sass"] }
GET  /verify?name=lodash&version=4.17.21&integrity=sha512-...

Try it: /verify?name=esbuild (runs a native build) Β· /verify?name=lodash (clean)

MCP server (free)

{
  "mcpServers": {
    "lockfile-guardian": { "command": "npx", "args": ["-y", "lockfile-guardian-mcp"] }
  }
}

Or connect over HTTP at POST /mcp. Tools: audit_lockfile, check_install_scripts, verify_integrity.

Pay-per-call (x402)

The /pro/* routes are gated by x402. Your agent pays $0.02 USDC per call automatically β€” no sign-up, no API key. Settles on-chain to the operator wallet.

POST /pro/audit   { "lockfile": "...", "previous_lockfile": "..." }   # 402 β†’ pay β†’ result