CoChat

PhantomLint: Principled Detection of Hidden LLM Prompts in Structured Documents

Open access
Murray, Toby · 2025 · arXiv

The DOI matches its DataCite record; 25 of the 25 references it cites were found in a registry or an index; none of the 23 sources its claims cite is checked for support yet.

Abstract

Hidden LLM prompts have appeared in online documents with increasing frequency. Their goal is to trigger indirect prompt injection attacks while remaining undetected from human oversight, to manipulate LLM-powered automated document processing systems, against applications as diverse as résumé screeners through to academic peer review processes. Detecting hidden LLM prompts is therefore important for ensuring trust in AI-assisted human decision making. This paper presents the first principled approach to hidden LLM prompt detection in structured documents. We implement our approach in a prototype tool called PhantomLint. We evaluate PhantomLint against a corpus of 3,402 documents, including both PDF and HTML documents, and covering academic paper preprints, CVs, theses and more. We find that our approach is generally applicable against a wide range of methods for hiding LLM prompts from visual inspection, has a very low false positive rate (approx. 0.092%), is practically useful for detecting hidden LLM prompts in real documents, while achieving acceptable performance.

Overview

CoChat Summary

TL;DR

PhantomLint is a prototype tool for detecting hidden LLM prompts in structured documents by comparing extracted text with OCR of the corresponding rendered region. It is evaluated on 3,402 documents and reports broad applicability, a false positive rate of approx. 0.092%, practical utility on real documents, and acceptable performance.

Key findings

  • PhantomLint detected hidden LLM prompts in all 26 synthetic documents (16 PDF, 10 HTML) covering hiding methods including matching background, invisible content, tiny text, obscured text, offpage text, zero-area clipping, zero-opacity text, malicious fonts, and hidden-visibility content (HTML only).
  • On 3,257 ICML 2025 accepted PDFs, PhantomLint flagged three papers, all false positives; the paper reports a false positive rate of approximately 3/3,257 ≈ 0.092%. Causes included OCR failures adjacent to prompt-like fragments, non-English alphabetic characters, and text intentionally rendered in a very small font.
  • On 119 real-world documents (113 positive, 6 negative; 93 PDF, 26 HTML), PhantomLint identified no hidden suspicious phrases among the negative documents and successfully identified the hidden LLM prompt in each positive document, meaning at least one identified region overlapped with the actual hidden prompt.
  • Performance: average running time was 68.25 seconds per paper across the 3,257 ICML 2025 PDFs and 43.75 seconds per document across the 119 real-world HTML/PDF documents, which the paper calls acceptable.

Methods

  • Design: the OCR Consistency Test (Algorithm 1) computes the minimal region for a text block, renders an image of that region, applies OCR, and diffs the original text against the OCR text; hidden text is the difference. Algorithm 2 applies this test only to text blocks deemed suspicious by an ANALYZE procedure and returns the intersection of suspicious spans and hidden spans.
  • Implementation: PhantomLint is a Python prototype supporting PDF and HTML. HTML uses DOM text nodes, Playwright rendering, and bounding-box crops; PDF uses PyMuPDF text blocks and pikepdf to remove CropBox, enlarge MediaBox, and make OCGs visible. Default ANALYZE uses all-MiniLM-L6-v2 Sentence Transformers against a bad phrases list with a sliding window; LLM-Guard is an alternative. DIFFERENCE merges words absent from OCR; Tesseract OCR is used with Gaussian blur for low-contrast regions.
  • Evaluation: synthetic documents tested hiding-method generality; 3,257 ICML 2025 accepted PDFs tested false positives; 119 curated real-world documents (113 positive, 6 negative) tested practical utility; running times were analyzed across RQ2 and RQ3. Documents were manually analyzed in MacOS Preview version 11.0 to classify positives and negatives.

Limitations

  • Paper-stated: PhantomLint may fail to identify all of a hidden LLM prompt due to its diffing implementation, and may highlight non-hidden non-words adjacent to the hidden prompt (such as punctuation or numbers) because these are ignored during hidden text span identification. False positives in RQ2 were caused by OCR failures, including over non-English alphabetic characters and very small font.
  • Paper-stated: the current implementation handles PDF and HTML; other formats like Word can be supported by first converting to PDF. Algorithm 2 leaves undefined what constitutes a text block. The default ANALYZE uses a fixed bad phrases list, and the LLM-Guard alternative was found less accurate in practice.
  • Evident from the text: generality is evaluated on synthetic documents, and the real-world utility corpus was collected via Google searches and manual verification rather than a random or exhaustive sample; no comparison against other hidden-prompt detectors is reported. The OCR-based approach may be sensitive to rendering and OCR quality, as suggested by the reported false positives.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2508.17884

Cites

25 of 25 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

0 Valid · 4 Not valid · 18 Not checked · 39 Own results and interpretations

26 more claims

Create a free account to see all 61 claims and every source verdict.

See all claims — free account
  • Probably not a substantial claim. 26
  • It may state two separate claims as one. 6

Create a free account to see these claims.

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

4 of 4

Citations

Cites

Show all 25 references

Research works printed but not linked: 2

  1. Michael R Clarkson and Fred B Schneider. Hyperprop- erties. Journal of Computer Security, 18(6):1157-1210, 2010.
  2. ICML 2025 Organizers. Publication ethics. Avail- able online: https://icml.cc/Conferences/2025/ PublicationEthics, July 2025.

Cited by

See all 10

Metadata

Authors
Murray, T.
Affiliations
The University of Melbourne (AU)
Corresponding author
Murray, Toby
Venue
arXiv
Publisher
arXiv
Published
2025
ISSN
2331-8422 (ISSN-L)
OpenAlex
W7077859005
Cited by
10
References
19
Citations by year
2026: 9 · 2025: 1
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
  • Physical Sciences › Computer Science › Information Systems › Spam and Phishing Detection
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Digital Media Forensic Detection
Keywords
prompt injection, structured documents, PDF documents, HTML documents, AI-assisted decision-making, document integrity, academic peer review, resume screening

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

A language model drew the claims from the paper on 2026-11-20, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-11-20 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: PhantomLint: Principled Detection of Hidden LLM Prompts in Structured Documents. https://app.cochat.ai/papers/10.48550/arxiv.2508.17884
The paper
Murray, T. (2025). PhantomLint: Principled Detection of Hidden LLM Prompts in Structured Documents. arXiv. https://doi.org/10.48550/arxiv.2508.17884

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.