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 / Foundations

How LLMs and agents work

Tokens, prompts, RAG, tools and agents. Build a small assistant, so you know what you will secure.

12 lessons · about 10 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/llms-and-agents.

You will build

Build the KR Books assistant

You need

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

Next course

AI security fundamentals

  1. 00Set up your lab for How LLMs and agents workCreate the lab folder of the courseSet-up15 min
  2. 01Build a model that predicts the next wordCount which token follows which in a text and use the counts as a modelBuild35 min
  3. 02Count tokens and test the limit of a context windowSplit text into tokens and learn sub-word pieces with a small tokenizer35 min
  4. 03Run a language model on your own machineInstall Ollama the careful way and pull a small model that runs on a CPU40 min
  5. 04Write prompts with roles, examples and JSON outputExplain that system, user and assistant messages become one long text45 min
  6. 05Measure how often a model invents factsWrite a quiz with known answers and score a model as right, wrong or "does not know"45 min
  7. 06Give a model your own documents with retrievalBuild a search over six documents with TF-IDF and cosine similarity50 min
  8. 07Let a model use tools, and check every requestExplain that a model only writes a request and your program runs the tool50 min
  9. 08Build an agent loop and read an MCP messageBuild a loop that lets a model use tools for several steps, with a step limit and a traceBuild55 min
  10. 09Compute attention and shrink a model's weightsCompute the attention weights of a short text and say which token gets the weight60 min
  11. 10Build the KR Books assistantCombine retrieval, a checked tool, a step limit and a trace in one programBuild55 min
  12. 11Review a shop assistant before it goes liveFind what a retrieval step puts into the prompt, including text that should not be thereTest90 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.