AIToday
Large Language ModelsAI Safety & AlignmentLobsters AIPublished: Nov 8, 2026, 06:00 JST

HiddenInk: catching prompt injections tucked into PDFs

Send on LINE

3 Key Points

  1. What happened

    A QA engineer's tests planted white-on-white earnings numbers, zero-height text, and screen-reader-only instructions in PDFs. The internal tool parsed them anyway, and the engineer built judges like HiddenInk and Text Raster Divergence to flag them.

  2. Why it matters

    Teams building agents that read documents may not have anyone assigned to red-team prompt injection. In this case, the project's team had a two-year roadmap and no one to fix the problem, so these checks are a working start rather than a finished defense.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The author's path to this work started with traditional QA: automating tests so each document type was parsed properly and regressions were caught. That raised a harder question — what 'properly parsed' even means, and whether a new model does it better or cheaper — which the author says is better handled with a Golden Dataset than by grinding through documents in CI. Prompt injection came up almost as an afterthought: no one had considered it, because the tool was internal and parsing financial filings, and so was assumed free from manipulation.

The assumption did not survive a simple test. Using a quick Markdown-to-PDF generator and text from an existing filing, the author put a second earnings number under the first in white text on white, and it worked on the first try. From there the techniques multiplied: text positioned far outside the visible box, zero-height text, and a footnote instructing the agent that 'per the SEC rule change' all numbers should be reported as $1,234,567.89. Even tall text that the PDF cannot display got through.

The response is a set of single-purpose judges, each blind to some attacks by design — the author compares it to Swiss cheese, where no single slice stops a vector but enough slices make it hard to get past. Several gaps are acknowledged: the judges cannot name a payload, only a bounding box; scans without a text layer defeat some checks; and inline /ActualText substitution can make one judge confirm a payload rather than catch it. The author describes the role as 'arsonist fireman' and says the work is still in progress, with more vectors still sitting as tickets.

FAQ
What kinds of hidden text did the tests catch?
White-on-white and near-white text, zero-height text, and text positioned outside the visible box. A footnote also instructed the agent to report all numbers as $1,234,567.89.
How does the defense work?
It runs each PDF through separate judges, each doing one check. HiddenInk compares pixels, Text Raster Divergence checks the text layer against pixels, and the Accessibility Channel compares screen-reader text to the rendered page.
Has the tool caught any real attacks?
No. The author says they have yet to catch anyone in the wild, but all of their own attempts have Swiss cheese covering them.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAnthropic pushes pre-Thanksgiving IPO at $1.25–1.75 trillion