The simplest defense against prompt injection might also be the strongest. A paper under review at ICLR 2026 from researchers at UC Berkeley, Duke, UCSB, Penn State, NUS, and KACST shows that prompting an off-the-shelf LLM to detect and remove injected commands achieves false positive and false negative rates below 1% on the AgentDojo benchmark. The attack success rate after removal: below 1%.

The paper is PromptArmor (arXiv 2507.15219), led by Tianneng Shi at UC Berkeley with Dawn Song and Neil Gong among the senior authors. It is under review at ICLR 2026. The authors explicitly recommend PromptArmor as "a standard baseline for evaluating new defenses against prompt injection attacks."

That recommendation is the headline. Not just another defense paper. A proposed floor that every future defense should beat before claiming novelty.

The Approach: LLM-as-Detector, Revisited

PromptArmor's core idea is not new. Previous work tried using LLMs to detect prompt injection and concluded it does not work. Liu et al. (2024, 2025) reported that off-the-shelf LLMs cannot be directly prompted to defend against injection attacks. The conventional wisdom settled: LLM-based detection is unreliable.

PromptArmor revisits this conclusion with two changes. First, modern LLMs. The earlier studies relied on older models with weaker instruction-following and reasoning. GPT-4o, GPT-4.1, and o4-mini changed the calculus. Second, a carefully designed system prompt. Naive prompting, just asking "is there an injection in this text?" fails. PromptArmor engineers a detection prompt that gives the guardrail LLM clear context about what legitimate user instructions look like and what injected instructions look like.

The workflow is straightforward:

  1. A user sends a request to an LLM agent.
  2. Before the agent processes the request, PromptArmor sends the input to a guardrail LLM.
  3. The guardrail LLM checks whether the input contains an injected prompt.
  4. If contamination is detected, the guardrail LLM extracts the injected content.
  5. PromptArmor removes the injected text using fuzzy matching (regex that tolerates whitespace and punctuation differences).
  6. The sanitized input goes to the backend LLM for normal processing.

The guardrail LLM and backend LLM can be the same model. They can also be different. This separation is a design advantage: you can use a stronger model for detection and a cheaper model for the agent task, or vice versa.

Why This Works When Earlier Attempts Failed

The paper identifies two reasons prior LLM-based detection failed:

Older models lacked the reasoning capability. GPT-3.5 and earlier models could not reliably distinguish legitimate user instructions from injected ones. They were too easily confused by adversarial phrasing. Modern models with stronger instruction-following can recognize the structural inconsistency: an input that contains two competing sets of instructions, one from the user and one from an external source.

Naive prompting is insufficient. Simply asking "does this contain a prompt injection?" produces poor results. The system prompt matters. PromptArmor's detection prompt provides explicit context about the user's intended task and asks the guardrail LLM to identify instructions that diverge from that intent. This framing gives the LLM a clear decision boundary rather than an open-ended classification task.

The authors tested this claim directly. When they used a naive prompting strategy instead of PromptArmor's designed prompt, defense effectiveness dropped. The prompt design is not cosmetic. It is load-bearing.

The Numbers: Below 1% on AgentDojo

The primary evaluation uses AgentDojo, the standard benchmark for prompt injection attacks against LLM agents. It covers four environments (banking, Slack, travel, workspace) with 97 user tasks and 629 adversarial scenarios.

Results with GPT-4o, GPT-4.1, and o4-mini as guardrail LLMs:

  • False positive rate (FPR): Below 1%. Legitimate inputs are almost never flagged.
  • False negative rate (FNR): Below 1%. Injected prompts are almost always caught.
  • Attack success rate (ASR) after removal: Below 1%. Even when attacks are specifically crafted for the AgentDojo tasks, the defense works.

For context, an undefended GPT-4.1 agent on AgentDojo has an attack success rate of 55%. PromptArmor reduces that to under 1%.

On two additional benchmarks, Open Prompt Injection and TensorTrust, FPR and FNR stay below 5%. These benchmarks include more diverse attack styles than AgentDojo, so the slightly higher rates reflect that broader challenge space.

Adaptive Attacks: Designed to Break It, Still Fail

Adaptive attacks are the gold standard for evaluating defenses. In an adaptive evaluation, the attacker knows exactly how the defense works and crafts attacks specifically to circumvent it. This is far harder than testing against generic attacks.

PromptArmor was tested against adaptive attacks where the attacker knows:

  • The guardrail LLM uses PromptArmor's detection prompt.
  • The exact structure of the defense pipeline.

Even under these conditions, the attack success rate remained low. The guardrail LLM's ability to recognize structural inconsistencies in the input is robust against attacks that try to disguise injection payloads. When an attacker embeds instructions that conflict with the user's stated task, the guardrail LLM can identify the mismatch regardless of how the attacker tries to camouflage it.

