GitHub package firewall is a proxy that sits between your machines and the public npm registry and refuses to serve package versions that break your enterprise's policy: known malware, vulnerable versions, versions that are too new, versions that quietly add install scripts, and versions that drop their provenance attestations. It entered public preview on October 20, 2026, works with npm only for now, and is available to GitHub Enterprise Cloud customers at no charge during the preview. Below: what it blocks, how to set it up, where it falls short, and what to run instead if you are not on Enterprise Cloud.
What GitHub package firewall is
The changelog announcement describes it as a layer between endpoints (CI runners, coding agents, developer workstations, or an internal registry) and upstream package repositories. Every metadata request and every tarball download passes through it, and each one is checked against a policy that enterprise admins define. If a version fails the policy, the install fails with a message containing a link to request an exception.
It is an install-time gate, not a scanner. It does not read your repository or open pull requests. It decides, at the moment a package manager asks for a version, whether that version is allowed onto the machine.
Key facts as of November 2026:
| Question | Answer |
|---|---|
| Status | Public preview, subject to change |
| Plan | GitHub Enterprise Cloud, including data-resident GHE.com |
| Price | Free during preview; GitHub says metered billing, similar to Actions, at general availability (no rates published) |
| Ecosystems | npm only |
| Client setup documented | npm CLI via .npmrc; JFrog Artifactory remote repository (experimental) |
| Where policy lives | Enterprise > Policies > Package firewall |
GitHub showcased it at Universe on October 28–29, alongside push protection for AI-detected secrets, which is also in public preview and consumes AI credits.
Why an npm package firewall, and why now
2026 has been a bad year for the npm ecosystem, and the incidents explain each of the firewall's controls.
Mini Shai-Hulud (May 2026). Akamai's analysis describes a May 11 wave that published malicious versions across the TanStack dependency tree, then spread to packages linked to Mistral AI, UiPath, OpenSearch and others. The initial access did not involve a stolen password. A pull-request workflow poisoned a GitHub Actions cache, a later release workflow loaded it, and the worm exchanged runner tokens for npm publish credentials. Because the publish workflow itself was legitimate, the malicious releases still passed SLSA attestation checks. The worm's full source was posted publicly on May 12.
AsyncAPI (July 2026). Microsoft Threat Intelligence documented five malicious versions across four @asyncapi packages, published within about 90 minutes on July 14. A pull_request_target workflow ran attacker-controlled code, exposing a bot token that was then used to trigger the real release pipeline. Two details matter for defenders:
- The payload ran at import time. There were no
preinstallorpostinstallhooks, so--ignore-scriptsdid not help. - The packages carried valid provenance attestations, because the signed builds came from the real workflow running unauthorized commits.
The common thread: malicious versions that look legitimate, published through legitimate pipelines, live for hours before removal. A rule that refuses anything published in the last day or week would have kept most of these versions off machines that installed during the window. That is the core of the firewall, and of the cooldown settings package managers now ship.
What GitHub package firewall blocks
The setup documentation lists five controls. They apply to every request that passes through the firewall for your enterprise.
| Control | What it does | Default |
|---|---|---|
| Block known malware | Blocks packages with an active malware advisory in the GitHub Advisory Database | On |
| Block vulnerability advisories | Blocks versions affected by advisories at or above a severity you pick: Critical only, High+, Medium+, or Any | Critical only |
| Block attestation downgrades | Blocks a version that lacks SLSA attestations when earlier versions had them | On |
| Block newly-introduced install scripts | Blocks versions that add preinstall/postinstall-style scripts the previous versions did not have |
On |
| Minimum package age | Blocks versions newer than N days (1–365; 0 disables) | 1 day |
Map those against the incidents above and you can see the coverage and the gaps:
- Minimum age is the control that would have mattered most for both Mini Shai-Hulud and AsyncAPI, since both sets of malicious versions were pulled from the registry quickly.
- Attestation downgrade catches an attacker publishing from a laptop with a stolen token, where the package historically shipped with provenance. It would not have caught either 2026 incident, because both published through the real pipeline.
- New install scripts catches the classic worm pattern of adding a
postinstallhook. It would not have caught AsyncAPI's import-time payload. - Malware advisories work once someone has reported the package. They are reactive, but they also cover old, never-reported malicious packages that a cooldown cannot.
No single control is enough, which is why GitHub ships all five on by default.
How to set up GitHub package firewall
1. Prerequisites
- An enterprise on GitHub Enterprise Cloud.
- Enterprise owner or security manager role to edit policy. Others need a custom role with the Edit enterprise-level package firewall policy permission.
- A token for each endpoint. The docs say the token's user or bot account must be a member of the enterprise and the token needs only read-only access to public repositories.
2. Configure policy
Go to your enterprise, select Policies, then Package firewall. Start with the defaults, then decide on vulnerability severity and minimum age. One day is the default. Seven days gives researchers and registries more time to catch a bad release, at the cost of slower adoption of legitimate fixes, though you can grant exceptions for urgent security patches.
3. Point npm at the firewall
Replace ENTERPRISE with your enterprise slug. In a user-level .npmrc:
registry=https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE
//package-firewall.githubapp.com/npm/enterprises/ENTERPRISE/:_authToken=${GITHUB_TOKEN}
Or with the 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}'
Export GITHUB_TOKEN from a secret store and keep it out of the repository.
4. Wire it into CI
GitHub's page does not include an Actions example, so this one is ours. It stores an enterprise-member token as a repository or organization secret and exposes it as the GITHUB_TOKEN variable that the .npmrc line expects. Check the docs before assuming the built-in Actions token satisfies the membership requirement.
name: ci
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
- name: Route npm through package firewall
run: |
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}"
env:
ENTERPRISE: my-enterprise
- run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.PACKAGE_FIREWALL_TOKEN }}
If you already authenticate Actions to cloud providers with short-lived tokens, the same least-privilege thinking applies here. Our GitHub Actions OIDC guide covers that pattern.
5. Check the lockfile does not bypass it
package-lock.json records a resolved URL for every package, usually on registry.npmjs.org. npm's replace-registry-host setting defaults to npmjs, which rewrites public-registry URLs in the lockfile to your configured registry. That default is what keeps npm ci going through the firewall. Do not set it to never, and verify with a deliberately blocked package (for example, a version newer than your minimum age) that installs actually fail.
6. Artifactory (experimental)
If developers already resolve through JFrog Artifactory, create an npm Remote repository pointing at https://package-firewall.githubapp.com/npm/enterprises/ENTERPRISE with token authentication, add it to a virtual repository alongside your private repos, and remove any remote that fetches directly from the public registry. Leave one direct remote in place and the firewall becomes optional.
Exceptions and day-to-day friction
When the firewall blocks a version, the npm output or CI log contains a request URL. The developer fills in repository, package, version and reason. Approvers find requests under Security and quality > Package firewall bypass and can widen the version to * before approving. Approved exceptions live under Policies > Package firewall > Package overrides.
Two details from the docs will catch people out:
- Exception versions match exactly or by text prefix (
1.2.3,1.*,*). Semver ranges like^1.2.3or>=1.0.0 <2.0.0are not evaluated as ranges. - Caches bypass policy changes. The troubleshooting page warns that if a package manager or proxy serves a cached copy, no request reaches the firewall, so a newly blocked version can still install. To test, install into an empty cache with scripts disabled:
npm install some-package@1.2.3 --cache "$(mktemp -d)" --ignore-scripts
Expect the minimum-age rule to generate most of the noise. Teams that run Renovate or Dependabot already wait a few days before proposing upgrades, so set the firewall's minimum age at or below your bot's cooldown, or bot PRs will fail CI.
Limitations to know before you roll it out
- npm only. No PyPI, Maven, NuGet or Go support yet. GitHub has not published dates for other ecosystems.
- pnpm, Yarn and Bun are not documented. They can read registry settings, but GitHub only documents the npm CLI and Artifactory. Test your package manager before declaring coverage.
- It only protects traffic routed through it. A developer with a personal
.npmrc, a Dockerfile that runsnpm installagainst the default registry, or a coding agent with its own config will skip it. Enforce at the network layer, or through Artifactory, where you can. - It doesn't remediate. A malicious version that installed before the policy blocked it is still on disk and in caches. You still need incident response.
- Preview terms. Behavior, UI paths and limits may change, and pricing after GA is not yet known.
Defense in depth without GitHub Enterprise Cloud
Most teams are not on Enterprise Cloud. The good news is that package managers now ship the most valuable control, a release-age cooldown, along with script blocking.
| Tool | Setting | What it does | Default |
|---|---|---|---|
| npm 11.10+ | min-release-age (days) |
Only installs versions older than N days | Off (null) |
| npm 12 | allowScripts in package.json |
Dependency lifecycle scripts blocked unless approved | Blocked |
| npm 12 | allow-git, allow-remote |
Git and URL dependencies blocked | none |
| pnpm 11+ | minimumReleaseAge (minutes) |
Release-age cooldown | 1440 (1 day) |
| pnpm 11+ | strictDepBuilds / allowBuilds |
Fails on unapproved build scripts | On |
| pnpm 11+ | blockExoticSubdeps |
Transitive deps cannot come from git or tarball URLs | On |
| pnpm | trustPolicy: no-downgrade |
Fails if a package's trust level drops | Off |
| Yarn (current docs) | npmMinimalAgeGate, enableScripts |
Age gate; third-party postinstall disabled | 1w; false |
| Dependabot | cooldown |
Waits before opening version-update PRs | 3 days since July 2026 |
Sources: the npm config reference, the npm 12.0.0 release notes, the pnpm supply-chain security guide, the Yarn configuration reference and the Dependabot cooldown changelog.
A practical npm baseline in the project .npmrc:
min-release-age=3
allow-git=none
allow-remote=none
With npm 12, review which dependencies want to run install scripts and approve only those you need:
npm install-scripts ls
npm install-scripts approve esbuild sharp
A pnpm baseline in pnpm-workspace.yaml:
minimumReleaseAge: 4320 # 3 days, in minutes
minimumReleaseAgeExclude:
- '@my-org/*' # your own packages can ship immediately
trustPolicy: no-downgrade
blockExoticSubdeps: true
strictDepBuilds: true
Then keep the basics:
- Commit the lockfile and install with
npm ciorpnpm install --frozen-lockfilein CI, so a build can't silently pick up a new version. - Harden your own publishing. Both 2026 incidents started with CI workflows that ran untrusted pull-request code with access to secrets. Avoid
pull_request_targetwith checkout of PR code, scope tokens tightly, and use npm trusted publishing instead of long-lived tokens. - Don't treat provenance as proof of safety. It proves where a package was built, not that the commit was authorized. Mini Shai-Hulud and AsyncAPI both had valid attestations.
- Know what you ship. Generate SBOMs so you can answer "did we install version X" in minutes. See our SBOM guide.
- Add software composition analysis for vulnerability and malware alerts on what is already in your tree. We compared options in our SCA tools roundup.
When you edit .npmrc or package.json across many repos, a quick pass through a JSON formatter catches the trailing-comma mistakes that break installs.
Should you turn on GitHub package firewall?
If you are on Enterprise Cloud and mostly use npm, yes: it is free during the preview, the defaults are sensible, and it gives you one central place to enforce cooldowns and malware blocking across CI, agents and laptops instead of trusting every repository's config. Roll it out to CI first, where configuration is centralized, then to developer machines. If you are not on Enterprise Cloud, the package-manager settings above get you most of the protection today.
Frequently Asked Questions
Is GitHub package firewall free?
During the public preview it is free for GitHub Enterprise Cloud customers. GitHub says it will move to metered, usage-based billing similar to Actions at general availability, and has not published rates.
Does GitHub package firewall work with pnpm or Yarn?
GitHub's documentation only covers the npm CLI and JFrog Artifactory (experimental). pnpm and Yarn can be pointed at a custom registry, but GitHub does not document or guarantee that setup during the preview, so test it before relying on it.
Would the package firewall have stopped the AsyncAPI compromise?
The minimum-age rule would have blocked the malicious versions for anyone installing during the window before they were removed, since they were less than a day old. The install-script and attestation-downgrade checks would not have caught them: the payload ran at import time and the packages had valid provenance.
What is the npm min-release-age setting?
min-release-age is an npm CLI config, added in npm 11.10.0, that only installs versions published more than the given number of days ago. It defaults to off. pnpm's equivalent is minimumReleaseAge in minutes, which defaults to one day from pnpm 11.
Does --ignore-scripts protect against malicious npm packages?
Only against payloads in lifecycle scripts like postinstall. Microsoft's AsyncAPI analysis shows malware that runs when the package is imported, which --ignore-scripts does not stop. Combine script blocking with a release-age cooldown and lockfile-based installs.
Conclusion
GitHub package firewall moves npm supply-chain policy from each repository's config to a central gate: malware and vulnerability blocking, a default one-day cooldown, and checks for new install scripts and lost attestations. It is npm-only, Enterprise Cloud-only and in preview, and it only protects traffic you actually route through it. Everyone else should switch on min-release-age or minimumReleaseAge, adopt npm 12's script approvals or pnpm 11's defaults, and fix the CI workflows that let 2026's attacks in.