Repository navigation
Description
Summary
Copilot threat detection automatically allows registry.npmjs.org, even without a Node ecosystem opt-in. The stated purpose is read-only lockfile validation, but the generated network rule is a host allow-list entry, not a read-only registry capability. This is a new finding; it concerns detection runs, not ordinary Copilot agent defaults.
Affected sets
| Set | Domain | Bucket | File:line |
|---|---|---|---|
engine-defaults.threat-detection |
registry.npmjs.org |
package registry | pkg/workflow/data/ecosystem_domains.json:270 |
ecosystems.threat-detection |
registry.npmjs.org |
package registry, compatibility alias | pkg/workflow/data/ecosystem_domains.json:259 |
node |
registry.npmjs.org |
package registry overlap | pkg/workflow/data/ecosystem_domains.json:196 |
Why this is suspicious
GetThreatDetectionAllowedDomains always copies the detection set, and buildCopilotAllowedDomains calls it for detection runs (pkg/workflow/domains.go:720-734, pkg/workflow/copilot_engine_execution.go:489-497). Inline detection configures unrestricted shell tools and identifies AWF as its primary network constraint (pkg/workflow/threat_detection_inline_engine.go:97-114). BuildAWFConfigJSON supplies this entry as network.allowDomains, without a registry-specific read-only constraint (pkg/workflow/awf_config_build.go:67-74). Thus the hostname grant itself does not establish that only the documented metadata lookup is possible. This is a static policy observation, not an observed network request or demonstrated misuse.
The code explicitly justifies the host for lockfile integrity validation and says installations are not permitted during detection (domains.go:720-727); preserve that capability rather than simply removing the entry. The separate threat-detection compatibility alias is user-selectable; the automatic detection grant is the principal concern.
Suggested change
- Move required registry metadata retrieval outside the agent sandbox or mediate it through a narrowly scoped, read-only gateway. Alternatively require an explicit registry opt-in for direct agent access.
- Do not silently include the registry in the automatic detection bundle. Document any necessary compatibility migration and retain explicit blocking behavior.
- Test effective generated firewall policy for detection with no registry opt-in, plus the deliberately opted-in or mediated validation path.
Verification
TestThreatDetectionDomains and TestGetThreatDetectionAllowedDomains in pkg/workflow/domains_test.go:418-502 currently require this host; TestEngineDefaultDomainsDoNotOverlapEcosystems explicitly exempts it (pkg/workflow/domains_package_registry_test.go:159-165). Update those expectations only alongside a working replacement for validation, and cover the emitted detection AWF configuration. Static source and test review only; no endpoint was contacted and no tests were run.
View full findings
Scope and deduplication
The npm exception is documented in pkg/workflow/domains.go:85-89 and docs/src/content/docs/reference/network.md:180. It is not the GitHub Packages suffix issue tracked by #70226 or the behavior-defined engine defaults tracked by #73396. The issue is the direct automatic registry hostname grant in the Copilot detection execution path, regardless of the legitimate need for metadata validation.
Inventory context
The current domain inventory includes 43 ecosystem sets, eight engine bundles, seven Pi provider mappings, one compound ecosystem and one sanitization-only set. The exact-string comparison found 108 overlapping pairs, including the intentional detection alias and the Node/registry overlap. Wildcard and bare-suffix comparisons were also reviewed.
Generated by 🌐 Weekly Network Domain Set Audit · pi · routed: gpt61 high · ~23 AIC · ⌖ ~2 AIC · ⊞ 6.8K · ◷
Activity
github-actions commentedon Nov 17, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, Copilot will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