synodic-ai™ AI SECURITY
AI Security Desk · Prompt Injection Defenses

Prompt injection at three layers: spoofed roles, sanitized tool outputs and least-privilege task assets

Three papers posted on 2026-10-29 take on indirect prompt injection at different layers of an agent: how the model decides who said what, what is removed from tool outputs before the model reads them, and which resources the agent can reach at all. Read together, they show that training a model to resist injected text is incomplete on its own, and that filtering tool outputs and limiting what an agent can touch belong alongside it.

Models decide who is speaking from style and structure

Understanding and Mitigating Role Spoofing in LLMs starts from an earlier observation of role confusion, in which models attribute the source of a piece of text from its style rather than from the role it is labeled with. The four authors show how that weakness becomes an attack: malicious text in a tool output, such as a webpage an agent visits, can exploit role confusion to impersonate the user. They call this role spoofing. Studying how models track who said what in a conversation, they find that models use cues from content, such as semantics and writing style, and from structure, such as control tokens and formatting, and that models are highly susceptible to spoofing attacks that fake both at once. The paper does not say whether the providers of the commercial models it tested were notified.

The most consequential result comes from a toy setting. Adversarial training that teaches the model to ignore content-based injections does mitigate content-based attacks, but it leaves the model open to structure-based ones. The authors suggest this can explain why frontier models, which resist many injection attacks better than earlier ones, can still be susceptible to role spoofing. As a mitigation they propose detecting role spoofing with linear probes trained to predict the role of each part of a conversation, and report that the probes are effective across different settings; the paper reports near-perfect separation of clean and spoofed conversations on held-out tests, with probes trained on two open-weight models.

For defenders the point is that a role label in a prompt format is a claim the model weighs against other evidence, not a boundary it enforces. Spoofed structure inside tool output, such as fake control tokens or chat-template formatting, is a distinct attack class, and hardening a model against one class can leave the other open. A probe that reads the model's internal attribution offers a signal that does not depend on what the model chooses to say.

Sanitizing tool output with a query the attacker cannot see

SEAL: Sealed Queries for Local Sanitization against Indirect Prompt Injection addresses local LLM agents, where injected instructions arrive through untrusted tool outputs and a defense has to suppress attacks while keeping the evidence the task needs, on a limited inference budget. SEAL learns a soft prompt and a scoring readout offline and then uses the frozen task model to sanitize tool outputs. Its scoring queries are built from the trusted initial context and the learned prompt, so the reference used to judge a tool output is independent of the text being inspected: the attacker's text cannot shape the query that evaluates it. SEAL scores tokens without normalizing across context tokens and applies preservation regularization so that deletion stays local and useful evidence is kept. It needs neither defense-generated tokens nor a separate verifier model.

On AgentDojo, SEAL reduces attack success from 34.6 percent to 0.1 percent and raises Joint, the rate of task completion without attack success, from 51.4 percent to 77.5 percent, while using about 127 times fewer defense-related tokens than PISanitizer, which the authors describe as a state-of-the-art prompt injection defense. Results on AgentDyn show the same pattern of suppressing attacks while improving task completion under attack, and a replication on a second backbone with the same training recipe supports use across model families. The rise in task completion matters as much as the fall in attack success: deleting only the suspicious tokens, rather than discarding a whole tool output, is what lets the agent finish the task it was given.

Least privilege when the needed assets appear only at run time

REALM: Identifying Minimal Task Assets for LLM Agents begins from a familiar gap: agents often receive access to more files, accounts and services than a task requires, and prompt injection turns that excess access into an opportunity to redirect execution toward unrelated resources. Applying least privilege means identifying the assets a task needs, including assets whose identities emerge only during execution. The approach, whose name stands for Required Execution Assets Linked to a Mission, represents required assets as dependency graph nodes, resolves prerequisite relationships, and admits newly discovered assets through source-scoped selection. It separates discovering an asset from authorizing its use while leaving the agent free to choose how to compute. A builder component maintains the selected grants and projects asset files, and a partial API manager exposes resource-bound partial APIs to the agent inside a task container.

Across 60 clean tasks and 560 injected cases in AgentDyn, the system completes 40.0 percent of clean tasks and 36.4 percent of injected ones, and reduces attack success from 16.6 percent to 0.2 percent with a single base model. The paper reports that cost: without the restriction, the same agent completes 78.3 percent of clean tasks and 71.6 percent of injected ones, so the restriction roughly halves task completion.

Reading the three together

The papers place defenses at three boundaries: attribution inside the model, filtering where tool output enters the context, and authorization where the agent touches resources. Each result argues for the others. The role spoofing study shows that a model trained against one style of injection can still be fooled by another, so the model's own judgment is not a sufficient boundary. SEAL removes injected tokens before the model acts on them, but it works on text that still reaches the model. The asset-graph approach assumes an injection may succeed and limits what a hijacked agent can reach. SEAL and the asset-graph system both report attack success near zero, 0.1 percent on AgentDojo and 0.2 percent on AgentDyn, but they start from different baselines and measure different things, so the two figures are not comparable.

What to do now

For teams deploying tool-using agents, the three results translate into concrete changes to testing and architecture.

Limits

The finding that adversarial training leaves structure-based attacks open comes from a toy setting, and the probes were tested on two open-weight models and, as the authors note, detect only role spoofing, not prompt injections that do not involve it. SEAL trains a soft prompt and readout for a given task model, and its claim to work across model families rests on one additional backbone. The asset-graph evaluation uses one base model, and its restriction cuts clean-task completion from 78.3 percent to 40.0 percent. All three are new preprints without independent replication.

Sources