mlsanityData to 7 Oct 2026

AgentSys: Secure and Dynamic LLM Agents Through Explicit Hierarchical Memory Management

arXiv 2602.07398 ↗First posted 7 Feb 2026cs.CR cs.AIcited by 10

On the map: LLM agents and tool use → Agent threats, guardrails and governance

also in 1 more
Abstract (arXiv)

Indirect prompt injection threatens LLM agents by embedding malicious instructions in external content, enabling unauthorized actions and data theft. LLM agents maintain working memory through their context window, which stores interaction history for decision-making. Conventional agents indiscriminately accumulate all tool outputs and reasoning traces in this memory, creating two critical vulnerabilities: (1) injected instructions persist throughout the workflow, granting attackers multiple opportunities to manipulate behavior, and (2) verbose, non-essential content degrades decision-making capabilities. Existing defenses treat bloated memory as given and focus on remaining resilient, rather than reducing unnecessary accumulation to prevent the attack. We present AgentSys, a framework that defends against indirect prompt injection through explicit memory management. Inspired by process memory isolation in operating systems, AgentSys organizes agents hierarchically: a main agent spawns worker agents for tool calls, each running in an isolated context and able to spawn nested workers for subtasks. External data and subtask traces never enter the main agent's memory; only schema-validated return values can cross boundaries through deterministic JSON parsing. Ablations show isolation alone cuts attack success to 2.19%, and adding a validator/sanitizer further improves defense with event-triggered checks whose overhead scales with operations rather than context length. On AgentDojo and ASB, AgentSys achieves 0.78% and 4.25% attack success while slightly improving benign utility over undefended baselines. It remains robust to adaptive attackers and across multiple foundation models, showing that explicit memory management enables secure, dynamic LLM agent architectures. Our code is available at: https://github.com/ruoyaow/agentsys-memory.

Key facts. Cited by 10 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 46 of its 59 references that are in the map. First posted on arXiv 7 Feb 2026.

Builds on

46 of 59 references.

Closest ancestors · 13

Same direction, newest first

  1. 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents21 Aug
  2. 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection2 Aug
  3. 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
  4. 2025DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents13 Jun
  5. 2025Simple Prompt Injection Attacks Can Leak Personal Data Observed by LLM Agents During Task Execution1 Jun
  6. 2025Progent: Securing AI Agents with Privilege Control16 Apr
  7. 2025Defeating Prompt Injections by Design24 Mar
  8. 2025Adaptive Attacks Break Defenses Against Indirect Prompt Injection Attacks on LLM Agents27 Feb
  9. 2025RTBAS: Defending LLM Agents Against Prompt Injection and Privacy Leakage13 Feb
  10. 2025MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents7 Feb
  11. 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
  12. 2024EIA: Environmental Injection Attack on Generalist Web Agents for Privacy Leakage17 Sep
1 more
  1. 2024IsolateGPT: An Execution Isolation Architecture for LLM-Based Agentic Systems8 Mar

Other references · 33

  1. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  4. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  5. 2023A Survey on Large Language Model based Autonomous Agentscited by 2,203
  6. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
  7. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  8. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
  9. 2024OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environmentscited by 1,134
  10. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  11. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
  12. 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
21 more
  1. 2024Understanding the planning of LLM agents: A surveycited by 414
  2. 2023A Real-World WebAgent with Planning, Long Context Understanding, and Program Synthesiscited by 350
  3. 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
  4. 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 233
  5. 2024Jailbreak Attacks and Defenses Against Large Language Models: A Surveycited by 215
  6. 2025Large Language Model Agent: A Survey on Methodology, Applications and Challengescited by 194
  7. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
  8. 2025From LLM Reasoning to Autonomous AI Agents: A Comprehensive Reviewcited by 146
  9. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 124
  10. 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
  11. 2024Found in the Middle: Calibrating Positional Attention Bias Improves Long Context Utilizationcited by 97
  12. 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspectivecited by 91
  13. 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMscited by 82
  14. 2023Evaluating the Instruction-Following Robustness of Large Language Models to Prompt Injectioncited by 53
  15. 2025ACE: A Security Architecture for LLM-Integrated App Systemscited by 52
  16. 2025Can Indirect Prompt Injection Attacks Be Detected and Removed?cited by 43
  17. 2024Defense Against Prompt Injection Attack by Leveraging Attack Techniquescited by 31
  18. 2025Defending Against Prompt Injection With a Few DefensiveTokenscited by 26
  19. 2025May I have your Attention? Breaking Fine-Tuning based Prompt Injection Defenses using Architecture-Aware Attackscited by 14
  20. 2025How Not to Detect Prompt Injections with an LLMcited by 11
  21. 2025Defense against Prompt Injection Attacks via Mixture of Encodingscited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 10.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Injection-Execution Dissociation: A Mechanistic Evaluation of Persistent Memory Attacks and Defenses in Stateful LLM Agents
  2. 2026MemSecBench: Tracking Agent Memory Poisoning from Persistence to Consequence and Repair
  3. 2026From Storage to Steering: Memory Control Flow Attacks on LLM Agents
  4. 2025MemoryGraft: Persistent Compromise of LLM Agents via Poisoned Experience Retrieval
  5. 2026Zombie Agents: Persistent Control of Self-Evolving LLM Agents via Self-Reinforcing Injections
  6. 2026Bad Memory: Evaluating Prompt Injection Risks from Memory in Agentic Systems
  7. 2026MemLineage: Lineage-Guided Enforcement for LLM Agent Memory
  8. 2026Agentao: A Policy-Governed Runtime Harness for Embeddable Tool-Using LLM Agents