Command Palette
Search for a command to run...
SPILLWAY:ツール使用エージェントをプロンプトインジェクションから守るための、ターゲット許可とサニタイズの分離
SPILLWAY:ツール使用エージェントをプロンプトインジェクションから守るための、ターゲット許可とサニタイズの分離
Woosang Lim Yeseul Chang Jaewoo Lee
概要
ツール使用エージェントはメール、ファイル、支払いを扱うため、ウェブページや共有文書に隠された指示によって、エージェントがデータや金銭を攻撃者に送ってしまう可能性がある。多くの実行時防御は、アクションの通過を言語モデルの判断に委ねるため、その判断は攻撃者のテキストを読む可能性のあるモデルに依存し、各ステップにモデル呼び出しが追加される。来歴ベースの防御は最終チェックからモデルを除外するが、各タスクの計画や経路選択を事前にモデルが行う必要がある。アクションの送り先は、代わりにツールの型付き戻り値から読み取ることができる。メールの送信者や支払いの口座は型付きフィールドで返され、注入された指示は自由テキストとして現れる。SPILLWAYはこの観察を、タスクごとの計画を必要としない決定的な下限へと転換する。このチェックは、ツール出力に現れるがユーザーのタスクには現れない各ターゲット値が、読み取り専用ツールによって型付きフィールドで返されたか、固定の委任ルールでカバーされている場合に呼び出しを許可する。決定的サニタイザは、モデルが読む前に、固定ルールが一致する指示らしき領域を除去し、除去されたスパンを証拠として保持する。ローカル判定器は拒否された呼び出しを復元できるが、ターゲットが除去されたテキスト内にある呼び出しは決して復元しない。3つのバックボーンと、そのうちの1つにおける7つのタスクスイートにわたって、SPILLWAYの下では標準的なテンプレート化されたインジェクションがアクションを攻撃者のターゲットへリダイレクトすることはなく、その攻撃の下で我々が実行した防御の中で最高の平均有用性と複合スコア(NRP、ERS)を記録した。偽造されたチャットテンプレートも生のゼロを生み出し、公開された強化学習攻撃者によるスコープ内攻撃の平均成功率は.005である。SPILLWAYは、防御に起因するバックボーンの再実行なしに、また追加のモデル呼び出しをほとんど伴わずに、この下限に到達する。パーソナルAIエージェントがユーザーのメール、ファイル、支払いを扱うようになる中で、SPILLWAYはアクションの送り先に関する監査可能な拒否の下限を提供し、有用性を保ちつつバックボーンをまたいで有効に機能する。
One-sentence Summary
SAINT Machines, KAIST, and Chung-Ang University propose SPILLWAY, a deterministic defense that separates target admission from sanitization by admitting a call only when each target value absent from the user’s task comes from a read-only tool’s typed field or a fixed delegation rule and by removing instruction-like text before the model reads it; across three backbones and seven task suites on one backbone, SPILLWAY prevents standard templated injection redirects and yields a mean in-scope attack success of 0.005 under a released reinforcement-learning attacker.
Key Contributions
- SPILLWAY provides a deterministic egress floor that reads action targets from typed tool returns and the user’s task, admitting a call only when each target value absent from the task was returned by a read-only tool in a typed field or is covered by a fixed delegation rule.
- A deterministic sanitizer removes instruction-like regions matched by fixed rules before the model reads tool output and retains the removed spans as evidence; a bounded local judge may restore a refused call only when its target lies outside the removed text, and the floor and sanitizer use no model.
- Across three backbones, and seven task suites on one of them, no standard templated injection redirects an action to an attacker’s target under SPILLWAY, with the highest observed mean utility and composite scores (NRP, ERS) among defenses run under that attack, zero in-scope success under a forged chat template, and .005 mean success under a released reinforcement-learning attacker.
Introduction
Tool-using agents now act across email, calendars, files, chat, and payments through standardized interfaces, but any tool result they read can carry attacker-written text, enabling indirect prompt injection that abuses the user’s authority. Prior runtime defenses often add a language model to validate actions or plans, which can still read injected content, adds model work to every step, and leaks on benchmark cells, while provenance-based defenses move the model earlier but still rely on routing or planning decisions. The authors introduce SPILLWAY, which separates ingress sanitization from egress target admission by deciding where an effect may go from typed tool returns and the user’s task alone, using a set lookup rather than a per-task model call, and bounds the only model judge so it cannot reopen removed injected content.
Method
SPILLWAY is organized as three cooperating components: an egress check called the floor, an ingress sanitizer, and a two-view recovery judge. The floor operates before side-effecting tool calls, the sanitizer operates before model ingestion of tool text, and the judge re-examines a narrow class of refusals.
Egress Check
The egress check decides whether a proposed side-effecting call can proceed. For a call with target arguments, the floor admits it only when every taint-novel value in those arguments is present in an index I and none is repeated in free text. Values the user explicitly named are never taint-novel. Because the floor is a set lookup, its refusals are the same under every backbone model.
The index I is built from the declared types of tools, never from free text. Tool and argument roles come from a fixed lexicon per benchmark. Verb prefixes mark read-only, writing, destructive, and granting tools. Argument names mark targets and principals, and a short list identifies tools that write only to the user’s own calendar or drive.
The executor captures the return of each read-only tool as the typed object produced before it is serialized for the model. A value is indexed only when its declared field type is an identity format, such as email, URI, UUID, hostname, or IP, or when its field has a routing role such as recipient, sender, participant, or channel. Body, subject, and description fields never enter I, so an address written into free text remains taint-novel.
Two rules prevent an attacker from adding values to I. Only read-only returns are indexed, so an allowed write cannot add a value. In addition, a read whose own arguments are taint-novel adds nothing. The floor also refuses an email or URL in a free-text field even when it matches a real contact. By contrast, a reply to the sender of an email mentioned in the task is allowed because the sender field is typed, so the address is in I.
Grants are handled more strictly. A call that grants access to a new workspace or channel member named only in tool output is refused, and no judge reopens it. Event participants and a shared file’s recipient count as targets even when the write lands in the user’s own calendar or drive. A deletion is refused unless the task asks for it. A deletion of an injected object is also treated as an unrequested commit, which the two-view judge may restore.
Delegation rules cover targets that the user named indirectly. Before the judge, deterministic rules admit a target whose value carries a name the user wrote in the task, a contact attribute of an entity the user named, or a resource owned by the user’s own account. After the judge, they also admit a download from a URL whose domain the user named, and on repository clone, invite, and ownership-transfer tools, a target that lies in no removed span, but only when the task asks for that grant. These rules read only the task, typed returns, and removed spans.
Effects without an identity target, such as a booking, a fetched page, or a recommendation, have their own deterministic first rules. An unrequested commit on an injected object is refused. An irreversible operation under a superlative criterion, such as “the largest” or “the cheapest,” is refused when its object is not the winner of that criterion on the typed listing. An injected endorsement is removed from the final answer. Cases these rules cannot settle go to a fail-closed judge that can refuse the call.
Ingress Sanitizer
The floor stops an effect, but the sanitizer is needed because a model that has read an injection can still keep working for the attacker and ignore the user’s task. The sanitizer rewrites what the agent reads next using deterministic rules and no model call.
It replaces forged chat-template turns, such as a fabricated system or user turn, and the text they wrap with a marker. It also replaces three kinds of text with an inert placeholder: injection-template regions, tool text that addresses the agent in the second or third person about its task or answer, and claims in data that a payee’s account has changed, together with the account it puts forward. A removed region ends at its match or, for a clause addressing the agent, at the end of that return, so the data before it stays available.
Trust remains with the first user message, so a forged user turn never becomes trusted. The sanitizer records what it removes as the span set S. A refused target inside S never reaches the judge. The index I is built from the raw typed returns before any rewrite.
Recovery Judge
A strict floor also refuses some legitimate calls. For example, when the user asks the agent to send a report to the address given in meeting notes, that address is taint-novel and is refused like an injected one. The judge re-examines the refused call from two views, and both must agree.
The routing view asks whether the target is a recipient implied by the user’s task. The payload view asks whether the user requested this action and this content. The judge sees only calls that a deterministic rule has already refused. Grant and criterion refusals never reach it.
The judge is also constrained by the sanitizer. If a refused target lies inside removed text, the judge is not asked at all. This is called the span veto. The judge is a local model called at temperature 0, and it fails closed: a missing verdict counts as a no. A refused call returns to the agent as a tool message asking it to re-issue the call with values from the user’s request, allowing the episode to continue.
Formal Guarantees
Let F denote the target-bearing calls SPILLWAY admits without the judge, and let RSˉ denote refused target-bearing calls whose target lies outside the image of the removed spans and that are neither grants nor unauthorized destructive calls.
P1 covers typed-identity lookup soundness. Under the taint-novel definition, if the attacker writes only free-text fields, the lookup refuses every call whose target value appears in attacker-written text and not in the task, because such a value is either outside I or repeated in free text.
P2 is a bound that holds for any judge. For every judge J and every proposed target-bearing call c, c∈F implies that c is admitted, and if c is admitted then c∈F∪RSˉ. If J always refuses, only F is admitted. The judge therefore affects safety only through RSˉ, which the sanitizer’s evidence narrows. Utility can move either way because an admitted call changes the rest of the episode.
P3 covers remaining admission paths. An attacker-written target that the typed-identity lookup refuses can still be admitted only through a deterministic delegation rule or through the two-view judge when every taint-novel target of the call lies outside the removed-span image. A residual leak must therefore satisfy a delegation rule or survive both the span veto and the two-view judgment.
Experiment
The experiments evaluate SPILLWAY on AgentDojo and AgentDyn across multiple backbones in a breadth setting and a delegated-routing comparison with ROPE, using a standard prompt injection template, stress attacks such as forged chat templates and optimizer-generated injections, and a released RL attacker. Scoring counts an attack as successful only when an injected effect actually executes against a recipient the user never named, while separately tracking benign utility and under-attack utility. SPILLWAY holds the attacker-target path closed on the full breadth grid and near closed under the strongest stress attacks, while preserving nearly all benign utility and adding little overhead, whereas ROPE, MELON, Progent, and DRIFT leak or lose more utility. Component results confirm that the target gate, sanitizer, and judge together enforce the floor without depending on trace-level artifacts.
On the standard AgentDojo attack grid, SPILLWAY removes in-scope attack success across every backbone and suite combination, a result no other defense matches. It preserves nearly all of the undefended agent's benign utility and delivers higher utility under attack than the alternatives. SPILLWAY also adds less overhead in model calls and runtime on benign traffic than MELON, Progent, and DRIFT. SPILLWAY is the only defense that reaches zero in-scope attack success across all twelve backbone-and-suite cells. ROPE, MELON, Progent, and DRIFT still leak in multiple cells, with ROPE leaking on Slack cells. SPILLWAY keeps benign utility close to the undefended agent and achieves higher under-attack utility than other defenses. On benign traffic, SPILLWAY adds fewer model calls and less latency than MELON, Progent, and DRIFT.
SPILLWAY eliminates in-scope attack success across all twelve cells, with no raw hits and no filter-zeroed cases, while its benign utility remains essentially at the undefended baseline. It also achieves the highest utility under attack and the highest composite NRP and ERS scores among the defense methods shown. Other methods still leak in several cells, from three for ROPE up to twelve for the undefended agent. SPILLWAY is the only evaluated defense with zero raw hits, zero filter-zeroed cases, and zero in-scope leaks across all twelve cells, while keeping benign utility nearly identical to the undefended agent. Utility under attack and composite NRP and ERS scores are highest for SPILLWAY, whereas ROPE, DRIFT, MELON, and Progent still leak on multiple cells.
A strict floor alone already prevents all in-scope attacks but gives up utility. Adding the judge alone recovers some utility but introduces small leaks on Banking and Workspace. Including the sanitizer restores zero attack success across all suites and improves utility over the floor on Banking, Slack, and Travel, while removing the span veto has no attack impact and only slightly changes Workspace utility. The full sanitizer-plus-judge configuration holds attack success at zero on all four suites. Judge-only recovery is the only ablated arm that leaks, with small attack successes on Banking and Workspace. The sanitizer recovers utility above the strict floor on Banking, Slack, and Travel, and the no-span-veto variant remains leak-free.
Across the ChatInject and AutoDojo stress tests, SPILLWAY is the only listed defense with zero in-scope attack success in every domain, while the undefended agent and most baselines leak. It also raises under-attack utility above the undefended agent in every stress-test cell and leads the listed defenses on AutoDojo Banking, Slack, and Travel. MELON and DRIFT improve some utility metrics but do not match SPILLWAY's combined attack success and composite success. SPILLWAY records zero attack success in all ChatInject and AutoDojo cells, in contrast to undefended leakage up to .648 ASR and nonzero leakage from Progent and DRIFT in most cells. SPILLWAY's under-attack utility is higher than the undefended agent in every stress-test cell and leads the listed defenses in AutoDojo Banking, Slack, and Travel.
Across the AgentDojo grid, ablations, and ChatInject/AutoDojo stress tests, SPILLWAY is evaluated against baselines such as ROPE, MELON, Progent, and DRIFT. SPILLWAY is the only defense that eliminates in-scope attack success in every backbone-and-suite combination while keeping benign utility near the undefended baseline and adding less overhead than MELON, Progent, and DRIFT. Ablations show that the sanitizer-plus-judge configuration is necessary to maintain zero attack success and recover utility over a strict floor, while judge-only recovery leaks slightly on Banking and Workspace. In stress tests, SPILLWAY again achieves zero in-scope attack success across all domains and higher under-attack utility than the undefended agent, unlike the baselines.