# Can a guardrail stop prompt injection?

A guardrail can lower how often prompt injection works, but it can't be trusted to stop it. In "The Attacker Moves Second" ([arXiv:2510.09023](https://arxiv.org/abs/2510.09023)), 14 researchers including Nasr, Carlini, and Tramèr bypassed 12 recent jailbreak and prompt-injection defenses with adaptive attacks, using gradient descent, reinforcement learning, random search, and human-guided exploration. Attack success exceeded 90% for most of them, and most of those defenses had reported near-zero success against static attack strings.

The reason is that a guardrail that reads text is judging the same kind of input the attacker writes. An attacker who can see how it responds can keep rewording until a phrasing gets through.

A check on the action holds up better, because it doesn't depend on recognizing the attack. Block a refund above a limit, a file read outside an allowed folder, or an email to an unlisted address, whatever the prompt said. Treat [retrieved text as untrusted](/answers/failure-modes/can-retrieved-content-override-an-agents-instructions) and cap what the agent can do with it.

The paper tests defenses against adaptive attackers. A guardrail nobody has attacked that way has no measured failure rate.

---

Published: 2026-11-24

Sources:
- Nasr et al.: The Attacker Moves Second (arXiv:2510.09023): https://arxiv.org/abs/2510.09023 (fetched 2026-11-24)

Source: https://tessary.ai/answers/agent-guardrails/can-a-guardrail-stop-prompt-injection
More on Agent guardrails: https://tessary.ai/answers/agent-guardrails
From Tessary, agent reliability for AI agents in production: https://tessary.ai
