Home/Notebook/RAG systems

Topic guide

RAG systems and security evaluation

Understand retrieval-augmented generation and evaluate RAG security by separating retrieval, model behavior, and monitoring outcomes.

Where does a RAG system fail?

Retrieval-augmented generation, or RAG, adds retrieved material to the context a language model uses to answer a request. The application must select that material, pass it to the model, and decide how to handle the resulting response. A vector database can support retrieval, but the database, the retrieval policy, and the model are separate parts of the system.

The essays here focus on understanding and measuring security outcomes across those parts. A document reaching the model, an instruction influencing its response, and a monitor detecting that response are different events. Keeping them separate helps explain why two systems can report the same overall injection rate yet need different improvements. The worked examples provide a vocabulary and a way to interpret the measurements.

A guide to the notebook by Nathan / moody.

Choose a starting point

Read in sequence

  1. Channel, Decoder, Substrate: A Vocabulary for ML Attacks

    Build a vocabulary for the parts of the system.

    16 min read
  2. Two RAG systems, same injection rate, different problems

    See what a single headline metric leaves out.

    12 min read

Take the question further