Join our Newsletter — 33% off our NHI Course

What breaks when security teams rely only on static scanning for agent dependencies?

Static scanning misses dependencies that are introduced at runtime and only become dangerous when the agent uses them. A file dropped into a folder, a fresh skill, or a newly reachable tool may look harmless in code review, yet still read secrets or change behavior on execution. Security teams need dynamic validation and runtime visibility to catch that failure mode.

Why Static Scanning Fails for Agent Dependencies

Static scanning only sees what is present in the codebase or package manifest at review time. Agentic systems break that assumption because dependencies can be fetched, generated, mounted, or enabled only when the agent runs. That means a dependency can look inert in a pull request and still become a secret reader, tool caller, or privilege path after execution.

This is especially dangerous for agents that chain tools, accept user-supplied context, or load skills from shared workspaces. A file that appears to be documentation can later become executable behaviour; an approved package can later pull additional modules; a harmless connector can expose tokens once the agent is allowed to invoke it. Guidance from the OWASP Agentic AI Top 10 and NIST’s AI Risk Management Framework both point toward runtime controls because static trust is not enough for goal-driven software. In practice, many security teams discover this only after an agent has already activated a dependency they never saw in source control.

How Runtime Validation Changes the Control Model

The practical fix is to treat agent dependencies as dynamic workload behaviour, not as a one-time software bill of materials problem. Teams need runtime visibility into what the agent actually loads, what it can reach, and what it does with those dependencies at execution time. That usually means combining package and file scanning with policy enforcement, sandboxing, and workload identity checks so the agent must prove what it is before it can use a tool or secret.

Current guidance suggests a layered model:

  • Use static scanning to identify known packages, but do not assume it captures runtime adds, plugin loading, or prompt-triggered tool selection.
  • Bind each agent to a workload identity so access decisions can be evaluated at request time, not only at build time.
  • Issue short-lived credentials and rotate or revoke them automatically when the task ends.
  • Log tool invocation, dependency activation, and secret access together so suspicious behaviour can be correlated.
  • Apply policy-as-code to decide whether a newly reachable tool or library is allowed in the current context.

NHIMG’s Ultimate Guide to NHIs notes that 96% of organisations store secrets outside dedicated secrets managers, which is exactly the kind of exposure runtime controls are meant to reduce. The same issue shows up in the Analysis of Claude Code Security, where agentic code workflows require execution-time guardrails rather than code review alone. These controls tend to break down when agents are allowed to install plugins or call external tools in loosely governed CI/CD runners because the runtime environment becomes the real attack surface.

Where the Edge Cases Create False Confidence

Tighter dependency control often increases operational overhead, requiring organisations to balance developer speed against runtime assurance. The biggest tradeoff is that static scanning remains useful for hygiene, but it creates false confidence if it is treated as the full control set.

Best practice is evolving in a few areas. There is no universal standard yet for how to score risk on a dependency that appears only at runtime, so teams usually combine allowlists, ephemeral credentials, and behavioural detection. That approach matters most when agents can access third-party SaaS, shared workspaces, or self-modifying pipelines, because those environments make dependency boundaries fluid. In those cases, static analysis misses the moment a fresh skill, downloaded library, or mounted connector turns into real capability.

The operational lesson is simple: dependency review must move from “what exists in the repository” to “what the agent can actually execute right now.” NHIMG’s research on the OWASP NHI Top 10 and incidents such as the Amazon Q AI Coding Agent Compromised show why runtime reachability matters more than package visibility alone. Static scanning is a starting point, but it fails fastest when the agent can change its own toolchain mid-task because the review boundary no longer matches the execution boundary.

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, CSA MAESTRO and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Agentic AI Top 10 A2 Static review misses runtime tool and dependency activation in agentic systems.
CSA MAESTRO T4 MAESTRO addresses agent threat modeling where execution context changes risk.
NIST AI RMF GOVERN AI RMF governance requires accountability for dynamic AI behaviour and controls.
OWASP Non-Human Identity Top 10 NHI-03 Runtime dependencies often expose secrets, tokens, and API keys.
NIST Zero Trust (SP 800-207) PR.AC-4 Zero Trust requires ongoing verification rather than static trust in code scans.

Add runtime policy checks for every agent tool, plugin, and dependency invocation.