The Mirror Design Pattern: Strict Data Geometry over Model Scale for Prompt Injection Detection
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Prompt injection defenses are often framed as semantic understanding problems and delegated to increasingly large neural detectors. For the first screening layer, however, the requirements are different: the detector runs on every request and therefore must be fast, deterministic, non-promptable, and auditable. We introduce Mirror, a data-curation design pattern that organizes prompt injection corpora into matched positive and negative cells so that a classifier learns control-plane attack mechanics rather than incidental corpus shortcuts. Using 5,000 strictly curated open-source samples -- the largest corpus supportable under our public-data validity contract -- we define a 32-cell mirror topology, fill 31 of those cells with public data, train a sparse character n-gram linear SVM, compile its weights into a static Rust artifact, and obtain 95.97% recall and 92.07% F1 on a 524-case holdout at sub-millisecond latency with no external model runtime dependencies. On the same holdout, our next line of defense, a 22-million-parameter Prompt Guard~2 model reaches 44.35% recall and 59.14% F1 at 49,ms median and 324,ms p95 latency. Linear models still leave residual semantic ambiguities such as use-versus-mention for later pipeline layers, but within that scope our results show that for L1 prompt injection screening, strict data geometry can matter more than model scale.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 6 of its 9 references that are in the map. First posted on arXiv 12 Mar 2026.
Builds on
6 of 9 references.
References · 6
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
- 2019Learning the Difference that Makes a Difference with Counterfactually-Augmented Datacited by 439
- 2021Identifying and Mitigating Spurious Correlations for Improving Robustness in NLP Modelscited by 76
- 2020Explaining The Efficacy of Counterfactually Augmented Datacited by 65
- 2022A Comparison of SVM against Pre-trained Language Models (PLMs) for Text Classification Taskscited by 7
- 2025Do You Really Need a GPU to Guard Your LLM? CPU-Class Classifiers and Multi-Stage Pipelines for Safety Enforcement at Scalecited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025PromptShield: Deployable Detection for Prompt Injection Attacks
- 2026BASIS: Breach-Aware Selective Prompt Injection Shielding with Prefill Attention Probes
- 2025CAPTURE: Context-Aware Prompt Injection Testing and Robustness Enhancement
- 2026Prompt Injection Detection is Regime-Dependent: A Deployment-Aware Evaluation with Interpretable Structural Signals
- 2025Neural Antidote: Class-Wise Prompt Tuning for Purifying Backdoors in CLIP
- 2026The Latent Diagnostic Taxonomy: A Framework for Constructing Classifiers and Diagnosing Their Decisions, Applied to Prompt Injection Detection
- 2026Decoding Guardrails: XAI-Guided Perturbation Analysis of Prompt Injection Detection
- 2025Defending Against Prompt Injection with DataFilter