测试了代码智能体在恶意需求下的安全漏洞,发现超六成攻击可绕过所有防护。
IssueTrojanBench: Benchmarking AI Coding Agents Against Malicious Issue Requests

- 构建新基准IssueTrojanBench,用四种攻击类型和六种传播方式模拟恶意请求
- 66.5%的恶意请求可绕过代码智能体的层级防护机制,多数拦截来自大模型而非框架
- 当前代理级防御作用有限,提示需加强模型与代理双层安全机制
由大语言模型驱动的代码智能体正广泛应用于真实软件开发中,具备自主访问本地文件与工具生成、编辑和执行代码的能力。此类智能体继承了大模型本身的安全风险:对抗性提示、污染训练数据及后门触发可能导致模型输出不安全或攻击者指定的代码;同时其代理架构也引入了工具使用自主性带来的风险,如外部API滥用、数据外泄和开发环境长期沦陷。本文系统评估了针对前沿代码智能体(Cursor、Claude Code、Codex Desktop)的恶意问题请求,基于两大主流模型系列(OpenAI GPT-5.3 Codex/GPT-5.4 和 Anthropic Sonnet 4.6)。我们提出的基准 IssueTrojanBench 包含四类新型攻击(将恶意指令嵌入问题)、六种传递路径(如PDF、评论),并加入扰动增强。结果揭示现代部署代码智能体存在严重漏洞:66.5%的恶意问题可穿透所有层级防护(代理与大模型层面)。进一步分析表明,拒绝行为几乎完全源自大模型而非代理框架,其中GPT系列普遍易受攻击,而Sonnet 4.6展现出更谨慎、风险感知更强的高危操作拦截能力。此外,当前代理级防御策略对代码智能体保护作用极为有限。研究强调亟需强化模型与代理双层安全机制以保障代码智能体安全。
原文摘要 · Abstract (English)
AI coding agents powered by LLMs are increasingly integrated into real-world software development, where they generate, edit, and execute code with autonomous access to local files and tools. Coding agents inherit security risks from both the LLM backbone, where adversarial prompts, poisoned training data, and backdoor triggers can cause models to emit insecure or attacker-chosen code, and their agentic architecture, where tool-using autonomy enables induced misuse of external APIs, data exfiltration, and persistent compromise of development environments. This paper presents a systematic evaluation of malicious issue requests against state-of-the-art coding agents (Cursor, Claude Code, and Codex Desktop), powered by two major model families (OpenAI GPT-5.3 Codex/GPT-5.4 and Anthropic Sonnet 4.6). Our novel benchmark IssueTrojanBench contains malicious issues that are constructed based on four novel attack categories (i.e., embedded as malicious instructions in issues), six delivery vectors (e.g., PDF, or issue comment), and further augmented by perturbations. Our results reveal critical vulnerabilities in the as-deployed modern coding agents, i.e., 66.5% of the malicious issues from IssueTrojanBench penetrate all the guardrails (agent- and LLM-level) of coding agents. Our further analysis shows that rejection is almost entirely from LLMs rather than the agent frameworks, with GPT models broadly vulnerable and Sonnet 4.6 exhibiting more selective, risk-aware blocking of high-impact actions. Our evaluation also highlights that the current agent-level defense strategy offers limited additional protection for coding agents. Our findings highlight the urgent need for stronger agent- and model-level safety mechanisms to protect AI coding agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。