Repository navigation
fix(install): org policy refuses a denied dependency before fetching it - #4534
Merged
Daniel Meppiel (danielmeppiel) merged 2 commits intoNov 21, 2026
Conversation
A blocking org policy decides dependency deny and allow rules on the dependency identity, so a refused direct or transitive dependency is never contacted, cloned or cached: the resolve download callback refuses it before any fetch, ref annotation skips it, and package validation for 'apm install <pkg>' does not probe its source. The policy gate reports the refusal as before. apm-spec-waiver: install-order hardening of an already documented guarantee (policy loads before any package is written) Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 23:31
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
merged commit Nov 21, 2026
47bf9e8
into
train/0.37-final-2
5 checks passed
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-s32-policy-deny-before-fetch
branch
November 21, 2026 00:04
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A blocking org policy now decides dependency deny and allow rules on the dependency identity before anything is fetched:
install/phases/resolve.py: the download callback refuses a denied identity before any network or cache access, for direct, transitive, registry and dry-run resolution. The refusal is recorded on the install context, and ref annotation skips refused identities.install/phases/policy_gate.py: the gate reports refused identities with the existing violation output and exit code.commands/install.py:apm install <pkg>validation does not probe the source of an identity the policy refuses.policy/install_preflight.py: the policy is read once, silently, through the trust-policy routing owner (prefetch_identity_policy,identity_policy_denial,identity_policy_scope).Warn or off enforcement,
--no-policyandAPM_POLICY_DISABLEkeep their current behaviour.Issue and approved scope
Issue: Refs #4092
Human scope-approval comment: private release coordination with the 0.37 steward.
Does this PR complete the issue, or what remains? One hardening item under the 0.37 trust and integrity umbrella; the umbrella stays open.
Type of change
Testing
New
tests/lifecycle/security/test_policy_deny_before_fetch.py, run with the binary driver pinned to each tree through the host guard:Other local runs:
tests/unit/install+tests/unit/test_install_command.py: 3643 passed. The 2 failures are pre-existing on the base (test_mcp_retired_shape_heal,test_require_hashesredaction).tests/lifecycle/world/test_world.py -k "policy or deny": 22 passed.ruff checkandruff format --check(0.15.12): clean on changed files.Changelog
## [Unreleased]inCHANGELOG.md:user-visible effect first, 25 words or fewer, ending with
(#PR);breaking changes only under upgrade notes; no Highlights; see
.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual in the
development guide:
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.