Paper commentary
Notwithstanding Anything to the Contrary, Ignore All Instructions: Measuring Prompt Injection Guards on Legal Contract Review Attacks
Prompt injection guards miss most attacks hidden in legal contracts
- Problem Prompt guards were built for chat, but in contract review the guard scans the very document the system must analyse. Those documents are long and full of directive language, so existing guards struggle.
- Method The authors plant review-directed payloads in real contracts and score eleven guards on paired documents, each compared with its unmodified host.
- Results The best guard, Horizon Labs', reached 0.888 paired AUC on CUAD, while a cascade where Haiku screens chunks and Opus checks the flagged ones reached Opus precision at 6.5 times less cost.
Why contract review breaks guard assumptions
Prompt guards were built for chat, where the untrusted text is not the task itself. In contract review, the counterparty's document is the task input, so the guard sits on the very text the system must analyse. That document is long and dense with directive language, some aimed at human parties and some at AI reviewers.
The authors model a counterparty who plants a payload in the contract to steer the LLM's review output. A natural way to do this is adding a payload statement that implicitly or explicitly instructs the review process. The authors sort review instructions into a taxonomy with manipulation in scope, manipulation out of scope, and benign controls.
Nine payload templates, R1 to R9, represent unauthorized review direction, which is the domain of prompt guards. Three templates represent assertion and claimed authority, which the guards were not built to catch.
The authors feed each contract to the guards in 512-token chunks, and a document is flagged if any chunk scores above a threshold. They use each vendor's shipped default threshold of 0.5, so the guards run at the settings they ship with. Two controls accompany the attacks: length-matched irrelevant boilerplate and a harmless machine-addressed instruction.
The authors scored eleven existing guards and found that no guard is usable for unauthorized legal review instructions. Some guards flag nearly everything, while others, such as the PromptGuard models, flag almost nothing.
Because detector scores on injected documents track the host's score before injection, the authors report paired AUC. Each injected document is compared against its own unmodified host, which isolates the effect of the payload.
How the injected test contracts were built
Each corpus is cut into non-overlapping 512-token chunks, and the chunk size follows each detector's own context window. Horizon Labs and Wolf Defender get 2048-token windows, and Wolf Defender also uses a 64-token overlap, as their vendors recommend. A short final chunk that is a stub under half a window gets its last two chunks rebalanced evenly.
A document is flagged if any of its chunks scores above 0.5, the default each vendor ships with.
Each host contract receives one injected instruction, built from one of fourteen payload templates. Nine of the templates direct the automated reader, while three assert a claimed authority that guards aren't built to catch. Every payload targets one review question about service-level agreements, so the main results rest on a single topic.
The authors score each injected document against its own unmodified host, because detector scores follow the host's pre-injection score. Each corpus gives 60 host contracts, and detection is summarized as paired AUC rather than a single threshold rate.
Two controls are spliced into the same slots: length-matched irrelevant boilerplate and a harmless machine-addressed instruction. The CTRL column reports detection on these control payloads, so a high score can come from editing alone. On that question the in-scope ranking shifts, with three detectors moving 0.13 to 0.40 AUC on the topic change alone.
Guards fail on paired detection and false positives
Paired AUC is the main metric here, because each injected contract is scored against its own unmodified host.
Some guards flag nearly everything, including ProtectAI v2, TestSavant, deepset and DistilBERT. So a newer version can be far worse, and the authors call that a practical reminder. Its paired AUC is 0.493 on CUAD, below chance, so the authors read the zero rate as timidity rather than discrimination.
Horizon Labs' guard, trained on document-borne injections, has the highest paired AUC, at 0.888 on CUAD and 0.898 on the proprietary corpus.
On a second review question about confidentiality, the scope-claim column stays near chance for every detector. Three detectors move 0.13 to 0.40 AUC on the topic swap alone, so a guard chosen for one task doesn't carry over to another.
Why guards react to wording rather than intent
The authors cross intent, addressee, mood, frame and topic to build 504 payload sentences, computed as 6×2×2×3×7. Capitalization is normalized, so sentence case isn't itself a cue, and the machine-addressed benign control is included.
The authors find that almost nothing separates function from surface for most guards. Wolf Defender is the exception, with +27.9 points of separation between attacks and matched-register benign directives. That gain still isn't a deployable level of recall or false positive rate, so it doesn't rescue the guard. Five guards are negative on separation, including Horizon Labs, the highest-AUC detector built for document-borne injections.
Most guards are reasonably invariant to legal register, but they aren't invariant to machine-directed language. Wolf Defender, the only guard that meaningfully separates function, shows the largest wrong-direction effect on addressee.
Mood, shall versus must, moves nothing in most guards. Adding the prompt preamble “Ignore all previous instructions.” hardly moves prompt detectors, except for ProtectAI v2. ProtectAI v2 flags the prompt preamble almost as strongly as the ubiquitous tell “Ignore all instructions”. The contract preamble, “Notwithstanding any other provision hereof,” is the legal register case that most guards ignore.
Narrow recall, length and dilution in prompt guards
Recall concentrates on the suppression intent, so most guards flag one kind of directive. PIGuard flags suppression at 60.7%, while its other four intents sit at 21.4%, 7.1%, 1.8% and 0.0%. ProtectAI v1 is starker, with 28 of its 29 hits across 280 harmful stimuli landing on that one intent. The authors wrote held-out payloads with a frontier LLM that never saw the taxonomy or the registry payloads.
PIGuard and ProtectAI v1 drop sharply on those payloads, which points to keying on registry phrasing rather than on the function.
The authors draw 300 anchors from mid-document positions in their proprietary corpus and score nested prefixes at 24 lengths. The shortest prefix is 2 tokens long, so the sweep covers fragments well below a single sentence. DeepSet and DistilBERT show saturating degeneracy, ramping to ceiling by 16–24 tokens. TestSavant stays flat at every width, and most guards never leave the floor.
A detector can miss an embedded attack because it has no representation of it, or because the surrounding 512-token window dilutes a signal it does have. The authors score the identical payload alone in the window and embedded in its host to tell these cases apart. In the prompt register, every responsive guard but one represents most R1–R4 payloads alone above threshold.
Once embedded in documents, those payloads are flagged as little as 2% of the time, which is a dilution effect. Scope claims show almost no representation, and PG1-86M flags them only as often as the benign control. Horizon Labs' 54% paired flag rate is only 1.5× the rate at which its benign controls are flagged.

