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

Advanced / AI governance for engineers

AI governance for engineers cheat sheet

Set up (lesson 0)

TaskCommand or code
Make the lab foldermkdir -p ~/krlab/ai-governance
Make and switch on the environmentpython3 -m venv .venv, source .venv/bin/activate
Install the pinned versionspip install -r requirements.txt
Write the synthetic datapython makedata.py
Prove that the lab workspython labcheck.py

Accountability (lesson 1)

TaskCommand or code
Check a RACI table (one A for each activity)python raci_check.py raci.csv
Check a policy filepython policy_check.py policy.md
End a checker with a count and an exit codefinish(problems) from govlib.py
Read the exit code of the last commandecho "exit code $?"
Change text in a copysed 's/old/new/' file > copy
Change a file in place (lesson 8 uses it)sed -i 's/old/new/' file
Print the lines without a wordgrep -v word file
Make an empty filetouch file
Copy a filecp a b
Print the first four lineshead -4 file
Add a line at the end of a fileecho "text" >> file

Inventory and shadow AI (lesson 2)

TaskCommand or code
Check the inventorypython inventory.py check inventory.csv
Find unlisted AI usepython inventory.py shadow inventory.csv data/records.csv ai_rules.json
Match a domain and its subdomainsitem == d or item.endswith("." + d)
Match a product as a whole wordre.search(r"\b" + re.escape(name) + r"\b", item, re.I)
Count the lines with a textgrep -c text file

Risk register (lesson 3)

TaskCommand or code
Score and list, worst firstpython register.py report register.csv
Score of a risklikelihood * impact, bands 15, 10, 5, 1
Add a row to a copyecho "R9,..." >> test.csv
Send output into the next command, and show its last linescommand | tail -4

Fairness (lesson 4)

TaskCommand or code
Accuracy, selection rate, true positive rate by grouppython fairness.py
Selection-rate ratiolower rate divided by higher rate
Compare two mitigations and their costpython mitigate.py
Count the values of one columncut -d, -f2 file | sort | uniq -c
Fixed train and test rowstrain_test_split(..., test_size=0.3, random_state=0)

Explanations (lesson 5)

TaskCommand or code
Importance, decisions and explanation recordspython explain.py
Check that each decision has a recordpython explain_check.py decisions.csv explanations.jsonl
Reason for one decision, linear modelcoef_ * scaler.transform([row])[0]
Print the first line that holds a wordgrep -m 1 word file

EU AI Act triage (lesson 6)

TaskCommand or code
Class and start date of each systempython classify.py report systems.csv aiact_rules.json
Artefacts that one system owespython classify.py duties systems.csv aiact_rules.json LoanScore
Compare declared and computed classpython classify.py check systems.csv aiact_rules.json
Take dates and duties fromthe current official text on EUR-Lex

NIST AI RMF (lesson 7)

TaskCommand or code
Four functionsGovern, Map, Measure, Manage
Check the plan and its filespython plan_check.py rmf_plan.csv [folder]
Check the incident logpython incident_check.py incidents.csv
Fairness report as a filepython mitigate.py > fairness_report.txt
Profile for generative AINIST AI 600-1

Management system (lesson 8)

TaskCommand or code
Report overdue reviews on the fixed datepython overdue.py ams_records.csv
Report them for another datepython overdue.py ams_records.csv 2027-01-01
Due date of a recordlast_done + timedelta(days=every_days)

Third parties and data location (lesson 9)

TaskCommand or code
Score a provider (0 to 12)python vendor.py score vendor.json location_rules.json
Check the data flowspython vendor.py flows flows.csv location_rules.json
A record that cannot be scoredreported as a problem, with no score printed
Decision from the points10 or more and no zero: accept; 7 or more: conditions; else reject
Require an assessment for personal datapython dpia_check.py . LoanScore

Model card and data sheet (lesson 10)

TaskCommand or code
Render Markdown from the JSONpython card.py render model_card.json datasheet.json
Check fields and approvalpython card.py check model_card.json datasheet.json approvals.jsonl
Record an approvalpython card.py approve model_card.json approvals.jsonl Elif 2026-11-15
Fingerprint of a documentcard.digest(card.load("model_card.json"))

Governance body (lesson 11)

TaskCommand or code
Check that jobs fit the RACI table and training is currentpython people_check.py people.csv raci.csv jobs.json
Same check for another datepeople_check.problems(people, raci, jobs, date(2027, 1, 1))
Change two things in one passsed 's/a/b/; s/c/d/' file > copy

Principles and evidence (lesson 12)

TaskCommand or code
Check one control, owner and evidence file for each principlepython controls_check.py controls.csv people.csv register.csv
Show a count with noise, a demonstration with a fixed seed (small epsilon, more privacy)python dp_count.py data/loans.csv B | tee dp_release.txt
Fingerprint of a file, 16 characterssha256sum decisions.csv | cut -c1-16
Count the different lines of a filesort -u file | wc -l
Mark a principle as not applicablen/a in evidence, and a reason of five words or more
Move or rename a filemv old new

The governance pack (lesson 13)

TaskCommand or code
Check the whole pack (13 parts)python check_pack.py [folder]
Name who approved a group cut-off"group_cut_off_approved_by" in pack.json
Test the check on a broken copymkdir copy, cp *.csv *.json *.jsonl *.md *.txt copy/, edit, python check_pack.py copy

Scenario test (lesson 14)

TaskCommand or code
Write the half-finished packpython scenario_pack.py
Check itpython check_pack.py scenario
Run your own retraining script (the model solution has one)python retrain.py
Score the two providerspython vendor.py score scenario/vendor.json location_rules.json
Approve the repaired cardpython card.py approve scenario/model_card.json scenario/approvals.jsonl NAME DATE

Safety habits