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 LLM applications

Prompt injection, data leaks, unsafe output and cost attacks. Attack your own app, then harden it.

16 lessons · about 14 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-llm-apps.

You will build

Build the hardened bot and write its security report

You need

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

Next course

Securing RAG and data

  1. 00Set up your lab for Securing LLM applicationsCreate the lab folder of the courseSet-up15 min
  2. 01Build a support bot and break it with prompt injectionBuild a small support chatbot and a test harness on your own machineBuild40 min
  3. 02Hide an instruction in a review and measure how often the bot obeysAdd a review summary feature to your bot that reads text from outside40 min
  4. 03Keep secrets out of the prompt and check them in codeMeasure how often a secret in a system prompt can be extracted40 min
  5. 04Stop customer data from leaking with minimal context and an output filterShow how a model reveals other customers' records that sit in its context60 min
  6. 05Escape, sign and compare model answers before anyone trusts themFix a staff page that runs markup from a model answer, and list the images that leak data50 min
  7. 06Run database queries that the model cannot changeShow how a question in plain words changes a query that a model writes35 min
  8. 07Limit what the bot can do with least privilege and approvalGive the bot a refund tool and measure how often an injected instruction moves money45 min
  9. 08Control cost and abuse with limits you can measureMeasure the tokens and the time that one request costs50 min
  10. 09Add guardrails to the bot and measure what they missBuild an input filter and an output check around the model60 min
  11. 10Rebuild the bot with five secure design patterns and measure the sumPut the whole weak app in one file as a baseline for tests60 min
  12. 11Turn your tests into a suite with a report and a pass thresholdStore test cases in a JSON file with a category, a prompt and a check60 min
  13. 12Test that the rules hold against jailbreaksTell a jailbreak from a prompt injection and name four families of jailbreak55 min
  14. 13Build the hardened bot and write its security reportCombine the defences of the course in one hardened botBuild60 min
  15. 14Close the last gap in the bot and count what it costsAdd one code check against the attack that still gets through60 min
  16. 15Review a chatbot before it goes live and fix what you findFind the planted weaknesses in a chatbot 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.