特洛伊木马:针对编码智能体的自动化仓库投毒攻击
Trojan Horse: Automated Repository Poisoning against Coding Agents
AI总结:
研究针对编码智能体的仓库级投毒问题,提出自动化框架TrojanForge,构建含384个投毒仓库的基准TrojanBench,实验显示其投毒成功率超60%,商业智能体也难以防御。
摘要:
编码智能体的自主性日益增强,这使其面临仓库级投毒攻击的风险。现有红队研究仍局限于手动选择恶意有效载荷位置和固定伪装策略,无法代表现实中的仓库投毒场景。我们提出TrojanForge,这是首个用于仓库投毒的自动化框架。TrojanForge通过抽象语法树(AST)解析仓库结构,并将智能体执行轨迹映射到AST节点。安全审查智能体对这些候选节点进行排序,选择最不显眼的节点来挂载有效载荷。随后,通过与目标智能体进行对抗博弈,TrojanForge通过反转智能体检测的原因来迭代优化伪装策略,并在不同仓库间转移积累的成功经验。我们进一步构建了TrojanBench,这是一个包含384个投毒仓库的基准,涵盖6个领域和9种编程语言。大量实验表明,TrojanForge实现了超过60%的稳定投毒成功率,后门注入率超过90%。在TrojanBench上针对4种 harness 和12种模型的综合评估显示,即使是商业智能体也无法防御仓库级投毒攻击。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。