← Lab /Security & privacy

AI-driven diff monitor detected a large Axios supply-chain compromise

Their AI-based diff monitoring tool detected the Axios supply-chain attack with no false positives.

Security & privacy Elastic Security Labs 2 Apr 2026 Tooling Prototype evidence

Published as “How we caught the Axios supply chain attack”

Why it matters

Demonstrates that LLM-based diff analysis can spot supply-chain compromises in real time, suggesting a new direction for automated package monitoring.

Summary

The author built a lightweight monitor that polls PyPI and npm for new releases of the top 15,000 packages, downloads the old and new archives, diffs them, and sends the diff to a Cursor LLM for a malicious/benign verdict. The system flagged the Axios 0.30.4 release as malicious, correctly identifying a phantom dependency that executed a postinstall payload, and reported no false positives during the test period. Evidence comes from a real-world incident where the alert arrived on Slack and led to rapid response, though the tool is a proof-of-concept with limited scalability.

What they found 2

  1. The system flagged axios 0.30.4 as malicious

    “🚨 Supply Chain Alert: axios 0.30.4 Verdict: MALICIOUS npm: https://www.npmjs.com/package/axios/v/0.30.4”

  2. No false positives were observed during the monitoring period

    “I never got a single false positive, which is honestly strange if you've ever done detection work in cybersecurity.”

Caveats 2

  • Could be overfitting with such a low sample size
  • It's a proof of concept. I built it in an afternoon on no sleep. I don't expect anyone to run it at a production level. It requires a Cursor subscription for the LLM analysis, it processes releases sequentially, and the watchlists are static.

What’s new here 4

  • Uses an LLM to classify code diffs for supply-chain maliciousness in real time
  • Monitors top-downloaded npm and PyPI packages via registry change feeds
  • Detected the Axios supply-chain compromise with zero false positives
  • Open-sourced as the supply-chain-monitor project

In the news