Table 3 : Scoring payloads in isolation versus embedded in hosts. The first fraction is how many of that group’s payloads score ≥0.5 (above the threshold) alone in the window, where dilution cannot occur. The second percentage is the share of those payloads’ injected docu- ments (60 hosts per payload) that are flagged, over hosts that themselves score clean. (—) means the detectors flag the unmodified hosts. The CTRL column is the flag rate on the two benign inserts over the same clean hosts. ¶: numbers rest on 4 clean hosts (n=8 and n=3).
Original paper · CC BY 4.0 · Mark Heimann, Katherine Taylor, Bruno Jacob · Notwithstanding Anything to the Contrary, Ignore All Instructions: Measuring Prompt Injection Guards on Legal Contract Review Attacks · Original paper figure · Extracted the figure area from page 6 of the original PDF.Score variance is dominated by the host contract, with up to 97% attributable to which contract was scored. The authors suggest that flag rates track document length and structure rather than the presence of an attack.
Prompted LLMs and the cascade
The LLM detector flags a chunk only when the text targets the review and complying would corrupt the answer. They add a confidence threshold that flags only inputs Haiku is 95% confident about, and a cascade where Haiku's positives are routed to Opus. The cascade is a pipeline in which Haiku screens each chunk and Opus adjudicates the chunks Haiku flags.
The design relies on the frontier model being less prone to false positives than the cheaper model.
Haiku stays above the best guard in the panel, which reaches 0.814 paired AUC. The authors attribute the frontier model's advantage to handling the benign machine-addressed control. Haiku still flags more than 80% of that benign control regardless of corpus. Opus avoids flagging that control, so its false positives stay lower than those of the best guard.
Haiku catches scope claims that the guards cannot detect, with a cheaper model detecting more of them than Opus. The cascade costs 0.02 cents per document over Haiku alone and reaches Opus precision at 6.5 times less cost. Confidence thresholding saves only 0.02 cents per document, and it has 0.53% false positives where the cascade has 0.00%.
Its recall is 84.4% against the cascade's 90.0%, and its benign control rate is 65.0% against 0.0%.
The authors conclude that guards are not a viable deployment solution, while LLMs catch the realistic attack and more classes of attacks. They argue this needs only minimal spend on frontier-level capability, because the cascade keeps most of the frontier performance.
What the limitations leave open
The evidence covers English and US commercial contracts only, so results for other languages or jurisdictions are unknown. Each injected contract targets a single review question, which means the study doesn't measure how payloads behave when several questions compete. ProtectAI v2 flags 60.61% of clean contracts while v1 flags only 0.59%, which shows how a newer version can change behaviour sharply.
The fix for concealment lies in the document pipeline as a preprocessing step, and bare assertions need span-level provenance, which is verification rather than injection detection.
A guard is only one place to intervene, since document ingestion and the reviewer prompt are other options with different costs and failure modes. Because of that host dependence, flag rates may track document length and structure rather than the presence of an attack.
Paper info
- Authors
- Mark Heimann, Katherine Taylor, Bruno Jacob
- Venue
- arXiv · Preprint
- First published
- 2026-11-6
- Added
- 2026-11-9
- Updated
- 2026-11-6
- Version
- v1
- arXiv
- 2611.08834
- Category
- cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Specialized prompt injection guards are deployed in front of document analysis systems, but no false positive rate has been published for any of them on legal contracts. We measure eleven open-weights guards on two corpora of legal contracts and find that existing guards struggle: document-level false positive rates are as high as 92.39%; two guards fall below chance on paired AUC; and a five-regex baseline is not Pareto-dominated by any guard in the panel. Controlled probes locate model-specific as well as general failure modes. Prompted LLMs resolve the tested failures, including a second threat category (unauthorized scope claims) on which every guard scores zero. A cascaded LLM solution, where the positives of a mid-tier model are verified by a frontier model, is 6.5x cheaper than using exclusively a frontier model and approaches its performance.
Quote from the paper
Mark Heimann, Katherine Taylor, Bruno Jacob (2026). Notwithstanding Anything to the Contrary, Ignore All Instructions: Measuring Prompt Injection Guards on Legal Contract Review Attacks. arXiv:2611.08834v1. https://arxiv.org/abs/2611.08834v1
BibTeX
@misc{heimann2026notwithstanding,
title = {{Notwithstanding Anything to the Contrary, Ignore All Instructions: Measuring Prompt Injection Guards on Legal Contract Review Attacks}},
author = {Mark Heimann and Katherine Taylor and Bruno Jacob},
year = {2026},
eprint = {2611.08834},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.08834v1}
}