Skip to main content
AI Agents Are Installing Packages: 6 Myths About Dependency FirewallsGeneral
5 min readFor Security Engineers

AI Agents Are Installing Packages: 6 Myths About Dependency Firewalls

You've probably heard about dependency firewalls in the context of supply chain security, but you might have dismissed them as unnecessary. That skepticism made sense two years ago. Today, with AI coding assistants autonomously installing packages to complete tasks, the threat model has changed.

These myths persist because dependency firewalls address a problem that traditional security controls weren't designed to solve. Your EDR catches malware after it executes. Your SAST scans code you've already written. But what evaluates a package before it runs its install scripts?

Myth 1: "Our existing security tools already catch malicious packages"

Reality: Your security stack is designed to detect threats after installation, not before.

Traditional controls operate post-execution. Your endpoint detection responds when malicious code runs. Your SIEM correlates events from systems that are already compromised. Even your container scanning tools analyze images you've already built.

Dependency firewalls examine packages and package metadata at the point of installation. In npm ecosystems, for example, lifecycle hooks can execute arbitrary scripts during npm install. By the time your EDR flags suspicious behavior, that preinstall script has already exfiltrated environment variables or modified your build pipeline.

This isn't theoretical. When you run npm install, you're executing code from potentially hundreds of transitive dependencies before your application code ever runs. Your existing tools aren't watching that moment.

Myth 2: "We only install well-known packages from trusted maintainers"

Reality: You install what your dependencies install, and AI agents don't check maintainer reputation.

You might carefully vet your direct dependencies. Your team might have an approval process for adding new packages. But you don't control transitive dependencies, and neither do your AI coding assistants.

When AI agents autonomously install packages while completing tasks, they optimize for functionality, not security provenance. An AI agent tasked with "add PDF generation to this endpoint" will install whatever package appears to solve the problem. It won't check how many maintainers the package has, when it was last updated, or whether the maintainer's account was compromised last week.

Your dependency tree is deeper than you think. A single top-level package can pull in dozens of transitive dependencies, each with their own maintainers and security postures. You need evaluation at every level, not just the packages you explicitly choose.

Myth 3: "Dependency firewalls will break our CI/CD pipeline"

Reality: Breaking your pipeline is the point when the alternative is shipping compromised code.

This myth conflates disruption with dysfunction. Yes, a dependency firewall will block installations that fail security checks. That's not a bug in your pipeline; that's the firewall doing its job.

The real question isn't whether blocking suspicious packages disrupts your workflow. It's whether you want to discover the problem at install time or after you've deployed to production. Integration means configuring the firewall to evaluate packages before they enter your environment, then routing blocked installations to a review queue your team actually monitors.

In practice, this looks like: firewall blocks package → installation fails with specific reason → developer reviews block → either approves exception with justification or finds alternative package. This adds minutes to your pipeline when it triggers, not hours. Compare that to the days or weeks of incident response when a malicious package reaches production.

Myth 4: "We can just pin our dependency versions"

Reality: Version pinning prevents unexpected updates, not malicious packages in the versions you've pinned.

Version pinning is a stability control, not a security control. When you pin to [email protected], you're preventing automatic upgrades to 4.17.22. You're not preventing the installation of a malicious package that was published as 4.17.21 after a maintainer account compromise.

Pinning also doesn't address the initial installation decision. When you first add a package at version 1.2.3, you're trusting that version sight unseen. If that version contained malicious code from day one, your pinned version faithfully reproduces the compromise in every build.

You need both controls. Pin versions for build reproducibility. Use a dependency firewall to evaluate whether the pinned version should be allowed in your environment at all.

Myth 5: "This only matters for JavaScript/npm ecosystems"

Reality: Every package ecosystem with executable installation hooks faces this risk.

npm's lifecycle hooks are the most obvious attack vector, but they're not unique. Python's setup.py can execute arbitrary code during installation. Ruby gems can run code in their gemspec. Even compiled languages like Go can execute code through init functions when packages are imported.

The risk scales with ecosystem maturity and package count. npm has over 2 million packages. PyPI has over 500,000. The sheer volume makes manual review impossible, and the open publication model means anyone can publish anything.

Your threat model should account for the specific risks in your language ecosystems. If you're primarily a Python shop, focus on PyPI. If you're polyglot, you need coverage across ecosystems. The implementation details vary, but the principle remains: evaluate before installation, not after.

Myth 6: "We'll just review packages manually before adding them"

Reality: You can't manually review hundreds of transitive dependencies every time you update.

Manual review works for your ten direct dependencies. It fails for the 200 transitive dependencies they pull in. It completely breaks down when AI agents install packages autonomously to complete tasks you've assigned them.

Consider the workflow: your AI assistant needs to parse CSV files, so it installs a CSV parsing library. That library depends on a string manipulation utility, which depends on a character encoding package, which depends on... you get the idea. You didn't review any of those transitive dependencies. You didn't even know they were being installed until you examined your lock file.

Manual review also doesn't scale with update frequency. When you update dependencies weekly or daily, you need automated evaluation. The dependency firewall becomes your automated reviewer, applying consistent security policies across every installation.

What to do instead

Stop thinking about dependency firewalls as an optional security enhancement. They're a control point for a risk that didn't exist five years ago and is accelerating with AI-driven development.

Start by mapping your package installation points: developer workstations, CI/CD runners, build containers, anywhere npm install or pip install executes. Those are your enforcement points.

Configure policies that match your risk tolerance. Block packages with known vulnerabilities (cross-reference with CVE databases). Block packages published in the last 72 hours (gives time for community review). Block packages from maintainers with compromised account indicators. Allow exceptions through a documented approval process.

Integrate with your existing tools. Your dependency firewall should feed findings to your SIEM, create tickets in your issue tracker, and block installations in your CI/CD pipeline. It's not a standalone tool; it's a control point in your supply chain security architecture.

And if you're deploying AI coding agents, implement dependency firewalls before you give those agents package installation permissions. Once you've granted that access, you've expanded your attack surface to include every package the AI might install. Better to control that surface from the start.

Topics:General

You Might Also Like