HyperAIHyperAI

Command Palette

Search for a command to run...

Agent
LLM

SPILLWAY: SEPARATING TARGET ADMISSION FROM SANITIZATION TO DEFEND TOOL-USING AGENTS AGAINST PROMPT INJECTION

Woosang Lim Yeseul Chang Jaewoo Lee

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 .005. 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.

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.0050.0050.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 III 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 III 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 III, so an address written into free text remains taint-novel.

Two rules prevent an attacker from adding values to III. 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 III.

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 SSS. A refused target inside SSS never reaches the judge. The index III 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\mathcal{F}F denote the target-bearing calls SPILLWAY admits without the judge, and let RSˉ\mathcal{R}_{\bar S}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 III or repeated in free text.

P2 is a bound that holds for any judge. For every judge JJJ and every proposed target-bearing call ccc, c∈Fc \in \mathcal{F}c∈F implies that ccc is admitted, and if ccc is admitted then c∈F∪RSˉc \in \mathcal{F} \cup \mathcal{R}_{\bar S}c∈F∪RSˉ​. If JJJ always refuses, only F\mathcal{F}F is admitted. The judge therefore affects safety only through RSˉ\mathcal{R}_{\bar S}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.


Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp