arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.01194cs.CR
收藏

AgentWatcher: 一种基于规则的提示注入监控

AgentWatcher: A Rule-based Prompt Injection Monitor

The Pennsylvania State University(宾夕法尼亚州立大学)

Yanting Wang, Wei Zou, Runpeng Geng, Jinyuan Jia

AI总结:

本文提出AgentWatcher,通过聚焦短文本片段和定义明确的规则,解决提示注入检测中上下文长度影响和规则不明确的问题,实现可扩展且可解释的检测方法。

摘要:

大型语言模型(LLMs)及其应用,如代理,对提示注入攻击高度敏感。现有检测方法存在两个局限:(1)随着上下文长度增加,效果显著下降;(2)缺乏明确规则定义提示注入,导致检测决策隐含、不透明且难以解释。本文提出AgentWatcher,通过将LLM输出归因于少量因果影响的上下文片段,聚焦较短文本以实现可扩展性;并定义规则明确界定提示注入,利用监控LLM基于归因文本推理规则,提升可解释性。实验在工具使用代理基准和长上下文理解数据集上验证,结果表明AgentWatcher能有效检测提示注入并维持无攻击时的实用性。代码见https://github.com/wang-yanting/AgentWatcher。

英文摘要:

Large language models (LLMs) and their applications, such as agents, are highly vulnerable to prompt injection attacks. State-of-the-art prompt injection detection methods have the following limitations: (1) their effectiveness degrades significantly as context length increases, and (2) they lack explicit rules that define what constitutes prompt injection, causing detection decisions to be implicit, opaque, and difficult to reason about. In this work, we propose AgentWatcher to address the above two limitations. To address the first limitation, AgentWatcher attributes the LLM's output (e.g., the action of an agent) to a small set of causally influential context segments. By focusing detection on a relatively short text, AgentWatcher can be scalable to long contexts. To address the second limitation, we define a set of rules specifying what does and does not constitute a prompt injection, and use a monitor LLM to reason over these rules based on the attributed text, making the detection decisions more explainable. We conduct a comprehensive evaluation on tool-use agent benchmarks and long-context understanding datasets. The experimental results demonstrate that AgentWatcher can effectively detect prompt injection and maintain utility without attacks. The code is available at https://github.com/wang-yanting/AgentWatcher.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