ChatPaper.aiChatPaper

AgentWatcher: ルールベースのプロンプトインジェクション監視システム

AgentWatcher: A Rule-based Prompt Injection Monitor

April 1, 2026
著者: Yanting Wang, Wei Zou, Runpeng Geng, Jinyuan Jia
cs.AI

要旨

大規模言語モデル(LLM)とエージェントなどのその応用技術は、プロンプトインジェクション攻撃に対して極めて脆弱である。現状の最先端プロンプトインジェクション検出手法には以下の課題がある:(1)コンテキスト長が増加するにつれて検出効果が大幅に低下すること、(2)プロンプトインジェクションを構成する条件を定義する明示的なルールが欠如しているため、検出判断が暗黙的で不透明になり、判断根拠の追跡が困難になることである。本研究では、これらの課題を解決するためにAgentWatcherを提案する。最初の課題に対処するため、AgentWatcherはLLMの出力(例:エージェントの行動)を少数の因果的に影響力のあるコンテキストセグメントに帰属させる。比較的短いテキストに検出を集中させることで、長いコンテキストに対してもスケーラブルな検出を実現する。第二の課題については、プロンプトインジェクションの構成条件を定義する明示的ルールセットを定め、監視用LLMを用いて帰属テキストに基づきこれらのルールを推論させることで、検出判断の説明可能性を高める。ツール利用エージェントのベンチマークと長文理解データセットを用いた包括的評価を実施した結果、AgentWatcherがプロンプトインジェクションを効果的に検出し、攻撃非存在下では有用性を維持できることを実証した。コードはhttps://github.com/wang-yanting/AgentWatcher で公開されている。
English
Large language models (LLMs) and their applications, such as agents, are highly vulnerable to prompt injection attacks. State-of-the-art prompt injection detection methods have the following limitations: (1) their effectiveness degrades significantly as context length increases, and (2) they lack explicit rules that define what constitutes prompt injection, causing detection decisions to be implicit, opaque, and difficult to reason about. In this work, we propose AgentWatcher to address the above two limitations. To address the first limitation, AgentWatcher attributes the LLM's output (e.g., the action of an agent) to a small set of causally influential context segments. By focusing detection on a relatively short text, AgentWatcher can be scalable to long contexts. To address the second limitation, we define a set of rules specifying what does and does not constitute a prompt injection, and use a monitor LLM to reason over these rules based on the attributed text, making the detection decisions more explainable. We conduct a comprehensive evaluation on tool-use agent benchmarks and long-context understanding datasets. The experimental results demonstrate that AgentWatcher can effectively detect prompt injection and maintain utility without attacks. The code is available at https://github.com/wang-yanting/AgentWatcher.
PDF01April 3, 2026