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.

Conceptual simulationFundamentals10-15 minutes2026-09-26
Conceptual simulation

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.

3/6

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
Choose a scenario

Each fictional scenario shows where text came from, how it reached the model and what the application can do. Instruction-like text is shown only as a neutral placeholder.

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.

  1. Customer messageVariable content->
  2. Support applicationSystem component->
  3. ModelSystem component

What reaches model-visible context

  1. Application instructionApplication-controlled

    Answer questions about the signed-in customer's own orders.

  2. 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.

How do you classify this scenario?