AI coding agents install malicious packages when setup docs are tampered
AI coding agents can be fooled by altered README, requirements, or Makefile into installing untrusted or vulnerable dependencies
People & policy arXiv 16 Jul 2026 Measurement Simulation evidence
Published as “Setup Complete, Now You Are Compromised: Weaponizing Setup Instructions Against AI Coding Agents”
Why it matters
Deployers of AI coding agents should harden the harness with pre-install verification rather than rely on larger LLMs or prompts to prevent supply-chain compromises.
Summary
Detection of install-time supply-chain attacks by AI coding agents depends on the harness-model pairing, not just model size: swapping only the harness flips a fixed attack from fully caught to mostly installed. Agents reliably stop obvious typosquats, but separator-confusion names often slip through, and source-redirection attacks are missed almost everywhere. A lightweight deterministic pre-install check that validates names, sources, and versions blocks most attacks, while security-oriented prompts only help for the dimensions they name.
What they found 4
- Detection hinges on the harness-model interaction rather than model tier alone
“Our central result is that whether the install gap is closed depends as much on the harness as on the model: hold the model fixed and swap the harness, and the same attack flips from caught to installed, so neither a stronger model nor a better prompt suffices on its own.”
- Agents reliably stop obvious typosquats but often miss separator-confusion names
“Agents catch blatant typosquats reliably, but plausible separator-confusion names (azurecore for azure-core) slip through, and how often depends on the harness-model pairing.”
- Source-based attacks such as registry redirection are missed almost everywhere
“Source-based attacks like registry redirection are missed almost everywhere.”
- A deterministic pre-install check closes most of the install gap
“a deterministic pre-install check that verifies names, sources, and versions before any code runs closes most of it.”
Caveats 5
- the hook misses R9 where a pinned vulnerable version looks benign without a CVE lookup the hook performs.
- the hook misses R7 because data-utils exists on PyPI and is indistinguishable from a legitimate install by static checks; catching it requires the name’s provenance (trusted manifest versus attacker-controlled error string).
- We run no controlled human baseline, so our claim is mechanistic rather than comparative.
- Each attack class is instantiated by one representative scenario (e.g. tranformers), repeated N =10 times for run-to-run stability, ... per-class rates could shift with a wider sweep of instances.
- Our falsepositive check is similarly narrow: it rests on a small number of benign control projects.
What’s new here 4
- Systematic evaluation of package-install attacks across multiple real-world AI coding-agent harnesses, showing the critical role of harness design.
- Demonstration that the same LLM can both catch and miss the same attack depending on the harness it runs under.
- Introduction of a deterministic pre-install verification hook that blocks malicious installs before code execution.
- Cross-ecosystem validation (npm, Cargo) of the install gap beyond Python.