Manuscript Offprint

arXiv:2611.07222

SPILLWAY: Separating Target Admission from Sanitization to Defend Tool-Using Agents against Prompt Injection

Woosang Lim, Yeseul Chang, Jaewoo Lee

Woosang Lim1,2,∗^{1,2,*}, Yeseul Chang3^{3} & Jaewoo Lee3^{3}

1^{1}SAINT Machines 2^{2}KAIST 3^{3}Chung-Ang University

∗^{*}Corresponding author: woosang_lim@kaist.ac.kr

saintmachines.github.io/spillway github.com/saintmachines/spillway

Figure

Figure 1: Safety-utility across four attack regimes on AgentDojo (Debenedetti et al., 2024), Points are suite means under AgentDojo's standard attack, ChatInject (Chang et al., 2026), AutoDojo (Ma et al., 2026a), or PISmith (Yin et al., 2026). PISmith is replayed open-loop with the first of its ten variants per injection (ASR@1). ROPE's router is its authors' Opus 4.8 in (a) and the agent in (b) to (d). SPILLWAY holds each shaded ideal corner at the most utility of any defense there.

ABSTRACT

Tool-using agents act on email, files, and payments, so an instruction hidden in a web page or a shared document can make an agent send data or money to an attacker. Many runtime defenses put a language model on the decision that lets an action through, so the decision depends on a model that may read the attacker's text and adds model calls to every step. Provenance defenses keep the model off the final check but need a model to plan or route each task first. Where an action goes can instead be read from the tools' typed returns: an email's sender or a payment's account arrives in a typed field, while injected instructions arrive as free text. SPILLWAY turns this observation into a deterministic floor with no per-task plan. The check admits a call when each target value that appears in tool output but not in the user's 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 its fixed rules match before the model reads them and retains the removed spans as evidence, and a local judge may restore a refused call, never one whose target lies in the removed text. 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, at the highest observed mean utility and composite scores (NRP, ERS) of the defenses we run under that attack. A forged chat template also produces a raw zero, and mean in-scope attack success under a released reinforcement-learning attacker is .007. SPILLWAY reaches this floor with no defense-triggered backbone re-run and almost no added model call. As personal AI agents act on users' email, files, and payments, SPILLWAY gives them an auditable refusal floor on where their actions go that keeps them useful and holds across backbones.

Figure

Figure 2: SPILLWAY's two boundaries. (A) The egress floor admits a call whose targets are named in TT, typed in the index II, or covered by a delegation rule (Alg. 1). Only a refused call reaches the fail-closed two-view judge. (B) The sanitizer (three rule groups shown) removes matched instruction-like regions before the model reads them and keeps them as spans SS. A refused target inside SS never reaches the judge.

1 INTRODUCTION

Tool-using agents now read and act across email, calendars, file stores, chat, and payment services, usually through standardized tool interfaces such as the Model Context Protocol (Model Context Protocol, 2026). Every tool result the agent reads may carry text written by someone else. An attacker who plants an instruction in a web page, a shared document, or an email can make the agent forward data, pay an account, or invite a stranger, all with the user's authority. This is indirect prompt injection (Greshake et al., 2023).

Many runtime defenses add a language model to the loop. In its automated mode, a model writes the privilege policy a checker enforces (Progent (Shi et al., 2025)), re-runs the trajectory with the user task masked to detect a hijack (MELON (Zhu et al., 2025)), or validates each call against a plan (DRIFT (Li et al., 2025)). Others verify each action before it commits (Lin et al., 2026). The decision that lets an action through then depends on a model that may read the injected text, and adds model work to every step. On AgentDojo, MELON, Progent, and DRIFT still leak on 7 to 11 of 12 backbone-by-suite cells in our runs, and on qwen3:8b they add 2.2 to 13.6 backbone calls per benign episode (Figure 3). Provenance defenses keep the model off the final check but move it earlier: CaMeL (Debenedetti et al., 2026) has a planner write the program whose data flow an interpreter checks, and in ROPE (Ma et al., 2026b) a router model reads each request and sets which sources and user-given values the task may draw on, before a deterministic origin check enforces it.

We show on AgentDojo and AgentDyn that where an effect goes can be decided from typed tool returns and the user's task alone. An agent crosses two boundaries. At ingress, untrusted text enters its context, and we decide which parts are instructions. At egress, a call produces an effect, and we decide whether its recipient, account, or file is one the user named or a tool returned as an identity. Tools already type the fields that carry identities: an email's sender, a channel's members, and a transaction's recipient are typed fields, while an injection placed in tool output writes free text such as a body or a description. Section 2 covers the one benchmark vector that fills a channel name. Reading the admitted identities from the typed objects tools return, before they are serialized for the model, separates the targets the user's tools produced from the targets an attacker wrote, with a set lookup.

We introduce SPILLWAY (Figure 2), which makes the two decisions separately and joins them through evidence. Its egress floor admits a side-effecting call when every target value that appears in tool output but not in the user's task was returned in a typed identity field and is not repeated in free text. Its ingress sanitizer removes forged chat turns and the instruction-like regions its rules match before the model reads them and keeps what it removed as evidence. A local judge re-examines only calls the floor refused, so it can recover work the user delegated, such as a reply to an address found in a document, and it is never asked about a target inside the removed evidence. The judge can therefore improve utility without reopening a removed injection (P2, Sec. 3.4), and an injected target the floor refuses leaks only if a delegation rule admits it, or it lies outside the removed spans and the judge approves it (P3).

References (42)