arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.01249cs.CRcs.AIcs.CLcs.LGcs.SE
收藏

AgentArmor:对智能体运行时轨迹执行程序分析以防御提示注入攻击

AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection

Peiran Wang, Yang Liu, Yunfei Lu, Yifeng Cai, Hongbo Chen, Qingyou Yang, Jie Zhang, Jue Hong, Ye Wu

AI总结:

针对大语言模型智能体易受提示注入攻击的问题,提出程序分析框架AgentArmor,通过将运行时轨迹转为结构化程序表示开展安全检测,在AgentDojo基准上可将攻击成功率降至3%,效用损失仅1%。

摘要:

大语言模型(LLM)智能体通过将自然语言推理与外部工具执行相结合,为解决各类问题提供了强大的新范式。然而,其动态且不透明的行为带来了严重的安全风险,尤其是在面临提示注入攻击时。本研究提出了一种新颖的思路,即将智能体运行时轨迹视为具备可分析语义的结构化程序。基于此,我们提出了AgentArmor这一程序分析框架,它将智能体轨迹转换为基于图中间表示的结构化程序依赖表示(例如控制流图CFG、数据流图DFG、程序依赖图PDG),并通过类型系统执行安全策略。AgentArmor包含三个核心组件:(1)图构造器,将智能体的运行时轨迹重构为描述了控制流与数据流的基于图的中间表示;(2)属性注册表,附加所交互工具与数据的安全相关元数据;(3)类型系统,在中间表示上执行静态推断与检查。通过将智能体行为表示为结构化程序,AgentArmor能够针对敏感数据流、信任边界与策略违规开展程序分析。我们在AgentDojo基准上对AgentArmor进行了评估,结果显示AgentArmor可将攻击成功率(ASR)降至3%,而效用损失仅为1%。

英文摘要:

Large Language Model (LLM) agents offer a powerful new paradigm for solving various problems by combining natural language reasoning with the execution of external tools. However, their dynamic and non-transparent behavior introduces critical security risks, particularly in the presence of prompt injection attacks. In this work, we propose a novel insight that treats the agent runtime traces as structured programs with analyzable semantics. Thus, we present AgentArmor, a program analysis framework that converts agent traces into graph intermediate representation-based structured program dependency representations (e.g., CFG, DFG, and PDG) and enforces security policies via a type system. AgentArmor consists of three key components: (1) a graph constructor that reconstructs the agent's runtime traces as graph-based intermediate representations with control and data flow described within; (2) a property registry that attaches security-relevant metadata of interacted tools \& data, and (3) a type system that performs static inference and checking over the intermediate representation. By representing agent behavior as structured programs, AgentArmor enables program analysis for sensitive data flow, trust boundaries, and policy violations. We evaluate AgentArmor on the AgentDojo benchmark, the results show that AgentArmor can reduce the ASR to 3\%, with the utility drop only 1\%.

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

↑