← Latest papers
💻 computer science

The Defense Trilemma: Why Prompt Injection Defense Wrappers Fail?

This paper proves a "defense trilemma" demonstrating that no continuous, utility-preserving wrapper defense can guarantee complete safety against prompt injections for language models with connected prompt spaces, a theoretical impossibility that has been mechanically verified in Lean 4 and empirically validated across multiple LLMs.

Original authors: Manish Bhatt, Sarthak Munshi, Vineeth Sai Narajala, Idan Habler, Ammar Al-Kahfah, Ken Huang, Blake Gatto

Published 2026-04-09
📖 5 min read🧠 Deep dive

Original authors: Manish Bhatt, Sarthak Munshi, Vineeth Sai Narajala, Idan Habler, Ammar Al-Kahfah, Ken Huang, Blake Gatto

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a very smart, but sometimes mischievous, robot assistant. You want to build a "security guard" (a software wrapper) that stands in front of the robot. The guard's job is to read everything the user says, fix anything that sounds dangerous, and then pass the cleaned-up message to the robot.

The goal is simple: Make sure the robot never does anything bad, without changing what the user actually meant to ask.

This paper argues that this is mathematically impossible if you want your security guard to be smooth, polite, and helpful.

Here is the breakdown of why, using simple analogies.

The Three Rules of the Game

The authors say that to make a perfect security guard, you need three things to happen at the same time:

  1. Smoothness (Continuity): If a user types a sentence that is almost safe, the guard shouldn't suddenly change it into something completely different. Small changes in input should lead to small changes in output. (Think of a gentle slope, not a cliff).
  2. Helpfulness (Utility Preservation): If a user asks a perfectly safe question (like "What's the weather?"), the guard must let it pass through unchanged. You don't want the guard to accidentally ruin a good question.
  3. Perfection (Completeness): The guard must catch every single dangerous request and fix it so the robot never sees anything unsafe.

The Big News: You can have any two of these, but you can never have all three at once. This is called the "Defense Trilemma."

The Analogy: The "Safe Zone" and the "Danger Zone"

Imagine the world of questions is a giant map.

  • The Safe Zone: A green area where all questions are harmless.
  • The Danger Zone: A red area where questions are harmful.
  • The Border: The thin line separating green from red.

The Problem:
The security guard has a rule: "If you are in the Green Zone, I will not touch you."
Because the guard is Smooth, they can't suddenly jump from "I won't touch you" to "I will fix you" right at the edge. They have to be gradual.

So, what happens at the very edge of the Green Zone?
The guard has to stand there and say, "I won't touch you," because you are technically still in the Green Zone. But, because you are on the edge, you are also dangerously close to the Red Zone.

The Result:
There will always be some questions that are just barely on the border. The guard sees them as "safe" (because of the Helpfulness rule) and lets them pass. But because the guard is Smooth, they can't nudge these borderline questions far enough away from the danger to make them truly safe.

The guard gets stuck. They let a dangerous question through because they are too polite to change it, and too smooth to make a sudden jump to fix it.

The Three Levels of Failure

The paper proves this failure happens in three escalating ways:

  1. The "Stuck at the Edge" Problem:
    The guard must leave at least one specific "borderline" question completely untouched. It's like a guard who refuses to move a person standing exactly on the property line, even if that person is about to step onto the neighbor's lawn.

  2. The "Fuzzy Zone" Problem:
    Because the guard is smooth, they can't just fix the one stuck question. They have to be gentle with everyone near that stuck question too. This creates a "fuzzy band" of questions that are slightly dangerous but the guard is too gentle to fix properly.

  3. The "Runaway" Problem:
    Imagine the "danger" gets steeper and steeper as you move away from the safe zone (like a cliff). The guard tries to pull the user back, but the cliff is too steep. No matter how hard the guard pulls, there is a whole chunk of the map where the user falls off the cliff anyway. The guard simply cannot pull them back fast enough without breaking the "Smoothness" or "Helpfulness" rules.

What About Discrete Defenses? (The "Hard Block" Analogy)

You might ask, "What if the guard isn't smooth? What if they just say 'NO' to anything suspicious?"
The paper says: If you make the guard not smooth (e.g., they suddenly block a question that is 99% safe), you break the Helpfulness rule. You start blocking good questions by mistake.
Alternatively, if you want to be perfect and smooth, you have to accept that you will miss some bad questions.

So, Is Defense Useless?

No! The paper isn't saying "give up." It's saying "stop trying to build a magic shield that does everything."

Instead, the authors suggest a new strategy:

  • Make the border shallow: Instead of trying to block every bad question, make the "danger" less severe. If the robot slips up on a borderline question, maybe it just gives a polite refusal instead of a harmful answer.
  • Simplify the map: Reduce the number of ways people can ask questions (lower the complexity). It's easier to guard a small garden than a whole forest.
  • Watch the border: Since you can't stop everything, put a camera on the border. If someone gets too close to the edge, a human or a different system can step in.

The Bottom Line

You cannot build a software wrapper that is smooth, doesn't mess up good questions, and catches every bad question all at the same time. You have to choose which two you want, and accept that the third one will have to be compromised. The goal of security engineering is to manage this trade-off, not to wish it away.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →