Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

KaliRange / Core

Securing RAG and data

Poisoned documents, access control in retrieval and private data in a knowledge base.

12 lessons · about 9 hours · every command tested

How to use the lab files

The zip keeps the files of each lesson apart, and the lessons work in one flat folder. After you unzip it, sh kr-lab.sh LESSON FOLDER builds that folder as it stands after a lesson, for example sh kr-lab.sh 00-set-up-your-lab ~/krlab/securing-rag.

You will build

Build a secure RAG service and its test suite

You need

A computer with Linux, macOS, or Windows with WSL. No GPU, no cloud account and no paid tool.

Next course

Securing AI agents and MCP

  1. 00Set up your lab for Securing RAG and dataCreate the lab folder of the course and add the model helperSet-up15 min
  2. 01Build a RAG service and map its trust boundariesBuild a small RAG service over twelve documents of three sensitivity levelsBuild40 min
  3. 02Poison a knowledge base and measure the effectAdd a poisoned document to your own knowledge base and measure its rank40 min
  4. 03Stop poisoned documents with provenance and reviewReject a chunk that has no provenance and quarantine one that no person has approved40 min
  5. 04Enforce access control in retrievalFilter chunks by the role of the user before they are ranked and before the prompt is built45 min
  6. 05Find the weak points of embeddings and vector storesShow what an index file leaks and keep secret words out of the files that others can read50 min
  7. 06Keep private data out of prompts, logs and storesRedact emails, card-like numbers and staff identifiers before indexing and before logging40 min
  8. 07Measure retrieval quality and leakageCompute precision at k and a leakage count on a labelled question set40 min
  9. 08Design a production RAG architecturePlace each control at the stage of the pipeline where it works40 min
  10. 09Govern your knowledge base with a catalogue and a checkerKeep a data catalogue as a CSV file with an owner, a review cycle and a retention period for each document40 min
  11. 10Build a secure RAG service and its test suiteCombine provenance, quarantine, redaction, access control and a safe index in one serviceBuild55 min
  12. 11Review a RAG service before it goes live and fix what you findFind six planted weaknesses in a RAG service by reading its code and by testing itTest90 min

Work roles

Work roles this course supports

The course helps you to prepare for these roles of the NICE Workforce Framework for Cybersecurity (NIST SP 800-181 Rev. 1). No single course covers a whole role, and KaliRange is not a certification body.

Role names and codes are NIST's (Components 2.2.0, 2026-04-28); the choice of roles is our own reading of the role descriptions. The NICE Framework at NIST has the full description of each role.