TraceAegis: Securing LLM-Based Agents via Hierarchical and Behavioral Anomaly Detection
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
LLM-based agents have demonstrated promising adaptability in real-world applications. However, these agents remain vulnerable to a wide range of attacks, such as tool poisoning and malicious instructions, that compromise their execution flow and can lead to serious consequences like data breaches and financial loss. Existing studies typically attempt to mitigate such anomalies by predefining specific rules and enforcing them at runtime to enhance safety. Yet, designing comprehensive rules is difficult, requiring extensive manual effort and still leaving gaps that result in false negatives. As agent systems evolve into complex software systems, we take inspiration from software system security and propose TraceAegis, a provenance-based analysis framework that leverages agent execution traces to detect potential anomalies. In particular, TraceAegis constructs a hierarchical structure to abstract stable execution units that characterize normal agent behaviors. These units are then summarized into constrained behavioral rules that specify the conditions necessary to complete a task. By validating execution traces against both hierarchical and behavioral constraints, TraceAegis is able to effectively detect abnormal behaviors. To evaluate the effectiveness of TraceAegis, we introduce TraceAegis-Bench, a dataset covering two representative scenarios: healthcare and corporate procurement. Each scenario includes 1,300 benign behaviors and 300 abnormal behaviors, where the anomalies either violate the agent's execution order or break the semantic consistency of its execution sequence. Experimental results demonstrate that TraceAegis achieves strong performance on TraceAegis-Bench, successfully identifying the majority of abnormal behaviors.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 20 of its 33 references that are in the map. First posted on arXiv 13 Oct 2025.
Builds on
20 of 33 references.
Closest ancestors · 10
Same direction, newest first
- 2025AgentSentinel: An End-to-End and Real-Time Security Defense Framework for Computer-Use Agents9 Sep
- 2025AgentSight: System-Level Observability for AI Agents Using eBPF2 Aug
- 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection2 Aug
- 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
- 2025Progent: Securing AI Agents with Privilege Control16 Apr
- 2025ShieldAgent: Shielding Agents via Verifiable Safety Policy Reasoning26 Mar
- 2025Defeating Prompt Injections by Design24 Mar
- 2025Prompt Flow Integrity to Prevent Privilege Escalation in LLM Agents17 Mar
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec
- 2024When LLMs Go Online: The Emerging Threat of Web-Enabled LLMs18 Oct
Other references · 10
- 2023CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Societycited by 1,348
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
- 2024Understanding the planning of LLM agents: A surveycited by 414
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
- 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 124
- 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspectivecited by 91
- 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuningcited by 89
- 2024Defense Against Prompt Injection Attack by Leveraging Attack Techniquescited by 31
- 2025Robustness via Referencing: Defending against Prompt Injection Attacks by Referencing the Executed Instructioncited by 15
Built on by
Citing papers per year: 2026: 11.
11 papers.
- 2026AIR: Improving Agent Safety through Incident Responsecited by 8
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden Statescited by 3
- 2026Runtime Skill Audit: Targeted Runtime Probing for Agent Skill Securitycited by 2
- 2026Forensic Trajectory Signatures for Agent Memory Poisoning Detectioncited by 2
- 2026Automata from Agent Traces: Failure and Next-Step Predictioncited by 2
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectoriescited by 2
- 2026Content-Aware Attack Detection in LLM Agent Tool-Call Traffic: An Empirical Study of Features, Architectures, and Evaluation Protocolscited by 1
- 2026Inverting the Shield: Systematically Generating Safety Tests from Policy Specificationscited by 0
- 2026Hybrid Analysis for Secure MCP Tool Use in LLM Agentscited by 0
- 2026Skynet: Workflow-Level Anomaly Detection for Agentic AI via Semantic and Structural Modelingcited by 0
- 2026DriftNet: A Dual-Head Trajectory Transformer for Detecting and Localizing Prompt Injection in LLM Agentscited by 0
- 2026DriftNet: A Dual-Head Trajectory Transformer for Detecting and Localizing Prompt Injection in LLM Agents9 Sep 2026
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories7 Sep 2026
- 2026Skynet: Workflow-Level Anomaly Detection for Agentic AI via Semantic and Structural Modeling6 Sep 2026
- 2026Automata from Agent Traces: Failure and Next-Step Prediction24 Aug 2026
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States1 Aug 2026
- 2026Hybrid Analysis for Secure MCP Tool Use in LLM Agents28 Jul 2026
- 2026Forensic Trajectory Signatures for Agent Memory Poisoning Detection29 Jun 2026
- 2026Runtime Skill Audit: Targeted Runtime Probing for Agent Skill Security10 Jun 2026
- 2026Inverting the Shield: Systematically Generating Safety Tests from Policy Specifications24 May 2026
- 2026Content-Aware Attack Detection in LLM Agent Tool-Call Traffic: An Empirical Study of Features, Architectures, and Evaluation Protocols11 May 2026
- 2026AIR: Improving Agent Safety through Incident Response12 Feb 2026
Similar, not cited
Close in wording, no citation either way
- 2026LLM Agents Can Easily Tamper With Their Own Traces
- 2026From Agent Traces to Trust: A Survey of Evidence Tracing and Execution Provenance in LLM Agents
- 2026Agent Audit: A Security Analysis System for LLM Agent Applications
- 2026TraceSIR: A Multi-Agent Framework for Structured Analysis and Reporting of Agentic Execution Traces
- 2026AgentTrace: A Structured Logging Framework for Agent System Observability
- 2026TRACE: Task-Aware Adaptive Self-Evolving Agentic Jailbreaking
- 2026Safeguarding LLM Agents from Misalignment through Provenance Analysis
- 2026Local LLM Agents as Vulnerable Runtimes:A Source-Code Audit of the Agent Runtime Layer