Guided security lab
Direct vs Indirect Prompt Injection
A guided conceptual exercise: classify prompt injection by the origin and delivery path of the competing instruction, then judge impact separately from the stated architecture.
This exercise uses authored, deterministic examples and neutral placeholders instead of real attack text. It is not a live LLM and does not predict how any real model behaves.
Learning objectives
- Classify a scenario as direct or indirect by where the competing instruction came from and how it reached the model, not by how dramatic it sounds.
- Recognize that indirect injection can come from content the user never wrote: web pages, email, documents, retrieval results or tool output.
- Separate the instruction-control question from the security impact question.
- Explain why external content stays variable, untrusted data even when a trusted application component fetched it.
Prerequisites
- What Is Prompt Injection? (recommended)
- Basic familiarity with AI assistants
Source and delivery path
Follow the path from left to right. Application components are marked as system; content moving along the path is marked as variable.
- Customer messageVariable content->
- Support applicationSystem component->
- ModelSystem component
What reaches model-visible context
- Application instructionApplication-controlled
Answer questions about the signed-in customer's own orders.
- Customer messageWritten by the user
Where is my parcel? [synthetic instruction-like text attempting to redirect the assistant]
Stated architecture: The assistant can only read order status for the signed-in customer. It has no write tools, no access to other accounts and no outbound messaging.