# Piling on prompt injection defences often stops AI agents doing their real work

A preprint tests 66 combinations of published defences for tool-using AI agents. Deeper stacks often stopped attacks by stopping the agent's real work, and the authors propose 11 rules to repair the handoffs between defences.

- Category: Safety & evaluation
- Readiness level: III (Open source) on Science Underway's four-step scale, as proposed
- Published: 2026-12-02
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/piling-on-prompt-injection-defences-often-stops-ai-agents-doing-their-real-work

## The study

DefenseComposer: Knowledge-Guided Defense Stacking Against Indirect Prompt Injection (preprint, not peer reviewed). arXiv 2611.37071. https://arxiv.org/abs/2611.37071

## At a glance

- What it shows: Piling several security checks onto an AI assistant does not reliably make it safer. Often it stops the assistant doing its job. A light pair of defences blocked almost as many attacks as a heavy stack of four, and completed about fifteen times more normal tasks.
- What it does not show: It does not show that any combination is safe against a determined attacker: tailored attacks got through every stack tested. All tests ran in simulated environments, not in live products.
- Why it matters: Security guidance and real products already layer defences on AI agents. A low attack success rate can hide a system that has quietly stopped working, so buyers and builders need to measure both.

## What the study shows

The study looks at indirect prompt injection. This is when malicious instructions are hidden in a web page, email or file that an AI agent reads while doing a task. The agent may then follow the attacker instead of the user. Many defences exist, but each has usually been tested alone.

The authors, from Huazhong University of Science and Technology and The Hong Kong Polytechnic University, wrapped 13 published defences in one test harness. Some rewrite or mark untrusted text. Some limit which tools the agent may use. Some check each proposed action, and some clean the content tools return. They tested 66 ordered combinations on AgentDojo, a public benchmark of banking, travel, workspace and Slack tasks, using Google's Gemini-2.5-Flash. The full study covers about 26,000 agent runs. It is a preprint and has not been peer reviewed.

The authors report that more layers did not buy more safety. A two-defence pair, Delimiters plus ToolFilter, let 0.4% of attacks through and completed 77.5% of normal tasks. It also used fewer tokens than the undefended agent. A four-defence stack let no fixed attacks through, but completed only 5% of normal tasks. The undefended agent completed 80%.

Against attacks written for each stack's exact defence order, the light pair and the four-defence stack both let 8% of attacks through. An automated attacker found at least one bypass for every stack it tried, within five attempts per task.

The authors examined the 38 normal tasks the four-defence stack failed. In 30 of them, no single defence caused the failure. It appeared only when defences ran together. They group these into three patterns. One defence strips or rewrites information a later one needs. Defences run in an order that clashes. Or a defence changes more than it should, such as a file ID. In one example, a defence that tags untrusted text turned file ID "3" into a tagged string, and the file tool then reported that the file did not exist.

Fixing the handoffs by hand raised the four-defence stack's normal task completion from 5% to 35%, with no successful fixed attacks. The authors then wrote ten rules from these fixes, added one rule for choosing stacks, and gave all 11 to OpenAI's Codex coding agent as a reusable skill. On six two-defence stacks not used to write the rules, rule-guided repairs completed about 15 percentage points more tasks under attack than repairs made from source code alone.

## Our reading

In our reading, the most useful result is not the rules but the measurement warning. A defence stack that blocks every attack by blocking almost every task looks perfect on the usual headline metric, attack success rate. This study shows that happening, with traces that explain why. Any security score for an agent should come with a task completion score measured on the same runs.

The second lesson is that order and interfaces matter as much as the choice of defences. Several failures were small and mechanical: a tag that pushed short names over a length threshold, a cleaner that deleted boundary markers another defence had added, a paraphraser that changed a message the user wanted sent word for word. These are the kind of bugs integration testing usually catches. They are easy to miss here because each defence works fine on its own.

A concrete case: a company that wraps its email assistant in a paraphraser and an action checker may find that requests to send exact wording quietly fail. Attack metrics would still look excellent. The fix the authors suggest is simple: keep the user's original request available to every later check.

The rest of the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/piling-on-prompt-injection-defences-often-stops-ai-agents-doing-their-real-work

## How this was made

An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
