arXiv:2605.24659cs.LG2026-05被引 2

通过反馈迭代优化,突破大模型代理的间接提示注入防御。

IterInject: Indirect Prompt Injection Against LLM Agents via Feedback-Guided Iterative Optimization

论文配图:IterInject: Indirect Prompt Injection Against LLM Agents via Feedback-Guided Iterative Optimization
图 1 · 摘自论文原文
  • 构建反馈闭环,用规则诊断器与LLM优化器动态调整攻击载荷。
  • 在4个目标模型上显著超越静态和现有自适应攻击方法,部分成功率达100%。
  • 适用于研究安全漏洞或设计防御机制的研究者,尤其关注对抗攻击机制。

基于大语言模型的智能体被广泛用于需规划、工具调用与外部服务交互的复杂任务,其对不可信外部内容的依赖使其易受间接提示注入(IPI)攻击——即恶意指令嵌入检索数据中劫持代理行为。现有攻击依赖静态载荷,无法适应代理特定防御;即使最新自适应方法也缺乏结构化反馈指导优化。本文提出 ousys,一种反馈驱动的迭代优化框架,实现攻击、诊断与精炼的闭环:规则诊断器生成带行为描述的结构化结果标签,LLM优化器根据完整优化历史重构载荷;合成步骤从失败模式中生成新伪装种子,使策略空间自我演化。在AgentDojo与InjectAgent上, ousys显著优于静态基线及现有自适应方法,覆盖4种受害模型。扩展实验在具有多层防御的生产级代码代理Claude Code上进行,优化载荷对9个目标中的5个实现完全成功;其余虽未完全攻破,但经迭代优化仍呈现可测量的行为改变。进一步的机制分析揭示中到晚层存在注意力介导的阈值机制;三次因果干预验证该发现,并指向具体防御方向。

原文摘要 · Abstract (English)

LLM-based agents are increasingly deployed for complex tasks requiring planning, tool use, and interaction with external services. Their reliance on untrusted external content exposes them to indirect prompt injection (IPI), in which adversarial instructions embedded in retrieved data hijack agent behavior. Existing attacks rely on static payloads that cannot adapt to agent-specific defenses; even recent adaptive methods lack structured feedback to guide optimization. We introduce \oursys, a feedback-guided iterative framework that closes the loop between injection, diagnosis, and refinement: a rule-based diagnoser produces structured outcome labels with behavioral descriptions, and an LLM-based optimizer refines payloads conditioned on the full optimization history. A synthesis step generates new disguise seeds from failure patterns, enabling the strategy space to self-evolve. On AgentDojo and InjectAgent, \oursys substantially outperforms static baselines and existing adaptive methods across four victim models. Extension experiments on Claude Code, a production-grade coding agent with layered defenses, show that optimized payloads achieve full success on 5 of 9 targets; even those that resist full exploitation exhibit measurable improvement from iterative refinement. We further present a mechanistic analysis of IPI, identifying an attention-mediated threshold mechanism in mid-to-late layers; three causal interventions validate this finding and point to concrete defense directions.

提示注入智能体安全对抗攻击迭代优化

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