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.


翻译:大型语言模型(LLM)及其应用(如智能代理)极易受到提示注入攻击。当前最先进的提示注入检测方法存在以下局限性:(1)随着上下文长度增加,其检测效能显著下降;(2)缺乏明确定义何为提示注入的显式规则,导致检测决策隐含、不透明且难以推理。为此,我们提出AgentWatcher以解决上述两个问题。针对第一个局限性,AgentWatcher将LLM的输出(如代理的动作)归因于少量具有因果影响力的上下文片段。通过聚焦于相对较短的文本进行检测,AgentWatcher可扩展至长上下文场景。针对第二个局限性,我们定义了一组明确界定提示注入与否的规则,并利用监控LLM基于归因文本对这些规则进行推理,使检测决策更具可解释性。我们在工具调用型代理基准测试和长上下文理解数据集上进行了全面评估。实验结果表明,AgentWatcher能有效检测提示注入,并在无攻击场景下保持可用性。代码开源地址:https://github.com/wang-yanting/AgentWatcher

0
下载
关闭预览

相关内容

DGP双粒度提示框架:图增强大模型助力欺诈检测
专知会员服务
9+阅读 · 2025年8月17日
AgentOps综述:分类、挑战与未来方向
专知会员服务
40+阅读 · 2025年8月6日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
大语言模型中的提示隐私保护
专知会员服务
24+阅读 · 2024年7月24日
KG-Agent:面向KG复杂推理的高效自治代理框架
专知会员服务
35+阅读 · 2024年6月1日
AI Agent,大模型时代重要落地方向, 42页ppt
专知会员服务
291+阅读 · 2023年10月12日
一文读懂Attention机制
机器学习与推荐算法
63+阅读 · 2020年6月9日
干货 | 视频显著性目标检测(文末附有完整源码)
计算机视觉战队
38+阅读 · 2019年9月3日
原创 | Attention Modeling for Targeted Sentiment
黑龙江大学自然语言处理实验室
25+阅读 · 2017年11月5日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
重新思考无人机时代的生存能力
专知会员服务
3+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
3+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
4+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
4+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关VIP内容
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员