# Guided Lab: Injecting a Chatbot via a Malicious Document

> A hands-on lab demonstrating how to weaponize document uploads to perform indirect prompt injection against an enterprise RAG chatbot.

Canonical: https://codelivly.com/rooms/guided-lab-injecting-a-chatbot-via-a-malicious-document
Last updated: 2026-10-08

| | |
|---|---|
| Level | Intermediate |
| Category | Cybersecurity |
| Lessons | 3 |
| Estimated time | 30 min |
| XP | 100 |

This guided lab provides a practical, step-by-step walkthrough of executing an indirect prompt injection attack via a malicious document. You will learn how to craft a poisoned PDF, bypass naive ingestion pipelines, and trigger the payload through a legitimate user query. The lab concludes with implementing and verifying robust architectural remediations, including pre-ingestion sanitization and output guardrails.

## Lessons

1. Lab Setup and Target Overview: The DocuQuery AI Environment (30 min)
2. Crafting the Malicious Document Payload (30 min)
3. Executing and Verifying the Injection (30 min)

## Related

- [Learning path: Prompt Injection Fundamentals](https://codelivly.com/learning-paths/prompt-injection-fundamentals)
- [All rooms](https://codelivly.com/rooms)
