Security, Governance and PlatformTenant and data boundariesStaff
How can visually covered PDF text leak through retrieval, and how should ingestion verify real redaction?
By Amit Kumar2 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A PDF displays black rectangles over private account numbers, yet a retrieval parser extracts and quotes them. Distinguish overlays from removal, inspect the exact uploaded text/layers and derivative copies and design sanitized-source activation. Explain the limitations of prompting or rasterization without claiming OCR reads through a flattened black bar.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
A legal team opens a PDF and sees black rectangles over names and account numbers. They upload it to the knowledge base. A user later asks a general question and the assistant quotes a covered account number. The first thing to check is whether the PDF was actually redacted or merely painted over.
PDFs can contain text objects, images, annotations and other layers. A black shape drawn on top of a text object changes what a viewer displays, but the underlying text can remain in the file for selection, search or extraction. A text-first RAG parser may recover it without doing OCR at all. The PDF Association warns that covering information with a black bar is not permanent removal. Adobe's redaction guidance distinguishes a proper redaction and sanitization workflow that removes visible and hidden content.
The trust boundary is ingestion, not the model's final wording. Test the exact uploaded bytes with the same extractor the pipeline uses, and also inspect attachments, metadata, annotations and alternate text representations. If restricted content survives extraction, do not index or embed that file for broad access. Delete affected index entries and cached chunks, then rebuild from an approved, properly sanitized source revision. Check whether generated summaries or downstream exports already copied the text elsewhere.
Simply telling the model “do not reveal redacted text” cannot undo the fact that the text entered retrieval. Rasterizing the visually blacked-out page can remove selectable text from that particular output, but it is a workaround with risks: image layers, metadata, attachments and source revision handling still need checking. A validated redaction process with extraction-based verification is safer. For sensitive uploads, run a pre-ingestion check that searches for known redacted spans when available and flags suspicious overlays or incomplete redaction annotations for review.
An interviewer may say that OCR cannot see through a black bar. That is true for OCR on the flattened visible image. The leak here comes from the PDF's retained text objects or hidden content, which a different extraction path can read. The same document can be visually safe to a person and unsafe to a machine reader.
Related questions
Keep practising security, governance and platform
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux