Glossary · Prompt Injection & AI Security

Document Prompt Injection

Document prompt injection is a form of indirect prompt injection in which the malicious instruction is carried inside a file such as a PDF, Word document or scan.

What Is Document Prompt Injection?

When an AI tool extracts text from a file, it reads everything in the file's text layer, not only what a person sees on the page. A document can therefore carry commands that are invisible to the reader. Academic research has shown the risk in CV screening, where hidden text can mislead the HR manager who relies on an LLM to compare candidates.

The main techniques are hidden text, Metadata and annotations, zero-width characters, text inside images and plainly visible instructions.

How Document Prompt Injection Works

A parser, OCR service or connector converts the file to text. The extracted text, including anything hidden, is combined with the user's request and sent to the model. The model cannot tell the document's facts from its embedded commands.

The defense is to compare two views of the same file: what a machine extracts, and what a person sees when the page is rendered. Differences are suspicious.

Practical Industrial Use

Vendor proposals, CVs, claims files, discharge summaries, contracts and invoices all arrive from outside the organization and are increasingly read by AI before a person.

What Happens Without It

Without document-level checks, a single hostile file can steer summaries, rankings and agent actions.

Traditional file scanners look for malware, and a text-only injection is not malware.

Risk Without Protection From Document Prompt Injection A document can say one thing to your team and another to your AI.

With Protection Against Document Prompt Injection

  • Machine text compared with rendered page
  • Findings located by page and type
  • Flagged files held for review
  • Sensitive data anonymized

Without It

  • Extracted text trusted blindly
  • Hidden commands unseen
  • Agents act on poisoned files
  • No evidence of what was checked

Documents should be treated as untrusted input even when they come from known senders.

How This Relates to Questa AI

Questa Blackbox's Visual Injection Check does this comparison for PDFs, reporting findings such as hidden text on a page, a tiny font, text outside the page area, invisible Unicode, metadata and annotation instructions, and text inside images.

Questa Blackbox is a privacy firewall that sits between your documents, data and AI models. It is available as a SaaS service and as an on-premises deployment, and in both the principle is the same: content is inspected before it reaches a model, not after something has gone wrong. Sensitive entities are anonymized, and PDF files go through the Visual Injection Check, which compares what a machine extracts from a file with what a person sees once the page is rendered.

Each file receives one of three verdicts, no findings, review or block, shown per file in the File Tool and across all files in the Visual Injections dashboard, with the finding type and location (for example "Page 1, tiny font"). Security teams can use these verdicts to hold flagged files before they are handed to a model or an agent. Two honest limits apply. The check reports findings; it does not itself stop file handoff, so the verdict needs to drive your workflow. And "no findings" means nothing was found, not that a file is guaranteed safe. Files that are too large, too long, unreadable or not checked to completion are never counted as clean.

Because Blackbox also anonymizes personal and sensitive data at each step, a missed injection has far less to steal: names, identifiers and other protected entities have already been replaced with tokens before the model sees them. With the on-premises option, files, findings and audit records stay inside your own network boundary; with SaaS, you get the same inspection without running infrastructure. Layered with least-privilege agent permissions and human review, this reduces the risk to your network, data, cyber security and AI agents. It does not claim to eliminate it, and no single control can.

Frequently asked questions

See Document Prompt Injection in practice

Questa AI anonymizes sensitive data before it reaches any AI model — across documents and live prompts, with governance and data-residency control.

Contact

Contact Us

Have questions or ready to explore how Questa AI can transform your business?