What did Databricks find about malicious npm packages?
On 23 November Databricks Threat Research published an analysis of about 5,400 confirmed malicious npm packages, released between December 2025 and October 2026. npm is the public catalogue many web applications and AI tools use to pull in ready-made pieces of software.
In their set, attacker-created packages are 89% of the total but 0.2% of the recorded downloads. Compromised legitimate packages, meaning familiar names that ended up under someone else's control, are 7% and account for over 99% of those downloads.
Ten packages, all compromised legitimate ones, account for over 99% on their own. The download counts are monthly snapshots taken at scan time, not lifetime totals. The figures come from Databricks's own scanner, kept only when there was also an independent source: a public advisory, a vendor report, an npm takedown or an analyst review. This is not a census of every malicious package in the period.

Why are attacker-made packages not the main risk?
At the time of scanning, 81% of attacker-created packages had no downloads at all. They arrive in large numbers, often with a name that looks internal, and they sit unused unless something fetches them by mistake.
The problem for a business is different. Take an agent that prepares quotes, or an office that updates the library it already uses to read supplier invoices. If what changes is a name you already have on the list, the update can come in without anyone having chosen a new, unknown package.
Our read: watching only "suspicious" and newly created packages leaves uncovered the very point where the exposure is concentrated.
Is blocking install scripts enough?
54% of the packages declare a script that runs at install time. The rest execute when the package is imported or started. Blocking these scripts, Databricks writes, addresses roughly half of the observed cases.
In the largest campaign of the period, more than a thousand packages aimed at a single organisation, an install script appeared in only 1% of cases. In later waves, the way they executed kept changing.
Official removal by npm comes at a median of 7 days, and 10% take more than 59 days. At the time of the analysis, 16% were still installable. On the packages they created themselves, attackers withdrew them at a median of seven hours, before any registry action.
Does trusted publishing protect the packages you already use?
Trusted publishing is automatic publishing from a build environment, presented as safer than a long-lived password. In the period studied, after those long-lived tokens were revoked, attackers moved to taking over those environments.
Of the packages in the set published through trusted publishing, 85% are compromises of legitimate packages. Attacker-created packages use it in 0.1% of cases.
Our read: trusted publishing tells you which environment a package came from, not that the environment was safe. It should not be read as a guarantee stamp.
What does this have to do with your AI agents?
Databricks also flags MCP servers, meaning components that connect an AI assistant to tools and data, used to harvest credentials from the machine that hosts them; packages that change the assistant's configuration and instructions; and packages built to steal AI service keys. It writes that this surface did not exist two years ago.
If your agents can install packages on their own, or if an assistant can add a component to "help" with invoices, quotes or mail, you need a list of what they may add, and a person who approves every new name.
What about us?
If we were evaluating your agents that can install packages on their own, we would start from a list of what is already allowed and from a review before every new name. We would look first at packages you already use, not only at unknown ones. We have no public case on this practice, and we do not present it as something we already run.
What should you do now?
- If an agent, in your setup, can add a package without a review, write down what is allowed and have every new name approved first.
- If you only block install scripts, you cover about half of the cases Databricks observed. The rest run when the package is used.
- If you treat trusted publishing as a guarantee, you are reading more into it than it attests. It states provenance, not that the environment was intact.
- If you wait for official removal, remember the 7-day median and the share still installable at the time of the analysis.
“The risk is not the package nobody downloads. It is the name already on your list, if an agent or an update can change it without a review.”
DBrothers — on malicious npm packages and agents that install on their own
Frequently asked questions
Do the 7% and 99% figures apply to all of npm?
No. They apply to the downloads recorded in this set of about 5,400 confirmed malicious packages, not to the whole npm catalogue. Compromised legitimate packages are 7% of the set and account for over 99% of those downloads. Ten packages, all of this kind, account for over 99% on their own. The figures are Databricks's, from its own detector.
Does blocking install scripts protect you enough?
Not on its own. 54% of the packages declare an install script; the rest execute when they are imported or started. Databricks writes that this control addresses roughly half of the observed cases.
How long does npm take to remove a malicious package?
The registry's security takedown has a median of 7 days (7.1 in the detailed section of the report), with 10% taking more than 59 days. At the time of the analysis, 16% were still installable. Public advisories arrive sooner. 87% of the packages have one, and for those not tied to a named campaign the median is 1.7 days.
If you want to see which packages, in your setup, an agent can add without a review, we can start from a real process, such as quotes, invoices or incoming mail.
Glossary terms




