# The secure way to release an npm package in 2026

DevFeed: [The secure way to release an npm package in 2026](<https://devfeed.tech/articles/the-secure-way-to-release-an-npm-package-in-2026-19792.md>)

Original publisher: [Read original article](<https://evilmartians.com/chronicles/the-secure-way-to-release-an-npm-package>)

Author: Travis Turner (richardturner@evilmartians.com)

Published: 2026-07-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Evil Martians](<https://devfeed.tech/sources/evil-martians.md>)

Topics: [npm security](<https://devfeed.tech/topics/npm-security.md>), [npm](<https://devfeed.tech/topics/npm.md>), [software supply-chain attack](<https://devfeed.tech/topics/software-supply-chain-attack.md>), [project release](<https://devfeed.tech/topics/project-release.md>), [npm packages](<https://devfeed.tech/topics/npm-packages.md>), [Continuous integration](<https://devfeed.tech/topics/continuous-integration.md>), [Secure token management](<https://devfeed.tech/topics/secure-token-management.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [2fa](<https://devfeed.tech/tags/2fa.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [actions](<https://devfeed.tech/tags/actions.md>), [agent](<https://devfeed.tech/tags/agent.md>), [all](<https://devfeed.tech/tags/all.md>), [also](<https://devfeed.tech/tags/also.md>), [apply](<https://devfeed.tech/tags/apply.md>), [attack](<https://devfeed.tech/tags/attack.md>), [attacks](<https://devfeed.tech/tags/attacks.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [automatically](<https://devfeed.tech/tags/automatically.md>), [developer-community](<https://devfeed.tech/tags/developer-community.md>), [dx](<https://devfeed.tech/tags/dx.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [npm](<https://devfeed.tech/tags/npm.md>), [npm-package](<https://devfeed.tech/tags/npm-package.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [package](<https://devfeed.tech/tags/package.md>), [performance-scale](<https://devfeed.tech/tags/performance-scale.md>), [release](<https://devfeed.tech/tags/release.md>), [security](<https://devfeed.tech/tags/security.md>), [supply-chain](<https://devfeed.tech/tags/supply-chain.md>), [supply-chain-attack](<https://devfeed.tech/tags/supply-chain-attack.md>)

## AI overview

The excerpt recommends publishing npm packages through GitHub Trusted Publishing, restricting publishing access to trusted publishers, requiring two-factor authentication, and limiting who can create release tags. It also advises pinning third-party CI actions by commit SHA, adding CI security linting, and waiting three days before adopting new versions; some specific tool and setting names are missing from the excerpt. It recommends upgrading to npm 12, pnpm 10, yarn 4.14, or bun to prevent dependency scripts from running during installation, and says avoiding a build step is the most secure release approach. For releases, create and push a tag, then approve the staged package in npm; drydock can check the package diff before approval.

## Source excerpt

How to protect your npm package from being stolen in a supply chain attack and improve its position in security ratings