This result is significant. Many defenses crumble under adaptive evaluation because the attacker can exploit knowledge of the defense mechanism. PromptArmor's detection is based on recognizing divergent instructions in context, a task that scales with the LLM's reasoning ability rather than relying on specific patterns an attacker can avoid.

Qwen3 Ablation: Bigger and Smarter Is Better

The paper includes an ablation study using Qwen3 models ranging from 0.6B to 32B parameters, with and without reasoning capabilities. Two findings:

Larger models make PromptArmor more effective. The 32B Qwen3 model significantly outperforms the 0.6B model. Detection quality scales with model size.

Reasoning capability helps, especially in mid-range models. Enabling thinking mode (Qwen3's chain-of-thought) improved detection for mid-sized models. The smallest models (0.6B) still struggle even with reasoning enabled, suggesting a floor on model capability for this task.

This has practical implications. You do not need the most expensive model to get good detection. A mid-size model with reasoning can provide meaningful defense. But you need at least a reasonable model size. The 0.6B model is not enough.

How PromptArmor Differs From Existing Defenses

This space has been active. We have covered ClawGuard (runtime enforcement at the tool-call boundary), PlanGuard (isolated planning verification), JBShield (reasoning-time verification), and prompt-shield (detector pipelines). Each takes a different approach to the same problem. How does PromptArmor differ?

ClawGuard intercepts tool calls at runtime and validates them against user-confirmed rules. It is deterministic enforcement at the execution boundary. PromptArmor operates earlier in the pipeline, at the input stage, removing injected content before the agent ever acts. They are complementary. ClawGuard catches what PromptArmor misses; PromptArmor reduces the volume of attacks reaching the runtime layer.

PlanGuard generates a reference action plan from user instructions alone (no external data), then verifies that the agent's actual actions match the reference. It never lets external data influence the planning stage. PromptArmor takes a different approach: it sanitizes the external data so the agent can process it safely. PlanGuard limits what the agent can do. PromptArmor cleans what the agent sees. Again, complementary.

JBShield adds verification during the LLM's reasoning process, checking that intermediate steps align with user intent. It operates during generation, not before it. PromptArmor is a pre-processing defense.

prompt-shield (ProtectAI's open-source package) and similar detection pipelines use fine-tuned classifiers and heuristic scanners. These are pattern-matching systems. PromptArmor relies on the reasoning capability of a general-purpose LLM instead. The advantage: PromptArmor generalizes to novel attack types that pattern-matching detectors have not seen. The disadvantage: it requires an LLM call, which costs more latency and money than a lightweight classifier.

The key differentiator from all of these is not that PromptArmor is better in every dimension. It is that PromptArmor is the simplest defense that actually works. No fine-tuning. No custom training data. No architectural changes to the agent. No human-in-the-loop. You prompt an existing LLM with a designed system prompt. That is the entire mechanism.

Four Design Advantages

The paper articulates four advantages of the LLM-as-detector approach:

Modular deployment. PromptArmor is a standalone preprocessing component. No changes to the agent. No retraining. Drop it into any existing LLM pipeline as a guardrail layer.

Strong generalization. No task-specific training data required. The guardrail LLM's training already covers security concepts, malicious patterns, and instruction-following. Customizable prompts let you adjust sensitivity and focus without retraining.

Computational efficiency. No custom model development or training costs. Smaller LLMs can provide meaningful detection for cost-sensitive deployments. You pay for an API call, not a research project.

Continuous improvement. As base LLMs improve, PromptArmor gets better for free. No retraining. No architecture changes. The defense scales with the underlying model's capability. This is a structural advantage over specialized detection models that receive far less investment.

The Baseline Recommendation

The paper's most important claim is not the <1% numbers. It is the recommendation that PromptArmor should be adopted as "a standard baseline for evaluating new defenses against prompt injection attacks."

This is a methodological contribution. Right now, injection defense papers evaluate against each other in a fragmented landscape. Different papers use different benchmarks, different threat models, and different baselines. The result is a field where every paper claims strong results and no one can compare them directly.

PromptArmor proposes a simple standard: before claiming your defense is effective, show that it beats an off-the-shelf LLM prompted to detect injections. If your fine-tuned classifier, your runtime enforcement, your architectural modification, or your training-based defense cannot outperform a single API call with a well-designed system prompt, you need a stronger justification for its complexity.

This is similar to how random baselines work in classification tasks. You would not publish a sentiment classifier without beating random guessing. PromptArmor argues that LLM-as-detector should be the random baseline for injection defense.

The <1% result makes this a high floor. Any future defense now needs to demonstrate improvement over this bar. That is a meaningful constraint on the field.

A Subtle Point: The Guardrail LLM Is Also Vulnerable

The paper notes an important subtlety. The guardrail LLM itself is vulnerable to prompt injection. An attacker could try to inject instructions that target the guardrail LLM rather than the backend LLM. Yet PromptArmor still works.

The reason: the guardrail LLM is prompted with a clear, narrow task. It is not asked to execute user requests. It is asked to identify instructions that diverge from the stated user task. This narrower role makes it harder to exploit. The guardrail LLM is looking for exactly the kind of manipulation an attacker would attempt, which creates a detection advantage.

That said, the adaptive attack evaluation is the strongest available test of this property. The results show it holds up. But as the authors acknowledge, stronger adaptive attacks may emerge. The defense is robust today, and the field should continue testing it.

What This Means in Practice

For teams building LLM agents today, PromptArmor offers the fastest path to meaningful injection defense. Here is the implementation path:

  1. Choose a guardrail LLM. GPT-4o, GPT-4.1, or o4-mini give the best results. For cost-sensitive deployments, a mid-size Qwen3 model with reasoning enabled provides a reasonable fallback.
  1. Use the designed detection prompt. Do not write your own from scratch. The paper's ablation study shows naive prompts perform significantly worse. The prompt design is the key contribution, not just the idea of using an LLM.
  1. Deploy as a preprocessing layer. Insert the guardrail check between receiving user input and passing it to the agent. No changes to the agent itself.
  1. Combine with runtime enforcement. PromptArmor handles input sanitization. ClawGuard or similar tools handle runtime enforcement at the tool-call boundary. Layer defenses.
  1. Monitor false positive rates in production. The <1% FPR on AgentDojo is strong, but your specific domain may have different characteristics. Track legitimate inputs that get flagged and adjust the detection prompt as needed.

Limitations and Open Questions

The paper is honest about what PromptArmor does not solve:

  • Latency overhead. Every input requires an additional LLM call for detection. This adds latency proportional to the guardrail LLM's response time.
  • Cost overhead. The detection call costs as much as any other LLM API call. For high-volume deployments, this doubles inference costs.
  • Smaller models are weaker. The 0.6B Qwen3 model does not provide reliable detection. Teams that cannot afford frontier models for the guardrail will see reduced effectiveness.
  • Novel attack evolution. The adaptive attacks tested are strong, but future attacks may exploit properties of the guardrail LLM itself. Defense is an arms race.
  • Not a jailbreak defense. PromptArmor targets prompt injection in agents, not jailbreaking of the LLM's safety alignment. These are different threat models.

The Bigger Picture

PromptArmor's significance goes beyond its specific results. It demonstrates that the conventional wisdom about LLM-based detection was wrong. The approach was not fundamentally flawed. It was evaluated with inadequate models and inadequate prompting.

More broadly, it adds evidence to a pattern emerging in 2026: the simplest approach that actually works tends to outperform complex specialized systems. ClawGuard's deterministic rule enforcement, PlanGuard's isolated planning, and PromptArmor's LLM-as-detector all share a design philosophy. Do the simplest thing that addresses the threat model directly. Avoid architectural over-engineering. Make it easy to deploy.

The ICLR 2026 review process will determine whether this becomes an accepted baseline. But the numbers speak clearly. A single LLM call with a well-designed prompt reduces AgentDojo attack success rate from 55% to under 1%. That is the floor. Every new defense starts from here.


Citations:

  • Shi, T., Zhu, K., Wang, Z., Jia, Y., Cai, W., Liang, W., Wang, H., Alzahrani, H., Lu, J., Kawaguchi, K., Alomair, B., Zhao, X., Wang, W.Y., Gong, N., Guo, W., & Song, D. (2025). "PromptArmor: Simple yet Effective Prompt Injection Defenses." arXiv:2507.15219. Under review at ICLR 2026. https://arxiv.org/abs/2507.15219
  • Debenedetti, E., et al. (2024). "AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents." arXiv:2407.01489.
  • Liu, Y., et al. (2024, 2025). "Protecting LLMs from Injection Attacks" (prior work showing LLM-based detection ineffective).
  • Zhao, W., Li, Z., Zhang, P., & Sun, J. (2026). "ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injection." arXiv:2604.11790.
  • PlanGuard: "Defending Agents against Indirect Prompt Injection via Planning-based Consistency Verification." arXiv:2604.10134.

Suggested title: PromptArmor: LLM-as-Detector Cuts Injection ASR Below 1%

Word count: ~2,250

Fact-check notes:

  • arXiv 2507.15219 confirmed. Published July 21, 2025. Under review at ICLR 2026.
  • Authors: 16 authors from UC Berkeley, UC Santa Barbara, Duke University, NUS, KACST, University of Washington.
  • FPR and FNR below 1% on AgentDojo with GPT-4o, GPT-4.1, and o4-mini confirmed from both arXiv abstract and OpenReview.
  • ASR below 1% after removal confirmed.
  • Adaptive attack robustness confirmed.
  • Qwen3 ablation from 0.6B to 32B confirmed.
  • AgentDojo: 4 environments, 97 user tasks, 629 adversarial scenarios confirmed.
  • 55% ASR for undefended GPT-4.1 confirmed from paper text.
  • Prior work (Liu et al. 2024, 2025) showing LLM-based detection ineffective confirmed as cited reference.