ChatPaper.aiChatPaper

AgentSys: 명시적 계층적 메모리 관리를 통한 안전하고 동적인 LLM 에이전트 시스템

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

February 7, 2026
저자: Ruoyao Wen, Hao Li, Chaowei Xiao, Ning Zhang
cs.AI

초록

간접 프롬프트 인젝션은 외부 콘텐츠에 악성 지시문을 삽입하여 무단 행위와 데이터 유출을 가능하게 함으로써 LLM 에이전트를 위협합니다. LLM 에이전트는 의사 결정을 위한 상호작용 기록을 저장하는 컨텍스트 윈도우를 통해 작업 기억을 유지합니다. 기존 에이전트는 모든 도구 출력과 추론 흔적을 이 메모리에 무분별하게 축적하는데, 이는 두 가지 중대한 취약점을 생성합니다: (1) 인젝션된 지시문이 워크플로우 전체에 지속되어 공격자가 행위를 조작할 기회가 여러 번 발생하며, (2) 장황하고 비필수적인 콘텐츠가 의사 결정 능력을 저하시킵니다. 기존 방어 기법은 비대해진 메모리를 주어진 것으로 간주하고 공격을 예방하기 위한 불필요한 축적을 줄이기보다는, 그 안에서도 견고하게 유지하는 데 중점을 둡니다. 우리는 명시적 메모리 관리를 통해 간접 프롬프트 인젝션으로부터 방어하는 AgentSys 프레임워크를 제시합니다. 운영체제의 프로세스 메모리 격리에서 영감을 받은 AgentSys는 에이전트를 계층적으로 구성합니다: 메인 에이전트가 도구 호출을 위해 작업자(worker) 에이전트를 생성하며, 각 작업자는 격리된 컨텍스트에서 실행되고 하위 작업을 위해 중첩된 작업자를 생성할 수 있습니다. 외부 데이터와 하위 작업 흔적은 결코 메인 에이전트의 메모리로 들어가지 않으며, 스키마 검증된 반환값만 결정론적 JSON 파싱을 통해 경계를 넘을 수 있습니다. Ablation 실험은 격리만으로도 공격 성공률을 2.19%로 낮추며, 검증기/세정기를 추가하고 컨텍스트 길이가 아닌 작업 수에 따라 확장되는 오버헤드를 가진 이벤트 트리거 검사를 도입하면 방어 성능이 더욱 향상됨을 보여줍니다. AgentDojo와 ASB 벤치마크에서 AgentSys는 각각 0.78%, 4.25%의 공격 성공률을 달성하면서 방어가 없는 기준선 대비 정상 작업 유용성도 약간 향상시켰습니다. 이 프레임워크는 적응형 공격자와 다양한 기반 모델에 걸쳐 견고성을 유지하며, 명시적 메모리 관리가 안전하고 동적인 LLM 에이전트 아키텍처를 가능하게 함을 입증합니다. 우리의 코드는 https://github.com/ruoyaow/agentsys-memory 에서 이용 가능합니다.
English
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.
PDF11February 12, 2026