Guided security lab

RAG Prompt Injection

A guided RAG trust-path exercise: follow content from source through ingestion, chunking, authorized retrieval and context assembly, then apply identity, provenance, scope and action policy to a model proposal.

Conceptual simulationIntermediate15 minutes2026-09-26
Conceptual simulation

This exercise uses authored, deterministic examples with fictional names. It runs no retrieval, embeddings, vector database, model or tools, and it does not predict how any real model behaves.

3/6

Learning objectives

  • Explain why content a principal is authorized to read is not authorized to instruct the assistant or change the task.
  • Place permission-aware retrieval before context assembly, so relevance and ranking never override identity, tenant or ACL.
  • Keep source, version, chunk lineage and authorization metadata attached through parsing, chunking and reindexing, and fail closed when it is missing.
  • Recognize a bounded, legitimate RAG answer path without granting retrieved text authority over future steps.
  • Separate RAG influence from downstream capability: every consequential action is revalidated outside the model.

Prerequisites

  • Trust Boundaries and Model Context lab (recommended)
  • RAG Prompt Injection attack article (optional)
Choose a scenario

Each fictional scenario shows retrieved content the model sees and, separately, the identity, provenance and policy facts the application records. Security decisions belong to the second column.

RAG path and trust flow

Content moves from source through ingestion, chunking, authorized retrieval and context assembly before the model sees it. Components are system; documents, chunks and the model proposal stay variable.

  1. User questionVariable content->
  2. Retriever with ACL filterSystem component->
  3. Authorized chunkVariable content->
  4. Context assemblySystem component->
  5. ModelSystem component->
  6. ProposalVariable content->
  7. Task policySystem component

Model-visible retrieved content

Retrieved text the model reads. Bracketed text is a neutral placeholder, not a real instruction.

  1. Retrieved chunk, handbook section 4

    Employees accrue leave monthly; carry-over is limited to ten days. [synthetic instruction-like text attempting to redirect the assistant]

Application-side identity, provenance and policy

Recorded by the ingestion pipeline, the retriever and the application outside model text.

Which fact may the application rely on for a security decision?