Goal
Support npm-style dual-use declarations so legitimate security tooling can explain security-relevant behavior without bypassing malware controls.
Reference: https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/
Policy
- Accept a bounded
contentPolicydeclaration in package metadata. - A declared package must include a root
DISCLOSUREtext file in the actual uploaded archive. - Reject binary, oversized, missing, nested-only, or empty disclosures.
- Once any semantic version of a package declares dual-use content, future versions must retain both
contentPolicyand the root disclosure. - Declaration does not force a clean verdict and does not permit malware.
- Persist the declaration and disclosure digest/size, not disclosure text, in public metadata.
- Require a strongly authenticated publication method when auth provenance can distinguish it; reject known bypass-2FA/direct-token methods. Document current Pantry auth limitations and the rollout path.
Acceptance criteria
- Archive inspection handles npm
package/DISCLOSUREroots and rejects traversal/ambiguous duplicate paths. - Tests cover valid text, missing/empty/binary/oversized/nested disclosures.
- Tests prove declaration persistence across versions.
- Existing non-dual-use packages continue to publish.
- Documentation gives maintainers a concrete
package.jsonand DISCLOSURE example.