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

TL;DR
AgentArmor transforms LLM agent runtime traces into structured program representations to analyze and enforce security policies, significantly reducing prompt injection risks with minimal utility loss.
Contribution
This work introduces AgentArmor, a novel framework that applies program analysis techniques to agent runtime traces for security enforcement, a new approach in LLM agent security.
Findings
Reduces attack success rate to 3%
Maintains 99% utility of agent functions
Effectively detects security policy violations
Abstract
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;…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdversarial Robustness in Machine Learning · Advanced Graph Neural Networks · Topic Modeling
