Prompt injection classifiers are terrible security boundaries A developer's blog post demonstrates that a 323M-parameter prompt-injection classifier called Smolaya-guard, which scores 0.9998 AUC and catches 99.7% of injections at a 1% false positive rate, can be defeated by appending a short GCG-optimized token suffix that pushes its margin below the threshold of -3.18. The attack, which requires only gradient access to open weights, was run against Smolaya-guard, protectai/deberta-v3-base-prompt-injection-v2, and nvidia/Nemotron-3.5-Content-Safety, showing that classifier-based prompt injection defenses are not reliable security boundaries. Everyone’s advice for prompt injection is the same: stick a classifier in front of the model. A small cheap model reads the incoming text, decides is this an injection or not , and throws it away before it ever reaches your expensive LLM. So using the recent trend of Laya/Jev models, a recent small non-autoregressive model that just scores an answer in one forward pass instead of generating tokens, I’ve built a pretty good prompt injection classifier using my smaller, better calibrated version of Laya https://huggingface.co/convaiinnovations/laya called Smolaya https://huggingface.co/anon767tom/smolaya . I fine-tuned Smolaya on a pile of public prompt-injection datasets. Smolaya-guard https://huggingface.co/anon767tom/smolaya-guard , is 323M, runs on a CPU, and on a held-out test set it gets 0.9998 AUC and catches 99.7% of injections at a 1% false positive rate . As a filter that is about as good as it gets. But in this blog post I demonstrate how easy it is to break any mdetection model. Every injection it flags, every decision, can be turned into “benign”, using a handful of gradient descent steps. What is a prompt injection detector what-is-a-prompt-injection-detector A detector takes a prompt $x$ and spits out a number. The margin: $$m = f x = z {\text{injection}} - z {\text{benign}}$$ It calls something an injection when $m$ is above a threshold $\tau$ that you set to control false positives. For Smolaya-guard , pinning the false positive rate to 1% puts that threshold at $\tau = -3.18$, and real injections land way above it, around $m = +7$ to $+9$. The attack the-attack Lets say an attacker wants to inject a prompt into a model without getting detected. The attacker can modify the prompt injection $x$ and glueing a short suffix of $n$ tokens from the vocabulary $V$ onto the end: $s = s {1}, \ldots, s {n} $. The detecting model will see the prompt injection and the suffix. All the attacker wants is that the detectors smallest margin becomes: $$s^{ } = \arg\min {s}\ f x || s $$ Optimise the suffix such that $m$ lands under $\tau$ and the detector waves the whole thing through as benign, while $x$ still does whatever it was going to do to the model behind it. The annoying part is that tokens are discrete, so you can’t just do gradient descent on them. Greedy Coordinate Gradient GCG