Skip to content

Exclude package registries from engine default network domains - #54055

Merged
pelikhan merged 7 commits into
mainfrom
lpcox-issue-3089-engine-package-registries-bypass-network-5931cd
Aug 19, 2026
Merged

Exclude package registries from engine default network domains#54055
pelikhan merged 7 commits into
mainfrom
lpcox-issue-3089-engine-package-registries-bypass-network-5931cd

Conversation

@lpcox

@lpcox lpcox commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Package registry domains (registry.npmjs.org for Copilot/Gemini/Pi; registry.npmjs.org, pypi.org, files.pythonhosted.org for Claude) were unconditionally merged into engine default network allow-lists, letting an agent reach npm/PyPI even when a workflow declared network: {} or network: { allowed: [defaults, github] }. This contradicted the documented rule that package ecosystems require explicit opt-in. This PR removes those registries from engine defaults and requires an explicit network.allowed ecosystem entry (e.g. node, python) or matching runtimes: declaration for agent-side access.

Change Classification

  • Type: bug-fix
  • Scope: pkg/workflow (network domain defaults), .github/workflows (shared engine configs), docs/reference
  • Breaking: Yes — workflows that relied on implicit agent-side access to npm/PyPI registries via engine defaults must now add the corresponding ecosystem (node, python, ...) to network.allowed and recompile.

Key Changes

File Change Impact
pkg/workflow/domains.go Removed npm and PyPI registry domains from all engine default lists; added rationale comments high
pkg/workflow/domains_package_registry_test.go New unit tests asserting engine defaults exclude package registries while keeping required transport domains high
pkg/workflow/domains_package_registry_integration_test.go New integration test compiling real workflows to verify registries are gated behind explicit ecosystem opt-in high
pkg/workflow/domains_test.go Removed npm registry from expected defaults; added security-hardening assertions high
.changeset/engine-defaults-exclude-package-registries.md New changeset documenting the behavior change and migration guidance medium
docs/src/content/docs/reference/network.md Clarified that engine defaults exclude node/python package registries; linked enforcement tests medium
.github/workflows/dependabot-go-checker.md Added node to network.allowed to restore npm access needed for Playwright MCP version check medium
.github/workflows/shared/crush.md Removed registry.npmjs.org from engine default domain list medium
.github/workflows/shared/deepseek-harness.md Removed registry.npmjs.org from engine default domain list medium
.github/workflows/shared/opencode.md Removed registry.npmjs.org from engine default domain list medium
docs/src/content/docs/guides/third-party-agent.md Updated example to drop registry domain from engine defaults low

Impact Assessment

  • Workflows that declare network: {} or network: { allowed: [defaults, ...] } without an ecosystem entry will lose implicit access to npm/PyPI registries from within the agent sandbox; any web-fetch or in-sandbox tooling hitting these registries will start failing until node/python is added to network.allowed.
  • Engine CLIs, SDKs, and containerized npx/uvx MCP servers are unaffected since they run outside the agent sandbox and are unrelated to firewall-enforced network defaults.
  • Model/API transport domains (e.g. api.githubcopilot.com, api.anthropic.com) are unchanged.
  • One in-repo shared workflow (dependabot-go-checker.md) required an explicit node ecosystem addition to keep working, illustrating the type of migration other consumers will need.
  • New regression tests (unit + integration) lock in the new behavior to prevent future regressions of this security gap.

Commits

