Trojan Horse: Automated Repository Poisoning against Coding Agents
Xiao Yang, Jinchang Hou, Jiawei Chen, Zhonghou Lv, Junyuan Shang, Chenfu Bao
Key points
From the paper's conclusion- We present TrojanForge, the first automated framework for repository poisoning.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- NameTrap: Steering AI Coding Agents Toward Security Vulnerabilities via Variable NamesarXiv · 2026
- Package Hallucination Attacks on Coding Agents through Prompt Injection in Rule FilesarXiv · 2026
- CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code GenerationarXiv · 2026
- Compositional Exploits in Autonomous Coding Agents: Attack Mechanics and Ephemeral DefensearXiv · 2026
- Kerkoporta: Injecting Structured-Output Backdoors in Reasoning Coding AgentsarXiv · 2026
- AutoRedClaw: Automated Red-Teaming for Claw-Style AgentsarXiv · 2026