Repository-level inventory tells you where a package exists now, but not how it got there or whether it was later removed. PR-level visibility shows introduction history, ownership, and persistence, which are the details needed to judge exposure, prioritize response, and explain why a risky dependency was accepted in the first place.
Why This Matters for Security Teams
Knowing that a repository uses a dependency answers only the narrowest inventory question. It does not show when the package first entered the codebase, who approved it, whether it arrived through a direct change or a transitive path, or whether it was later removed and reintroduced. That history matters because dependency risk is often introduced during code review, not discovered during asset discovery. NHI Mgmt Group’s Ultimate Guide to NHIs — Key Challenges and Risks notes that 96% of organisations store secrets outside of secrets managers in vulnerable locations, which is the same visibility problem in a different form: if the change trail is missing, exposure is harder to prove and harder to contain.
For security teams, PR-level visibility provides the context needed to answer practical questions such as whether a dependency was introduced as part of a rushed hotfix, whether it remained after a remediation attempt, or whether the risk was accepted deliberately. That context is what supports defensible response, ownership, and auditability. In practice, many teams only discover the full dependency story after a vulnerable package has already been merged, shipped, and inherited by downstream systems.
How It Works in Practice
PR-level visibility ties dependency events to the actual change request, so teams can see the package, the version, the reviewer, the timestamp, and the surrounding discussion. That creates an evidence trail that repository-level inventory cannot provide. It also helps separate direct dependencies from transitive ones, which is important when a package appears in a repo without anyone intentionally adding it. For response workflows, this means teams can identify the exact PR that introduced a risky version, determine whether it was rebased or cherry-picked, and decide whether multiple branches or release lines are affected.
This is especially useful when combined with policy controls from NIST SP 800-53 Rev. 5 Security and Privacy Controls, because change management, configuration management, and accountability all depend on knowing not just what exists, but how it got there. It also aligns with the lifecycle focus in the NHI Lifecycle Management Guide: if a dependency behaves like an operational credential or code-supply chain trust anchor, its introduction and removal should be observable end to end.
- Use PR metadata to link each dependency introduction to a specific reviewer and approval path.
- Track first-seen, last-seen, and reintroduced timestamps so removal is not mistaken for remediation.
- Correlate PRs with SBOM and scanner results to distinguish intentional upgrades from inherited transitive risk.
- Preserve the discussion thread so exceptions and compensating controls are visible during incident review.
That level of traceability is what makes prioritisation credible: a package added in a production hotfix and left in place for months is a different exposure from one that was introduced, blocked, and reverted in the same day. These controls tend to break down in fast-moving monorepos with automated dependency bots because merges happen faster than human review can reconstruct ownership.
Common Variations and Edge Cases
Tighter PR-level tracking often increases workflow overhead, requiring organisations to balance richer evidence against developer friction. That tradeoff is real, but current guidance suggests the cost is justified for production paths, high-risk packages, and repositories that feed deployment pipelines. For low-risk internal tools, some teams adopt lighter controls, but there is no universal standard for that yet.
One edge case is transitive dependencies: the PR may not show a direct package addition even though the risk entered through a parent library update. Another is squash merges, which can collapse the review history and weaken attribution unless the platform preserves linked PR context. A third is dependency pinning across branches, where the same package version exists in multiple repos but was introduced by different PRs at different times.
For teams studying real-world dependency exposure, the pattern discussed in the LiteLLM PyPI package breach shows why introduction history matters more than a static repo snapshot. A repository can look compliant long after a risky package has been introduced, replaced, or reintroduced under pressure. That is why PR-level evidence should be treated as the operational source of truth for accountability, while repository inventory remains a useful but incomplete view.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and CSA MAESTRO address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Visibility into dependency introduction mirrors NHI inventory and ownership tracking. |
| NIST CSF 2.0 | ID.AM-02 | Asset inventory is incomplete without change-history context for software components. |
| NIST AI RMF | Governance of AI-adjacent software supply chains depends on traceable change decisions. | |
| CSA MAESTRO | MAESTRO emphasises runtime governance and auditability across software supply chains. |
Apply supply-chain traceability so every dependency can be linked to an accountable change.