f0a41a3c7 Merge branch 'main' into lpcox-issue-3089-engine-package-registries-bypass-network-5931cd
383b2d37f Merge branch 'main' into lpcox-issue-3089-engine-package-registries-bypass-network-5931cd
c35cf1fe1 Group Pi default-domain checks into named subtests
fdec0fae4 Add generic ecosystem-overlap regression test and strengthen docs
dce843bf9 Merge branch 'main' into lpcox-issue-3089-engine-package-registries-bypass-network-5931cd Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
b5a775ad6 Narrow network.md registry guarantee to node/python ecosystems
f014cdbc4 Exclude package registries from engine default network domains
```> Generated by [PR Description Updater](https://github.com/github/gh-aw/actions/runs/32310628396) for #54055 · auto · 48.6 AIC · ⌖ 8.31 AIC · ⊞ 7.6K · [◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw+%22gh-aw-workflow-call-id%3A+github%2Fgh-aw%2Fpr-description-caveman%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Description Updater, engine: copilot, model: auto, id: 32310628396, workflow_id: pr-description-caveman, run: https://github.com/github/gh-aw/actions/runs/32310628396 -->

Engine default domain lists unconditionally included package registries —
registry.npmjs.org for Copilot, Gemini and Pi, plus pypi.org and
files.pythonhosted.org for Claude. Because those defaults are unioned into the
AWF allow-list by mergeDomainsWithNetworkToolsAndRuntimes, npm and PyPI stayed
reachable from the agent sandbox even for `network: {}` or
`network: { allowed: [defaults, github] }`, contradicting the documented
behavior that package ecosystems require explicit opt-in.

Registries are not needed inside the sandbox: engine CLIs and SDKs are
installed by runner steps that run before the AWF-wrapped agent step, and
containerized npx/uvx MCP servers are launched by the MCP gateway on the Docker
bridge network, outside the agent firewall namespace. Model/API transport
domains are unchanged.

Package registries now require an explicit `network.allowed` ecosystem entry
(node, python, ...) or a matching `runtimes:` declaration. The in-repo
dependabot-go-checker workflow, which web-fetches registry.npmjs.org, now
declares the node ecosystem; the sample third-party engine definitions drop the
registry from their declared defaults for the same reason.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 19, 2026 17:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes implicit npm/PyPI access from built-in engine firewall defaults, requiring explicit ecosystem or runtime opt-in.

Changes:

  • Removes registry domains from engine defaults.
  • Adds unit and compile-level gating tests.
  • Updates workflows, documentation, samples, and generated lock files.
Show a summary per file
File Description
pkg/workflow/domains.go Removes registry defaults.
pkg/workflow/domains_test.go Updates default-domain assertions.
pkg/workflow/domains_package_registry_test.go Tests registry gating across engines.
pkg/workflow/domains_package_registry_integration_test.go Tests compiled firewall output.
.github/workflows/dependabot-go-checker.md Explicitly enables Node registry access.
.github/workflows/shared/crush.md Removes implicit npm access.
.github/workflows/shared/deepseek-harness.md Removes implicit npm access.
.github/workflows/shared/opencode.md Removes implicit npm access.
docs/src/content/docs/reference/network.md Documents explicit registry opt-in.
docs/src/content/docs/guides/third-party-agent.md Updates the custom-engine example.
.changeset/engine-defaults-exclude-package-registries.md Records the security change.
249 .github/workflows/*.lock.yml files Recompiles firewall allow-lists.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 26/260 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@@ -181,7 +181,11 @@ network:
- "api.example.com" # Custom domain
```

