A software supply chain attack is an attack that does not hit the victim directly but a component the victim depends on: a library, a build tool, an update, a supplier. The compromised code enters the product through a channel that is trusted. When a person chose every dependency, you could ask them why it was there. With an agent writing the change, the agent often chooses the package too, inside a session that closes when the task ends. Four things close the gap: a rule on which sources the agent may use, a check at the moment a dependency is added, a record of who approved it, and evidence you can hand to the client. The sections below show where the risk sits and which controls can be automated, without relying on a reviewer's memory.
What is a software supply chain attack?
It is an attack that reaches its target through something the target already installs or runs. There are four recurring forms:
| Form | How it works | Mechanism | | --- | --- | --- | | Typosquatting | A malicious package with a name close to a known one | One letter changed in the name | | Dependency confusion | A public registry wins over the internal one | Same name as a private package, higher version | | Maintainer compromise | An account or project is taken over by an attacker | Legitimate update with hidden code | | Build tooling | What builds the software is tampered with | Altered install scripts or pipelines |
A documented case is the backdoor in the xz compression library, found in March 2024 and recorded as CVE-2024-3094: not a programming mistake but a deliberate insertion into a widely used open source project. The point for anyone delivering software is that no functional test would have stopped it.
How can an agent amplify the risk?
Because the choice of dependency moves from a person to a tool that decides fast, in volume and without the habit of asking a colleague. Three things shift at once.
The first is the number of decisions: one feature can add several packages in a single session, and whoever reads the diff sees a manifest line, not the reasoning. The second is the quality of the choice: a model can confidently name a package that does not exist. The third is visibility: the session that picked the package leaves no trace unless the process forces it to.
None of this makes agents unusable. It means the control has to look at the decision, not only at the finished build.
What are invented packages and unreviewed dependencies?
Invented packages are the case where the agent suggests a plausible but nonexistent name and an attacker registers it. A study presented at USENIX Security 2025 (Spracklen et al., "We Have a Package for You!") generated 576,000 Python and JavaScript code samples with 16 models and found the average share of hallucinated packages was at least 5.2% for commercial models and 21.7% for open-source models. Whoever registers those names waits for someone to install them: the technique is known as slopsquatting.
Unreviewed dependencies arrive by several predictable routes:
- a line added to the manifest for a small convenience, never discussed;
- a transitive dependency that brings dozens more;
- an install script that runs code on the build machine before anyone reads it;
- a tool or plugin the agent itself uses, which becomes a link in the chain.
Which controls can be automated?
Those that do not depend on a reviewer's memory or goodwill. A starting list, in order of growing cost:
- Block merge if the manifest or lockfile changes without a recorded approval.
- Allow only packages found in an approved registry or an internal mirror, so an invented name does not resolve.
- Pin versions with a lockfile and review the diff of the resolved tree, not only the manifest.
- Run installs in an isolated environment with no secrets.
- Generate a component inventory at every delivery, for example in CycloneDX format, and attest build provenance, for example under the SLSA framework.
- Keep the list of tools and versions, agent included, among the delivered evidence.
An inventory says what is inside, not who chose it and why: that topic is in SBOM for AI-generated code. Security testing further down the line is in penetration testing and AI-generated code.
What should you document for a client or an auditor?
What lets you answer four questions about any random change: what was added, who approved it, which checks passed, what happens if a dependency turns out to be compromised. In practice:
| Evidence | What it shows | | --- | --- | | Request and commit linked | Why the change exists | | Manifest and lockfile diff with approval | Who accepted the dependency | | Check results, re-runnable | That the system ran the check, not the agent's account of it | | Component inventory at delivery | What is in the release | | Response and update procedure | How you react to a known vulnerability |
Detent, the end-to-end delivery system (detent-ai.com), keeps these records as part of the workflow: a person signs the plan and the final delivery, the system runs the checks, and everything stays in versioned files. It does not replace a vulnerability scanner or a private registry: it provides proof that the checks were run and approved. For handling updates an agent proposes, see patch management when an agent proposes the patch. The broader picture is in AI software development; to compare tools on what they leave after the session, see the benchmark page.
