arXiv:2608.30686cs.CRcs.CL2026-08中稿 · EMNLP

用户提问方式直接影响代码代理被仓库投毒的漏洞风险。

Beyond the Payload: How User Invocation Shapes Coding Agent Vulnerability to Repository Poisoning

论文配图:Beyond the Payload: How User Invocation Shapes Coding Agent Vulnerability to Repository Poisoning
图 1 · 摘自论文原文
  • 系统测试用户提示配置对代码代理安全的影响。
  • 任务类型不同,攻击成功率最高差4.5倍,测试执行类最隐蔽。
  • 提示模糊或带噪声可降低被发现概率,间接提升攻击成功率。

代码代理在软件工程中广泛应用,常从第三方仓库启动项目,但其完整性难以保证。现有研究多关注攻击者注入和伪装,却忽视了开发者日常调用选择带来的风险:委托什么任务、如何表述请求、提供哪些技能或规则。我们称这些为提示层配置(PLCs),并提出CIPR(Coding In Poisoned Repos)——首个在真实污染仓库中系统性变化PLCs的基准。CIPR包含1920个实例,覆盖20个仓库、4种任务类型、3种基于社交媒体的提示风格及3种技能/规则条件,通过自动化运行时与基于追踪的验证器衡量攻击成功率(ASR)和代理告警率(AR)。评估发现:(1)漏洞高度依赖上下文,任务类型导致ASR最高相差4.5倍,测试执行类形成无声攻击面(高ASR,低AR);(2)提示表达间接影响风险:提示不明确可降低ASR,因缩短执行深度;含噪声提示则使恶意内容更隐蔽,呈抑制告警的趋势。这表明代码代理漏洞并非静态属性,而是由日常用户配置动态塑造的结果。

原文摘要 · Abstract (English)

Coding agents are increasingly used for software engineering tasks, including bootstrapping projects from third-party repositories whose integrity cannot be assumed. Prior work on repository poisoning largely focuses on attacker-controlled injection and disguise, but developers also shape risk through everyday invocation choices: what task to delegate, how to phrase the request, and which skills or rules to supply. We term these user-side choices Prompt-Level Configurations (PLCs) and introduce CIPR (Coding In Poisoned Repos), the first benchmark that systematically varies PLCs in poisoned real-world repositories. CIPR comprises 1,920 instances across 20 repositories, four task types, three social-media-grounded prompt styles, and three skill/rule conditions, and measures attack success rate (ASR) and agent alert rate (AR) using automated runtime and trace-based oracles. Our evaluation reveals two key insights: (1) Vulnerability is highly context-dependent, with task type creating up to a 4.5-fold difference in ASR, with test-execution task forming a silent attack surface (high ASR, low AR). (2) Prompt expression shifts risk indirectly: underspecified prompts reduce ASR by truncating execution depth; noisy prompts exhibit a directional trend toward suppressing alerts by making malicious content less conspicuous. These findings highlight that coding agent vulnerability is not a static property, but a dynamic outcome shaped by everyday user configurations.

代码代理安全评测提示工程投毒攻击

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。