When AI agents install packages, supply-chain security becomes architecture
AI coding tools speed up development. They also speed up the moment when compromised dependencies, scripts and credentials become production risk.
Kyluke McDougall
Software Architect & Founder
Table of Contents
- The package manager is no longer just a developer tool
- The real question is: who is allowed to execute?
- Dependency changes need their own path
- Secrets should not be reachable by every development helper
- AI needs the same gates as humans, often clearer ones
- For product teams, this is an architecture decision
- Where McDougall Digital can help
The current X discussion around compromised npm and PyPI packages matters more to product teams than it may seem at first.
Software supply-chain security is not a new topic. Compromised packages, stolen tokens, abused CI/CD pipelines and malicious installation scripts have been part of modern software risk for years. Anyone building with JavaScript, Python, mobile apps or cloud infrastructure already lives inside an ecosystem of thousands of direct and indirect dependencies.
What is changing is the speed at which AI-assisted development environments can trigger that risk.
Over the last day, X has been full of discussion about the Mini Shai-Hulud / TanStack incident: compromised packages, OpenAI’s public response, rotated code-signing certificates, affected developer devices, additional npm and PyPI packages, and the question of how automated development workflows can amplify these attacks. The most relevant part is not only the specific incident. It is the role of AI coding tools, IDE helpers and agents that can install packages, run scripts, edit files and sometimes operate with broad local or CI permissions.
That is the part founders, CTOs and product owners should take seriously.
When a human installs a package, that is dependency risk. When an agent installs a package, runs scripts, edits code, commits changes and can reach local secrets or CI context, it becomes execution and governance risk.
The package manager is no longer just a developer tool
The old workflow was usually visible enough to treat it as a developer action.
Someone opens a terminal. Someone runs npm install, pnpm add or pip install. Someone sees the change in package.json, requirements.txt or a lockfile. Someone commits the change. In a good team, that is followed by review, software composition analysis, CI and perhaps an additional security scan.
That was never perfect. But it had friction.
AI-assisted workflows reduce exactly that friction. An agent can notice that a package is missing. It can suggest the installation command or run it directly. It can fix import errors, adjust files, run tests and prepare a pull request. In local IDEs, coding-agent CLIs and internal automations, this is genuinely useful. It reduces context switching and helps teams move faster.
The same acceleration changes the risk path.
A compromised package no longer has to wait for a tired developer to copy a command at the end of the day. It can enter a workflow where an agent searches for the right dependency, installs it, triggers a lifecycle script and keeps working as if nothing unusual happened. If that workflow can reach .env files, npm tokens, GitHub tokens, cloud credentials, SSH keys or CI variables, the distance between “dependency installed” and “environment compromised” is very short.
This is not alarmism. It is normal architecture work.
A system that downloads and executes code from the internet needs boundaries. AI does not change that. AI simply makes the system more active, more frequent and more distributed across the development process.
The real question is: who is allowed to execute?
Many conversations about AI coding tools focus on code quality.
Does the agent write good code? Does it understand the architecture? Can it find bugs? Can it fix tests? Those are important questions. For serious products, they are not enough.
The operational question is: what is the agent allowed to do?
Can it install packages? Can it run lifecycle scripts? Can it execute shell commands? Can it read local environment variables? Can it read files outside the repository? Can it change Git configuration, hooks or IDE settings? Can it use a token that also controls releases, package publishing or cloud resources?
Once the answer is yes anywhere, the agent is no longer only a chat window. It is an actor inside the software delivery chain.
That is the right mental shift: AI coding agents are not only productivity tools. In production-adjacent environments, they are execution environments with permissions.
That does not argue against using AI. The opposite is true. Teams that model this cleanly can use AI much more reliably than teams that simply hope the tool behaves.
Dependency changes need their own path
One practical step is surprisingly simple: dependency changes should not disappear inside feature changes.
If an AI agent builds a button, extends an API endpoint and installs three new packages in the same change, review becomes difficult. The reviewer is looking at product logic, UI behavior, type errors, tests and perhaps performance. The new dependency is just one line in a lockfile with hundreds of changed entries.
That is where risk hides.
For serious products, dependency changes deserve more deliberate handling:
- review new runtime dependencies separately;
- do not accept lockfile changes blindly;
- define trusted package sources and internal policies;
- inspect install scripts and postinstall behavior;
- flag unusually new, abandoned, typo-squatted or low-trust packages;
- configure CI so dependency scans can block merges;
- instruct agents to prefer standard libraries and already-approved packages where possible.
This is less exciting than “fully autonomous development”. It is also the kind of process that makes autonomous or semi-autonomous development viable.
At McDougall Digital, AI-supported delivery is not only about whether a tool can generate code. The more important question is whether the delivery chain remains explainable: which dependencies enter the system, which commands run, which secrets are reachable and which gates stand before production.
Secrets should not be reachable by every development helper
The most critical part of many supply-chain incidents is not the code itself. It is the credentials the code can reach.
A compromised package running inside an empty sandbox is a problem. A compromised package running on a developer machine with production-adjacent tokens, private repositories, cloud access, package-publishing rights or signing material is a different category.
AI agents sharpen this issue because they often run in the same environments as developers:
- local repositories;
- IDE configuration;
- terminal access;
.envfiles;- SSH agents;
- Git credentials;
- API tokens for internal tools;
- access to issue trackers, CI or deployment systems.
If an agent can run package-manager commands there, the security model has to reflect that reality.
The goal is not “nobody may install anything anymore”. That would make product development impossible. The goal is: installations happen in controlled contexts, with minimal permissions, visible logs and clear review gates.
For many teams, that means:
- separating development secrets from production secrets;
- using short-lived tokens instead of permanent personal tokens;
- keeping signing keys and package-publishing rights away from normal development machines;
- running agents inside containers, dev environments or restricted workspaces;
- giving CI jobs only the permissions they actually need;
- requiring explicit confirmation for dangerous commands;
- treating token rotation and lockfile review as a standard response after dependency incidents.
This is not only security. It is operability.
A team that knows where permissions live can respond quickly after an incident. A team that has hidden everything inside local machines, old tokens and implicit tool access first has to reconstruct its own delivery chain.
AI needs the same gates as humans, often clearer ones
A common mistake is to treat AI-generated changes as a special case.
A developer should not push unreviewed code straight to production. An agent should not either. A developer should not quietly introduce critical new dependencies. An agent should not either. A developer should not leave credentials in logs, backups or temporary files. An agent should not either.
The difference is that teams often rely on habit, experience and implicit judgement with humans. That works less well with agents. The gates need to become more explicit.
Good AI delivery workflows answer clear questions:
- Which repositories can the agent see?
- Which tasks can it perform without confirmation?
- Which commands are blocked?
- Which files are off limits?
- When must a human review the change?
- Which tests must run?
- Which security checks are mandatory?
- How do we record which changes came from the agent?
These rules do not need to be bureaucratic. They should be close to the real risk. An internal prototype needs different gates from a payment workflow, a medical workflow, a customer portal or a system with personal data.
The mistake is not making any distinction.
For product teams, this is an architecture decision
Supply-chain security often sounds like a topic for security teams. For modern product teams, it is broader than that.
It affects architecture because dependencies shape the structure and maintainability of a system.
It affects product management because new features are sometimes accelerated by quick package decisions that create high future cost.
It affects operations because incidents are only manageable when logs, ownership, rollback paths and token rotation are prepared.
It affects compliance because German and European clients increasingly want to understand how software is delivered, checked and secured.
And it affects AI adoption because AI tools only help long term if their speed does not turn into invisible risk.
The useful response is not to build a huge platform immediately. Many good controls are pragmatic:
- a short repository policy for AI agents;
- clear rules for dependency changes;
- separate development, test and production contexts;
- software composition analysis and secret scanning in CI;
- restricted tokens for local tools;
- review checklists for agentic changes;
- regular updates and a clean incident process;
- an architecture review for critical workflows before they grow.
The goal is not to make development slow. The goal is to make speed controllable.
Where McDougall Digital can help
For many teams, the hard part is not knowing that the risk exists. It is translating that knowledge into a delivery process that fits the product.
An early SaaS product needs different controls from a mid-sized company’s internal tool. A customer portal with personal data needs different boundaries from a marketing prototype. A team with experienced developers needs different agent rules from a founder team leaning heavily on Replit, Cursor, Claude Code or Codex.
McDougall Digital works exactly at that intersection: AI-supported development that keeps architecture, product judgement, security and operations aligned.
In practical terms, that can mean:
- reviewing existing repositories for agent and dependency risk;
- hardening CI/CD, secrets and package workflows;
- designing AI coding workflows with sensible permissions and review gates;
- turning AI-built prototypes into production-ready systems;
- building internal tools quickly without letting them grow uncontrolled;
- giving teams a clear, pragmatic operating model for AI-supported software development.
The Mini Shai-Hulud and TanStack moment will disappear from the timeline. The lesson will remain.
When AI agents build software, they are part of the delivery chain. And a delivery chain that becomes faster does not need less architecture. It needs better boundaries.