AgentSentry: LLM 에이전트의 간접 프롬프트 주입 공격 완화: 시간적 인과 관계 분석 및 컨텍스트 정제
AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification
최근 LLM(대규모 언어 모델) 에이전트는 복잡한 작업을 자율적으로 수행하기 위해 외부 도구 및 검색 시스템에 점점 더 의존하고 있습니다. 그러나 이러한 설계는 에이전트가 간접 프롬프트 주입(IPI) 공격에 취약하게 만듭니다. IPI 공격은 공격자가 제어하는 컨텍스트가 도구의 출력이나 검색된 콘텐츠에 포함되어 에이전트의 행동을 사용자 의도와 다르게 유도하는 방식입니다. 기존의 프롬프트 기반 공격과는 달리, IPI 공격은 여러 단계에 걸쳐 발생하며, 악의적인 제어를 합법적인 작업 실행과 구별하기 어렵습니다. 기존의 추론 시간 방어는 주로 휴리스틱 기반 탐지 및 고위험 작업을 보수적으로 차단하는 방식으로 작동하며, 이는 모호한 다단계 시나리오에서 작업 흐름을 조기에 종료시키거나 도구 사용을 광범위하게 억제할 수 있습니다. 본 논문에서는 도구 기반 LLM 에이전트를 위한 새로운 추론 시간 탐지 및 완화 프레임워크인 AgentSentry를 제안합니다. AgentSentry는 우리가 알고 있는 한, 다단계 IPI 공격을 시간적 인과 관계의 변화로 모델링하는 최초의 추론 시간 방어 시스템입니다. AgentSentry는 제어된 반사실적 재실행을 통해 도구 반환 경계에서 공격 지점을 찾아내고, 공격으로 인한 편향을 제거하면서 작업과 관련된 중요한 정보를 보존하는 인과 관계 기반 컨텍스트 정제를 통해 안전한 작업 진행을 가능하게 합니다. 우리는 AgentSentry를 extsc{AgentDojo} 벤치마크에서 네 가지 작업 세트, 세 가지 IPI 공격 유형, 그리고 다양한 블랙박스 LLM을 사용하여 평가했습니다. AgentSentry는 모든 공격을 성공적으로 차단하고 공격 상황에서도 높은 유틸리티를 유지했으며, 평균 유틸리티(UA)는 74.55%로, 가장 강력한 기존 방법보다 20.8%에서 33.6% 포인트 향상되었습니다. 또한, 정상적인 성능 저하 없이 이러한 성능 향상을 달성했습니다.
Large language model (LLM) agents increasingly rely on external tools and retrieval systems to autonomously complete complex tasks. However, this design exposes agents to indirect prompt injection (IPI), where attacker-controlled context embedded in tool outputs or retrieved content silently steers agent actions away from user intent. Unlike prompt-based attacks, IPI unfolds over multi-turn trajectories, making malicious control difficult to disentangle from legitimate task execution. Existing inference-time defenses primarily rely on heuristic detection and conservative blocking of high-risk actions, which can prematurely terminate workflows or broadly suppress tool usage under ambiguous multi-turn scenarios. We propose AgentSentry, a novel inference-time detection and mitigation framework for tool-augmented LLM agents. To the best of our knowledge, AgentSentry is the first inference-time defense to model multi-turn IPI as a temporal causal takeover. It localizes takeover points via controlled counterfactual re-executions at tool-return boundaries and enables safe continuation through causally guided context purification that removes attack-induced deviations while preserving task-relevant evidence. We evaluate AgentSentry on the \textsc{AgentDojo} benchmark across four task suites, three IPI attack families, and multiple black-box LLMs. AgentSentry eliminates successful attacks and maintains strong utility under attack, achieving an average Utility Under Attack (UA) of 74.55 %, improving UA by 20.8 to 33.6 percentage points over the strongest baselines without degrading benign performance.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.