研究第三方API路由在编程代理中的隐蔽攻击风险及防御失效问题。
Where Is the Cost of Third-Party API Routers in Agentic Software Development?

- 设计四层渐进式注入实验,模拟路由层恶意篡改行为。
- 所有代理在无防护下防御成功率均达0%,且难以被现有机制发现。
- 提出可复现的评估框架与数据集,适合安全与可信AI研究者参考。
第三方API路由已成为统一访问多样化大模型服务的常见中间层。在编程代理工作流中,高自主性操作虽降低交互开销,却使路由处于可信路径上,可审查并修改所有请求与响应,而缺乏机制验证上游输出与代理实际执行动作的一致性。这导致客户端权限控制在实践中可能失效。本文首次对路由侧注入在编程代理中的影响进行实证研究,设计了四类逐步隐蔽的干预方式:响应替换(L1)、响应追加(L2)、LLM优化注入(L3)和分布对齐的LLM优化注入(L4)。我们构建了SIDEL框架,支持轨迹记录、重放、注入与防御评估,并提供包含400个样本的精选数据集。评估了四种代表性编程代理,进一步测试白名单执行控制与LLM审查。结果表明,路由侧干预显著改变代码库级行为,且现有客户端防护难以检测。在无额外缓解措施下,所有代理在各注入层级的防御成功率均为0%。客户端缓解与事后审查虽提升抗性,但无法完全恢复端到端控制,凸显需引入提供商侧输出完整性保障。代码已开源。
原文摘要 · Abstract (English)
Third-party API routers have become a common layer that unifies access across increasingly diverse LLM providers. In coding-agent workflows, high-autonomy operation is widely adopted because it reduces interaction overhead. As a result, a third-party API router, which sits between the agent and the upstream provider, inevitably occupies the trusted path. It can inspect and modify every request and response, yet no mechanism verifies alignment between the provider's output and the repository-level actions ultimately executed by the agent. Consequently, client-side permission mechanisms may become ineffective in practice. Whether this control gap produces real, hard-to-detect effects on software development tasks remains empirically unmeasured. In this paper, we conduct an empirical study of router-side injection in coding agents, examining four intervention levels of increasing subtlety: Response Substitution (L1), Response Append (L2), LLM-Polished Injection (L3), and LLM-Polished with Distribution Alignment Injection (L4). Moreover, we develop SIDEL, a framework for trace recording, replay, injection, and defense evaluation, with a curated dataset of 400 samples. We evaluate four representative coding agents, and further evaluate whitelist-based execution control and LLM review. Router-side intervention substantially alters repository-level actions and remains difficult for existing client-side safeguards to detect. Without additional mitigations, all evaluated agents achieved a defense success rate of 0 percent across all injection levels. Client-side mitigations and reactive reviews improve resistance but do not fully restore end-to-end control, motivating provider-side output-integrity guarantees. Our code is available at https://github.com/Riyasushin/SIDEL.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。