Each engine has a built-in default domain list for its CLI authentication. See [`domains.go`](https://github.com/github/gh-aw/blob/main/pkg/workflow/domains.go) for the full lists.
Each engine has a built-in default domain list for its CLI authentication and model API transport. These lists are merged with your `network.allowed` entries and **never include package registries** such as npm or PyPI: selecting an engine does not grant the agent access to `registry.npmjs.org`, `pypi.org`, or `files.pythonhosted.org`. Engine CLIs and SDKs are installed by workflow steps that run on the runner before the sandboxed agent starts, and containerized `npx`/`uvx` MCP servers are launched by the MCP gateway outside the agent firewall, so registry access inside the sandbox is not required for them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b5a775a: narrowed the network.md guarantee to the node/python ecosystem registries specifically, and clarified that ghcr.io/packagecloud.io/packages.microsoft.com in Claude's defaults are OS-level package/container hosts (not language registries) that remain outside this invariant.

@lpcox

lpcox commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in eb0... (narrowed the network.md guarantee to the node/python ecosystem registries specifically, and clarified that unrelated infra domains like ghcr.io/packagecloud.io/packages.microsoft.com in Claude's defaults are OS-level package/container hosts, not language registries, and aren't covered by this invariant).

@copilot address review feedback

Correction: addressed in b5a775a (narrowed the network.md guarantee to the node/python ecosystem registries specifically, and clarified that unrelated infra domains like ghcr.io/packagecloud.io/packages.microsoft.com in Claude's defaults are OS-level package/container hosts, not language registries, and aren't covered by this invariant).

@github-actions

Copy link
Copy Markdown
Contributor

Hey @lpcox 👋 — Great security fix! This PR effectively closes the package registry bypass vulnerability by removing registry.npmjs.org, pypi.org, and files.pythonhosted.org from engine default domains, ensuring that node/python ecosystems require explicit opt-in via the network: configuration.

The security design is sound:

  • Preserves trusted installation paths (GitHub Actions steps run outside AWF)
  • Containerized MCP servers stay on the Docker bridge network (outside firewall namespace)
  • Transport domains (api.githubcopilot.com, api.anthropic.com, etc.) remain untouched
  • Threat-detection ecosystem is unaffected
  • Comprehensive test coverage (unit + integration) validates the gating matrix

The change is well-scoped—it touches domain defaults, test files, workflow samples, documentation, and lock files (recompiled). Validation is thorough:

  • make agent-report-progress passes (fmt, lint, tests, recompile)
  • Integration tests (TestCompiledWorkflowGatesPackageRegistries) all pass
  • Recompile audit confirms only intended registry removals

This looks ready for review and merge. Nice work hardening the sandbox model!

Generated by ✅ Contribution Check · auto · 52.7 AIC · ⌖ 5 AIC · ⊞ 9.2K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot This PR looks ready for a final maintainer-facing handoff.

  • Please refresh the branch if GitHub offers one.
  • Then run the pr-finisher skill and leave a concise maintainer-visible handoff comment summarizing validation and any remaining merge risks.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 15.5 AIC · ⌖ 8.18 AIC · ⊞ 9.3K ·
Comment /souschef to run again

…ypass-network-5931cd

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot add test case to clearly prevent and update specs to prevent this to happen

Copilot AI and others added 2 commits August 19, 2026 21:47
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@copilot add test case to clearly prevent and update specs to prevent this to happen

Added TestEngineDefaultDomainsDoNotOverlapEcosystems in fdec0fa (refined in c35cf1f): instead of checking a fixed list of known registry hostnames, it checks each engine's default domain list against the full node/python ecosystem domain sets in data/ecosystem_domains.json, so any future re-addition of a registry-related domain (not just the three fixed here) is caught automatically. Verified it fails when a registry domain is deliberately reintroduced. Also updated the invariant comment in domains.go and the network.md spec to point at this test as the enforcement mechanism.

Copilot AI requested a review from pelikhan August 19, 2026 21:49
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot This PR looks close, but it still needs a maintainer-facing finish pass.

  • The earlier review feedback appears addressed on-thread.
  • Please refresh the branch if GitHub offers one.
  • Then run the pr-finisher skill and leave a concise maintainer-facing handoff comment summarizing validation and any remaining merge risks.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 18.9 AIC · ⌖ 9.64 AIC · ⊞ 9.3K ·
Comment /souschef to run again

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@copilot This PR looks close, but it still needs a maintainer-facing finish pass.

  • The earlier review feedback appears addressed on-thread....

Handoff summary: branch is up to date with origin (no rebase needed), working tree clean at 383b2d3. go build ./... and go test ./pkg/workflow/ (full package) pass. Prior review feedback (network.md invariant scope, generic ecosystem-overlap regression test) is already addressed on-thread in b5a775a/fdec0fa/c35cf1f. No open code-change requests remain; no further merge risks identified.

@pelikhan
pelikhan merged commit 87c6f22 into main Aug 19, 2026
4 checks passed
@pelikhan
pelikhan deleted the lpcox-issue-3089-engine-package-registries-bypass-network-5931cd branch August 19, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants