InsightsSecurity
GitHub's package firewall is in public preview for npm
On 20 October 2026 GitHub released a package firewall that checks npm installs against malware and vulnerability advisories, a minimum package age and other supply-chain rules before packages reach CI runners, agents or laptops. How it works, how to point endpoints at it and what breaks first.
Published October 23, 20266 min read
On 20 October 2026 GitHub put a package firewall into public preview for GitHub Enterprise Cloud, including Enterprise Cloud with data residency. It is a registry proxy between your endpoints and the public npm registry. Every metadata request and package download goes through it, gets checked against an enterprise-wide policy, and is blocked if it does not comply.
The changelog explains the reasoning plainly: recent malware campaigns run their payload at install time. That is most dangerous on CI runners and AI agent sessions, which install dependencies with no person watching. A firewall in the install path stops a bad version before its postinstall script runs, not after a scanner flags it in a pull request.
At launch it supports npm packages only, and it is free during the preview. GitHub says it will be billed on metered usage at general availability, similar to Actions.
What the policy can block
Enterprise administrators and security managers set the policy under Policies → Package firewall in the enterprise settings. It applies to every request through the firewall. The setup guide lists five controls:
| Control | Default | What it blocks |
|---|---|---|
| Block known malware | On | Versions with an active malware advisory in the GitHub Advisory Database |
| Block vulnerability advisories | Critical only | Versions affected by an advisory at or above the chosen severity: Critical, High, Medium or any |
| Block attestation downgrades | On | A version without SLSA attestations when earlier versions had them |
| Block newly-introduced install scripts | On | Versions that add a preinstall, postinstall or similar script the previous versions did not have |
| Minimum package age | 1 day | Versions published less recently than the threshold (1–365 days; 0 disables it) |
The last three are the interesting ones, because they do not depend on anyone having reported the package yet. A hijacked maintainer account that publishes a new version usually publishes it without the provenance the project's CI used to produce, often adds an install script, and is caught within hours or days. Attestation downgrades, new install scripts and a cooling-off period each target one of those traits.
The minimum age is the same idea as the cooling-off period described in automated dependency updates with Renovate, but enforced at the registry instead of in each repository's bot configuration. Renovate's delay only governs the pull requests it opens. The firewall also covers a developer running npm install some-package@latest by hand, or an agent adding a dependency in the middle of a task.
Pointing endpoints at it
Each enterprise gets its own registry URL:
https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISEReplace ENTERPRISE with your enterprise slug. Every request needs a token belonging to a user or bot account that is a member of the enterprise. The docs ask only for read-only access to public repositories, and a GitHub staff member confirmed in the feedback discussion that a fine-grained personal access token works.
On a workstation, this goes in the user-level .npmrc, with the token in an environment variable rather than in the file:
registry=https://package-firewall.githubapp.com/npm/enterprises/octo-enterprise
//package-firewall.githubapp.com/npm/enterprises/octo-enterprise/:_authToken=${PACKAGE_FIREWALL_TOKEN}In GitHub Actions, the same configuration is a single step before the install. Use a token from a dedicated machine account that is an enterprise member, stored as a secret, so the build does not depend on one person's account:
jobs:
test:
runs-on: ubuntu-latest
env:
PACKAGE_FIREWALL_TOKEN: ${{ secrets.PACKAGE_FIREWALL_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Route npm through the package firewall
run: |
npm config set registry https://package-firewall.githubapp.com/npm/enterprises/octo-enterprise
npm config set '//package-firewall.githubapp.com/npm/enterprises/octo-enterprise/:_authToken=${PACKAGE_FIREWALL_TOKEN}'
- run: npm ci
- run: npm testTeams that already run JFrog Artifactory can add the firewall as an npm remote repository behind their virtual repository instead of reconfiguring every endpoint. GitHub marks this integration as experimental. The guide also makes the important point: remove any other remote that pulls straight from the public npm registry, or the virtual repository will happily serve packages the firewall would have blocked.
Existing lockfiles mostly keep working
A package-lock.json records a resolved URL for every package, normally on registry.npmjs.org. You do not need to regenerate it. npm's replace-registry-host setting defaults to npmjs, which rewrites URLs from the default registry to the configured one at install time. Lockfiles resolved against some other host, such as an older internal mirror, are not rewritten by default and will keep downloading from that host. Search lockfiles for "resolved" URLs before assuming everything is routed.
Private packages
The firewall only pulls from npmjs.org. A GitHub staff member stated in the discussion that using it alongside GitHub Packages is currently one or the other, and that GitHub expects to add that kind of configuration before general availability. Until then, route your private scopes to their own registry with an ordinary scoped entry such as @octo-org:registry=https://npm.pkg.github.com. Those packages bypass the firewall, which is acceptable for code you publish yourself.
What goes wrong first
The policy changes what an unchanged lockfile can install. The firewall checks downloads, not just new resolutions. When a critical advisory is published against a version in your lockfile, the next clean npm ci of that commit fails, on a branch nobody has touched. That is the intent, but it lands as a broken build. Decide in advance who handles it and whether hotfix branches need a fast exception path.
Fresh versions fail in CI before they fail locally. If developers install from the public registry while CI goes through the firewall, a developer can lock a version published an hour ago, push, and get a red build with the one-day default. Configure laptops and CI the same way, or the minimum age turns into a source of confusing failures rather than a control.
latest can point at a blocked version. A user in the feedback discussion reported that with a minimum age set, npm install undici failed with ETARGET because the latest dist-tag pointed to a version still inside the window, and asked for latest to be remapped to the newest allowed version. GitHub has not responded on that yet. Pinning explicit versions avoids it.
Caches skip the check. A tarball already in the runner's npm cache, or in an Artifactory cache populated before the firewall was added, is not downloaded again, so it is not evaluated again. Be aware of that when deciding how much a cache restore is worth, and purge older remote caches when you switch.
The firewall only sees traffic sent to it. Anything that still reaches registry.npmjs.org directly, whether a container build with its own .npmrc or a tool using a hard-coded registry, is unprotected. Where you control egress, for example on self-hosted runners, blocking the public registry is the only way to make the routing mandatory.
Editing the policy is limited to enterprise administrators and security managers by default. The "Edit enterprise-level package firewall policy" permission can be added to a custom enterprise role to delegate it, for example to a platform security team that handles bypass requests.
What to do now
The package firewall complements the controls GitHub has added to the pipeline recently: workflow lockfiles pin the actions a job runs, and the firewall screens the packages the job installs. For an Enterprise Cloud organization with npm projects, a reasonable trial looks like this:
- Create a machine account in the enterprise and a fine-grained token with read-only public repository access, stored as an Actions secret.
- Leave the policy at its defaults and route one repository's CI through the firewall. Check its lockfiles for
resolvedhosts other thanregistry.npmjs.orgfirst. - Run it for a week and look at what was blocked and which bypass requests came in.
- Give developers the same
.npmrc, so local and CI installs agree, and agree who triages advisory-driven build failures. - Widen to more repositories and agent environments, and consider raising the advisory threshold to High once the exception workflow has settled.
It is a preview with one ecosystem, so keep Dependabot alerts and your existing scanning in place. Projects that depend heavily on GitHub Packages for private npm scopes should wait for the upstream configuration GitHub has said it plans to add before general availability.