GitHub Package Firewall for npm: What the Public Preview Blocks and How to Set It Up
What Is the GitHub Package Firewall?
On October 20, 2026, GitHub put its package firewall into public preview. It sits between your endpoints (GitHub names coding agents and CI/CD hosts) or internal registries and the npm registry, and checks every metadata request and package download against a policy before the install goes through.
GitHub calls it an "install-time policy gate." The target is malware that runs when a package is installed, through preinstall or postinstall scripts, before anyone has a chance to read the code. GitHub says the risk is especially high for coding agents and CI runners, because they install dependencies with no human watching.
The short version:
| Ecosystem | npm only |
| Who can use it | All GitHub Enterprise Cloud customers, including data-resident Enterprise Cloud |
| Price | Free during the preview. Metered billing at general availability, similar to Actions |
| Status | Public preview, subject to change |
If you are on a Free, Pro or Team plan, this is not for you yet. The rest of this guide assumes Enterprise Cloud.
What the Firewall Can Block
The setup documentation lists five policy controls. They apply to every request through the firewall:
| Control | What it blocks | Default |
|---|---|---|
| Block known malware | Packages with an active malware advisory in the GitHub Advisory Database | On |
| Block vulnerability advisories | Versions with advisories at or above a severity you choose | Critical only |
| Block attestation downgrades | A version with no SLSA attestations when earlier versions had them | On |
| Block newly-introduced install scripts | A version that newly adds preinstall, postinstall or similar scripts |
On |
| Minimum package age | Versions newer than a cooldown of 1–365 days (0 disables it) | 1 day |
The last three are the interesting ones. Many npm supply-chain attacks follow the same pattern: an attacker takes over a maintainer account, publishes a new version with an install script, and catches everyone who installs in the next few hours. A one-day cooldown, a block on new install scripts, and a check for missing attestations each target part of that pattern. That is my reading of why these defaults exist; GitHub's post does not discuss specific incidents.
How to Set It Up
Step 1: Set the policy
An enterprise administrator or enterprise security manager opens the enterprise, clicks Policies, then Package firewall in the sidebar, and sets the five controls above. To delegate this, add the "Edit enterprise-level package firewall policy" permission to a custom role.
Step 2: Point npm at the firewall
You need a personal access token or bot-account token from a member of your enterprise. It only needs read-only access to public repositories. Keep it in a CI secret or environment variable, never in the repo.
Set GITHUB_TOKEN, then add this to your user-level .npmrc, replacing ENTERPRISE with your enterprise slug:
registry=https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE
//package-firewall.githubapp.com/npm/enterprises/ENTERPRISE/:_authToken=${GITHUB_TOKEN}
Or with the npm CLI:
npm config set registry \
https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE
npm config set \
'//package-firewall.githubapp.com/npm/enterprises/ENTERPRISE/:_authToken=${GITHUB_TOKEN}'
Do this on every endpoint that installs packages: CI runners and agent sandboxes first. Developer machines can use the same user-level .npmrc.
Step 3 (optional): Route through Artifactory
If your company already proxies npm through JFrog Artifactory, create a Remote npm repository whose URL is the firewall endpoint, then add it to a virtual npm repository. The docs warn to leave out any remote that reaches the public npm registry directly, "so it can't bypass the firewall." Artifactory support is marked experimental.
What Happens When a Package Is Blocked
A blocked install prints a notice with a bypass link. The docs show this example:
npm notice testcontainers: 1 version blocked by package-firewall due to security policies (version cooldown). Request an override: https://github.com/enterprises/octocats/security/bypass-requests/package-firewall/new?ecosystem=npm&package=testcontainers
The developer opens the link, checks the prefilled package and version, adds a reason and submits. An admin or security manager reviews it under Security and quality > Package firewall bypass. To allow every version of a package, they put * in the version field. Approved overrides become part of the policy and can be removed later under Policies > Package firewall > Package overrides.
Expect a few of these in the first week. The one-day cooldown will catch anyone who tries to install a version published that morning, including legitimate urgent fixes.
What You Should Do
- Start with CI and coding agents. These install packages unattended, which is exactly the case GitHub designed the firewall for.
- Keep the defaults at first. Raise the vulnerability threshold to "High or higher" once you see how often it blocks.
- Decide who approves bypasses before you roll out, so a blocked build does not wait a day for an answer.
- Check your Dependabot setup too. The same day, GitHub added Dependabot support for npm 12, pnpm 11 and 12, and Bun 1.4. One catch: for pnpm 12 projects that pin a pnpm version, Dependabot alerts and security updates are not yet created for dependencies in
pnpm-lock.yaml. - Give feedback in the community discussion. GitHub says further features depend on customer demand.
Limitations to know
- npm only. No PyPI, Maven or NuGet yet.
- Each request needs a valid token, and the registry URL is specific to your enterprise.
- It is a preview, so settings and behaviour may change before general availability.
FAQ
Is the GitHub package firewall free?
Free during the public preview. GitHub says it will move to metered billing, similar to Actions, at general availability.
Does the package firewall replace Dependabot?
No. Dependabot alerts you about vulnerable dependencies already in your project. The firewall stops a risky package version from being installed in the first place.
Can I use it with pnpm or Yarn?
GitHub's docs only cover npm and Artifactory. Other clients that read a standard npm registry URL may work, but GitHub does not document them.
