NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Preview · 30 min
Master securing AI document ingestion. Learn how attackers hide prompt injections in PDFs and DOCX files, and how to defend with pre-ingestion sanitization.
Document upload is a standard feature: HR portals take PDF resumes, support systems take invoices and screenshots, legal platforms take thousands of pages. Developers often assume uploaded files are passive, harmless "data". They are not.
PDF, DOCX and images (read by OCR) are layered containers. They can hold hidden text, invisible layers, metadata and embedded content. When the ingestion pipeline parses the file, it extracts all text and sends it to the model. The model cannot tell the real content from hidden instructions, so the uploaded file becomes a delivery mechanism for indirect prompt injection. Checking only the file type ("is it a .pdf?") is not enough. All scenarios in this lesson are fictional and for isolated lab use. Embedded instructions are shown only as the placeholder <redacted instruction>.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in