They should require policy gates for any first-time dependency, especially when an AI agent proposes the install. The safest pattern is allowlisting for known-good packages, human approval for new ones, and build-time controls that refuse unverified dependencies. This keeps autonomous workflows from turning suggestion into execution without scrutiny.
Why This Matters for Security Teams
Agent-driven package installs turn a routine developer convenience into a security decision with supply chain impact. When an AI agent can request, select, or install dependencies, the risk is not just malicious code. It also includes typosquatting, dependency confusion, version drift, and the silent introduction of packages that expand the attack surface. Guidance from the OWASP Agentic AI Top 10 and the NIST AI Risk Management Framework both point to the same core issue: autonomous systems need bounded authority, traceability, and human accountability.
Security teams often get the mechanics right inside the pipeline but miss the policy layer around the agent itself. If the agent can propose a package and the build system auto-accepts it, the control is effectively advisory, not preventive. The real question is whether the dependency request is treated as untrusted input until it is validated against policy, provenance, and business need. In practice, many security teams encounter package risk only after a build has already pulled in an unreviewed dependency, rather than through intentional dependency governance.
How It Works in Practice
A defensible approach starts by separating package discovery from package installation. The agent may suggest a library, but it should not be able to execute install actions directly unless the package is already approved, pinned, and sourced from a trusted repository path. For first-time dependencies, current guidance suggests policy gates that require explicit approval, provenance checks, and logging before the build can proceed.
Operationally, that usually means combining repository controls, build controls, and change control:
- Allowlist known-good packages and block unknown packages by default.
- Pin versions and verify hashes so the installed artifact matches the reviewed artifact.
- Require human approval for new dependencies, especially when the request originates from an AI agent.
- Use build-time policy to reject unsigned, tampered, or unpublished packages.
- Record who approved the dependency, why it was needed, and which workflow requested it.
This is also where NHI governance becomes relevant. If the agent has its own credentials, tokens, or service identity, those secrets should only permit bounded actions, not broad package-management authority. Stronger implementations map package install rights to specific non-human identities, then apply least privilege and just-in-time elevation only when a controlled approval path is met. The NIST Cybersecurity Framework 2.0 and NIST SP 800-53 Rev 5 Security and Privacy Controls are useful here because they translate well into access control, configuration management, and auditability requirements for CI/CD and agentic workflows.
Teams should also consider pre-install threat checks. Package metadata, maintainer reputation, dependency depth, and unusual update patterns can all signal risk, but those signals are advisory rather than definitive. The safest design combines automated screening with deterministic controls that can stop the install even when the agent is confident. These controls tend to break down when agents are given broad write access to developer environments and the organisation treats package approval as a convenience step instead of a formal release control.
Common Variations and Edge Cases
Tighter dependency control often increases friction for developers, requiring organisations to balance delivery speed against supply chain assurance. That tradeoff is especially visible in rapid prototyping, internal tooling, and data science workflows where new packages are added frequently and documentation is thin.
There is no universal standard for this yet, so best practice is evolving. Some teams permit low-risk package installs automatically if the source is internal and the package already exists in a curated mirror. Others require approval only for internet-sourced packages or for installs that expand execution privileges. The difference is not just process style; it reflects how much blast radius the organisation can tolerate if an agent is manipulated through prompt injection, a poisoned retrieval source, or a compromised dependency suggestion.
Edge cases also appear in hermetic builds, air-gapped environments, and polyglot repositories. In those settings, package approval can be harder because each ecosystem has different trust signals and signature support. The MITRE ATLAS adversarial AI threat matrix and the OWASP Top 10 for Agentic Applications 2026 are helpful reminders that manipulation often targets the decision path, not just the payload. Organisations should treat autonomous dependency requests as high-risk actions until provenance, authorisation, and review are all satisfied.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST AI RMF | GOVERN | Agent installs need accountable governance and defined responsibility. |
| OWASP Agentic AI Top 10 | A3 | Agent authority must be constrained to stop unsafe autonomous actions. |
| NIST CSF 2.0 | PR.AC-4 | Least privilege limits what an agent identity can install. |
| MITRE ATLAS | AML.TA0001 | Adversarial manipulation can target the agent's decision process. |
Assign ownership, approval rules, and oversight for agent-requested dependency installs.
Related resources from NHI Mgmt Group
- How should teams reduce risk from malicious npm package installs?
- How can security teams reduce environment poisoning risk in agent workflows?
- How should security teams reduce supply chain risk from compromised package maintainers?
- How should security teams reduce identity risk in email-driven workflows?