Trojan Horse: Automated Repository Poisoning against Coding Agents
Xiao Yang, Jinchang Hou, Jiawei Chen, Zhonghou Lv, Junyuan Shang, Chenfu Bao
Abstract
Coding agents are increasingly capable with autonomy, which exposes them to repository-level poisoning. Existing red-teaming studies remain restricted to manual selection for malicious payload locations and fixed disguise strategies, which cannot represent realistic repository poisoning. We present TrojanForge, the first automated framework for repository poisoning. TrojanForge parses repository structure through abstract syntax trees (AST) and maps agent execution traces onto AST nodes. A security review agent ranks these candidates and selects the least conspicuous ones for payload mounting. Then, through adversarial play with the target agent, TrojanForge iteratively refines disguise strategies by inverting the causes of agent detection, and transfers accumulated success experience across repositories. We further construct TrojanBench, a benchmark of 384 poisoned repositories spanning 6 domains and 9 programming languages. Extensive experiments show that TrojanForge achieves a stable poisoning success rate of over 60% with backdoor injection exceeding 90%. Comprehensive evaluation on TrojanBench across 4 harnesses and 12 models reveals that even commercial agents fail to defend against repository-level poisoning.
Create a lesson
Related papers
ParseGap: Testing What Coding Agents Authorize and What Shells Execute
Shared title terminologycs.CRJieyu Li
Who Is Prompt-Injecting Coding Agents? An Empirical Study of Hidden AI-Directed Text on GitHub
Shared title terminologycs.CRGabi Nakibly, Zvika Babo
Who Grades the Agent? Privilege Separation for Coding-Agent Benchmarks
Shared title terminologycs.CRNathan Nour Houlamy, Mattia Favretto, Earlence Fernandes et al.
Subverting Tool Arguments: Defense-Evading Metadata Poisoning in LLM Agents
Shared title terminologycs.CRShih-Chieh Dai, Xinyu Sun, Haichuan Zhang et al.
Compaction Laundering: Provenance Destruction in Context-Compacting Coding Agents
Shared title terminologycs.CRArshan Dabirsiaghi
AutoRedClaw: Automated Red-Teaming for Claw-Style Agents
Shared title terminologycs.CRHao Li, Tongyan Hu, Weidi Luo et al.