Detection and incident response for AI
What to log, what to detect, and how to contain and recover from an AI incident.
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/ai-detection-response.
You will build
You need
A computer with Linux, macOS, or Windows with WSL. No GPU, no cloud account and no paid tool.
Next course
- 00Set up your lab for Detection and incident response for AICreate the lab folder of the courseSet-up15 min
- 01Decide what to log, keep secrets out and protect the logChoose the fields of one log record for an AI assistant45 min
- 02Detect injection and abuse in the logsWrite four detection rules that read only the log file45 min
- 03Watch confidence and drift, and share the evidence without naming anyoneTurn token probabilities into one confidence score for an answer60 min
- 04Watch rate and cost and alert on a spikeCount requests per user and per hour and compute the cost of each request from its tokens45 min
- 05Spot model extraction by its query patternName the features of an extraction run that the log can show45 min
- 06Write incident playbooks for AI and check them with codeWrite a playbook for each of five AI incident types40 min
- 07Contain an AI incident, roll back and prove the recoveryContain an incident with the smallest action that stops it45 min
- 08Audit an AI system for accuracy, access and biasMeasure accuracy and hallucination on a labelled sample and state how sure the result is50 min
- 09Build a detection and response kit with one commandJoin the log writer, the detectors, the cost watcher, the playbook checker and the rollback check in one kitBuild40 min
- 10Find the incident in a week of logs, contain it and report itFind an injection that led to a tool misuse, a slow extraction and a cost spike in one week of logsTest90 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.
- Incident Response
PD-WRL-003a main skill of the roleYou write AI incident playbooks, contain an incident, roll back and report it. - Defensive Cybersecurity
PD-WRL-001a supporting skillYou write detection rules for injection, extraction and cost spikes in AI logs.