Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
A risk register is the unglamorous artifact that turns a pile of threat-modeling notes into something you actually act on: each risk gets a likelihood, an impact, an owner, and a status, so you can rank what to fix first instead of fixing whatever feels scariest that morning. For LLM systems specifically, a register is what stops the OWASP Top 10 from staying a list you read once and forget — every module for the rest of this course will hand you one or more concrete risks, and the register is where they land, get scored, and get tracked to closed. Building the habit now, on a small real or hypothetical system, is what makes the capstone's findings report (Module 9) something you can produce in an afternoon instead of from scratch.
The demo implements a minimal risk register: add a risk with likelihood/impact scores, compute a priority, and list open risks sorted highest-priority first — the exact shape you'll keep extending through the rest of the course.
close(risk_id, mitigation: str) method to RiskRegister that flips status to 'mitigated' and records the fix.owner field and a method by_owner(name) so the register can be filtered per team member.from dataclasses import dataclass, field
@dataclass
class Risk:
id: str
title: str
owasp_category: str
likelihood: int # 1-5
impact: int # 1-5
status: str = "open"
@property
def priority(self) -> int:
return self.likelihood * self.impact
class RiskRegister:
def __init__(self):
self.risks: list[Risk] = []
def add(self, risk: Risk):
self.risks.append(risk)
def open_by_priority(self):
open_risks = [r for r in self.risks if r.status == "open"]
return sorted(open_risks, key=lambda r: r.priority, reverse=True)
reg = RiskRegister()
reg.add(Risk("R1", "System prompt leaks via crafted user question", "LLM07", 4, 3))
reg.add(Risk("R2", "Retrieved doc can inject instructions into agent", "LLM01", 5, 5))
reg.add(Risk("R3", "No rate limit on chat endpoint", "LLM10", 3, 3))
for r in reg.open_by_priority():
print(f"[{r.priority:>2}] {r.id} {r.owasp_category}: {r.title}")python3 main.py