The OpenJS Security Collaboration Space has been working closely with GitHub’s npm team to understand how new security features affect projects and maintainers, especially as threats and tools keep evolving.

The npm ecosystem has faced an increased wave of supply chain attacks, and security practices around publishing JavaScript packages are changing fast.
The OpenJS Foundation and its Security Collaboration Space are focused on keeping the ecosystem safe and reliable for the developers and communities who depend on it. As stewards of many of the web’s most-used JavaScript projects, we take that responsibility seriously.
Lately, we’ve been working closely with GitHub’s npm team to understand how new security features affect projects and maintainers, especially as threats and tools keep evolving.
JavaScript powers virtually everything: browsers, mobile apps, IoT devices, TVs, and AI models on the web. npm is the distribution backbone for this global footprint. Its scale makes it a high-value target.
npm serves 17M registered developers and powers ~370B monthly downloads. The average JavaScript project pulls in ~683 transitive dependencies, which is orders of magnitude more than typical projects in other languages.
This compounding dependency depth, plus the ubiquity of JavaScript across the stack, means package publishing is a security-critical operation. The more visible and auditable the publishing trail, and the more resilient the authentication flow, the better off the entire web is.
npmjs.com’s implementation of Trusted Publishing is promising for JavaScript, but it’s not ready for critical packages just yet. Some controls, like even the possibility of enforcing 2FA, still need to mature to ensure maintainers aren’t exposed to hard-to-detect risks.
The OpenJS Security Collaboration Space has compiled recommendations for publishing securely.
Given the active threats and evolving landscape, maintainers need practical guidance to evaluate their options. There's no single solution for every project, security is always a spectrum. Below we outline three approaches for publishing securely to npm and the trade-offs of each.
Publishing locally with strong personal auth (non-SMS 2FA) remains the most predictable and secure route for many projects.
Why
Trade-offs
When to favor it: Security-critical libraries with a small, trusted maintainer set.
For an in-depth review: Check this GitHub repository
Automating releases via CI centralizes the workflow for multi-maintainer projects, but adds risk.
If your project already uses CI for releases, be aware that recent changes to npm’s token system will affect your workflows. Starting December 9, npm will revoke all existing classic tokens and prevent the creation of new ones.
Even if you’ve migrated to granular tokens, any existing tokens with longer expiration dates will be automatically capped to February 3, 2026. After that date, all newly created tokens with write access scope will have a maximum allowed lifespan of 90 days, requiring regular rotation.
These changes may disrupt existing release pipelines, including those that follow the previously recommended setup in GitHub's official documentation.
Benefits
Risks
Hardening tips
Trade-offs
For an in-depth review: Check this GitHub repository
GitHub’s token-less approach is an important step, but today we don't yet recommend it for high-value packages, though we're encouraged by GitHub's progress.
Why (current gaps)
We believe Trusted Publishing represents the future, but it’s not yet ready for adoption in critical projects, as in its current state it wouldn’t prevent attacks such as Shai-Hulud and other recent ones.
For an in-depth review: Check this GitHub repository
We appreciate GitHub’s responsiveness and progress. We’ll keep collaborating and will update this guidance as capabilities mature. To summarize:
This balances practical maintainability with verifiable trust that is crucial in an ecosystem where a single publisher can cascade across hundreds of transitive dependencies and millions of weekly downloads.
The JavaScript ecosystem is enormous, interdependent, and essential infrastructure. Maintaining public auditability, traceable ownership, and responsible authentication practices is how we reduce risk at npm’s scale.
The npm team has been responsive to community feedback, and we're committed to continuing this collaboration while giving maintainers actionable guidance today.
The OpenJS Security Collaboration Space will continue publishing updates as GitHub and npm evolve their model. We’ve also prepared example repositories demonstrating each setup (local, hardened CI, and the current state of Trusted Publishing) so maintainers can compare configurations side-by-side and understand trade-offs quickly.

The OpenJS Security Collaboration Space is a working group through the OpenJS Cross Project Council (our technical advisory committee). We bring together maintainers, security experts, and partners to raise the bar for JavaScript supply-chain security. To get involved, join us on Mondays in the Security Collab Space, visit openjsf.org or join our public Slack where you can chat with us on the #security and #npm channels and more.