Research · October 27, 2026
NameTrap: Steering AI Coding Agents Toward Security Vulnerabilities via Variable Names
Reported by arXiv cs.AI + cs.CL
In short
Researchers introduce NameTrap, an attack that renames identifiers in third-party Python files to nudge AI coding agents into writing code with a chosen vulnerability type. The poisoned files contain no instructions or vulnerable code, and the attack was tested across six coding agents, ten language models, and four CWE categories (CWE-78, CWE-79, CWE-327, CWE-502).
Why it matters
It shows that ordinary web-sourced code can covertly steer coding agents toward insecure output without any visible malicious payload, which makes this supply-chain risk hard to detect.
Terms used in this story
Read the original reporting
arXiv cs.AI + cs.CL (opens in a new tab)AI Download summarizes and links to the news. We do not republish full articles.