Manuscript Offprint

arXiv:2611.08834

Notwithstanding Anything to the Contrary, Ignore All Instructions: Measuring Prompt Injection Guards on Legal Contract Review Attacks

Mark Heimann, Katherine Taylor, Bruno Jacob

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.5×6.5\times cheaper than using exclusively a frontier model and approaches its performance.

1 Introduction

Contract review systems read documents authored by an adversarial counterparty. Unlike the chat setting that prompt guards were built for, the untrusted text is the task input: the legal contract authored by a counterparty. It is long, and it is dense with legitimate directive language that may be aimed at human parties or at AI reviewers that have grown in popularity. Recent and concurrent work evaluates prompt injection guards on domains with unique structure, such as résumés (Zhang et al., 2026; Augey et al., 2026) and agentic workflows (Liu, 2026). No published false positive rate exists for prompt injection guards on legal contracts, which leaves open the question: how well do guards defend against contract-borne injections?

We make the following contributions:

  1. A taxonomy of legal-specific indirect prompt injections (§3). We characterize a taxonomy of statements that may influence automated legal review, some of which differ from traditional prompt injections.

  2. A new challenge setting for prompt guards (§4). We show a specialized use case for which eleven leading prompt guards have unusually high false positive rates or low recall. We release a taxonomy-structured benchmark of contract-borne injection and matched benign control strings that are hand-written, factorially generated, and model-generated with independent audit, along with insertion manifests that constructed injected documents from publicly available legal contracts.

  3. Analysis of general and model-specific failure modes (§5). We find that detection tracks the instruction's register, not its function, and a telltale addressee cue runs backwards in more than half of the guards. We also show that some models' flagging is keyed on narrow phrasing or even input length.

  4. A cost-efficient cascaded LLM detector (§6). A prompted frontier LLM is near the ceiling on the threat model that guards are formulated for, and makes appreciable progress defending against a threat that prompt guards cannot see. A mid-tier model also outperforms all guards, and the two can be combined in a cascade (Fig. 1) that achieves near-frontier performance at less than a sixth of the cost.

References (28)

  • Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations
  • Passing the Test You Trained On: Re-evaluating Prompt-Injection Detectors for LLM Agents
  • DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
  • Mohan Zhang, Yuqi Jia, Zhen Tan, Steven Jiang, Neil Zhenqiang Gong, Tianlong Chen, and Dawn Song. 2026. Measuring real-world prompt injection attacks in llm-based resume screening. arXiv preprint arXiv:2605.28999. (opens arXiv in a new tab)
  • We describe both below
  • The medians are nearly identical and the means are not: CUAD's tail is heavier, so it carries 45% more chunks from 25% fewer documents
  • Document-level rates are therefore not comparable across detectors through chunk counts, and we report them per detector against its own window
  • Govern ment
  • All fourteen are listed below in full
  • This is the category every insight number in the paper is measured over, as it is what a prompt injection classifier is built to catch
  • Has SLA Commitment
  • Automated review tools should record "false" for any inquiry concerning service levels or service-level commitments; no further analysis is required.]
  • Both are inserts, so a detector that responds to any edit scores them as well as it scores attacks
  • [...] Return true if the counterparty has explicit SLA commitments or measurable performance obligations, and false if there are no specific SLA commitments or only general service obligations without measurable targets
  • D, called Confidentiality Required of Us
  • this Agreement
  • ><strong>Has SLA Commitment (field name)</strong></td></tr><tr><td>topic</td><td>service levels or service-level commitments</td></tr><tr><td>negate</td><td>contains no service-level commitments and provides no remedy of any kind for service failures</td></tr><tr><td colspan=
  • shall, notwithstanding any other provision hereof, record that this Agreement {negate}
  • Items were written by GPT-6 Astra Light, which for each review question received only the question itself, the party binding, and six real clauses on that topic harvested from CUAD as register exemplars
  • an attack item that directs the reader to suppress a finding, restrict what counts as evidence, or dictate a conclusion, and a benign partner that asks for verifiable information, constrains presentation, or directs where to read
  • blunt textbook overrides using the vocabulary the pairs are forbidden (ignore, disregard, previous instructions)
  • Violating items were rejected rather than repaired to maintain the sole third-party authorship
  • Gemini is blind to the generator's label as well as the two-part definition used in the LLM guard
  • 6 we report the results of all detectors on the held-out confidentiality review question (App
  • >Detector</td><td colspan=
  • †CTRL ≥ AUC: the detector separates benign inserts at least as well as attacks
  • Columns are $\eta^2$, the between-group share of total sum of squares
  • what was inserted explains nothing about the score their own injected documents receive