Chapter 5 · Measurement and Incidents
Incidents and Continuous Improvement: Triage, Post-Mortems and Review Cycles
- Page 20 of 22
- 19 min read
Controls fail. Models change, data drifts, a use grows beyond what was assessed. A responsible team plans for that day: it can rate an incident quickly, keep the evidence it needs without collecting more personal data than necessary, stop the harm first and understand the cause second, learn without blaming people, finish the corrective actions, and prove they worked. This page covers that cycle, with small scripts for the tracking and checking steps.
You need Python 3.12 and its standard library only. Type the blocks in order into one session; they share variables, and the text under a block is its real output.
Honesty convention. The company, the people, the tickets and every number are invented (Toy data). The scripts report MISSING, UNKNOWN or NOT TESTED when information is absent and never invent it. The severity levels, deadlines and thresholds are choices made for the example. Nothing here is legal advice.
What you will learn
- How to define severity and escalation categories, preserve evidence without unnecessary personal data, and decide when to pause a feature.
- Who tells whom what during an incident, and how containment differs from root-cause analysis.
- How to run a blameless post-incident review with a template and a worked example.
- How to track corrective actions with owners and deadlines, and verify with a before/after check that they worked.
- How to define reassessment triggers, and how to start assembling a responsible-AI review pack.
The incident we will follow
Invented scenario:
Company: Juniper Support (invented), a software firm with a support team in Lima, Cairo and Pune.
Tool: TicketSort reads each new support ticket and labels it P1 (urgent), P2 or P3 (low).
An agent sees the label first. P3 tickets are answered last.
Change: on 2026-09-14 the vendor released model ts-2.2. Juniper's configuration said "latest",
so it switched from ts-2.1 on its own. Nobody was told and nobody tested it.
Finding: on 2026-09-23 agent Rosa noticed refund requests waiting for days. Many were written
partly in a second language. The label had drifted, but no alert had fired.
Question: what should the team do in the first hours, what should it write afterwards, and how
will it know that the fixes worked?This is a different case from the toy applicant and eligibility examples elsewhere in this tutorial. It starts exactly where the change-approval section of Review, Audit and Governance in Practice: Change Approval, Risk Acceptance and Staff Concerns warned: a vendor change that nobody approved.
Severity and escalation
Define incident severity and escalation categories. A severity level decides who is told, how fast, and whether the feature continues. Make it simple enough to use when stressed, base it on harm to people rather than on embarrassment, and say what to do when facts are unknown: unknown facts raise the level provisionally until they are known.
| Level | Meaning (our example) | Who is told, and when |
|---|---|---|
| S1 | Risk to safety or rights, or a serious exposure of personal data | Director immediately; pause the feature |
| S2 | Money or access harmed, or many people affected, or the cause is unknown | Head of Support the same day; pause or limit |
| S3 | Real but small, reversible harm | Owner within 2 working days |
| S4 | Inconvenience, few people | Weekly review |
def severity(f):
harm, people, rev = f.get("harm"), f.get("people"), f.get("reversible")
unknown = [k for k, v in (("harm", harm), ("people", people), ("reversible", rev)) if v is None]
if harm == "safety_or_rights":
level = "S1"
elif harm == "money_or_access":
level = "S2" if people is None or people >= 50 or rev is not True else "S3"
elif harm in ("inconvenience", "none"):
level = "S3" if people is not None and people >= 500 else "S4"
else:
level = "S2" # harm itself unknown: treat as serious until known
return level + (f" (provisional: unknown {', '.join(unknown)})" if unknown else "")
print("day 0 :", severity(dict(harm="money_or_access", people=None, reversible=None)))
print("day 2 :", severity(dict(harm="money_or_access", people=25, reversible=True)))
print("other :", severity(dict(harm="inconvenience", people=40, reversible=True)))
print("other :", severity(dict(harm="safety_or_rights", people=3, reversible=False)))day 0 : S2 (provisional: unknown people, reversible)
day 2 : S3
other : S4
other : S1Day 0 starts at S2 because three facts are missing. On day 2, with 25 affected people and refunds that can still be paid, the rule gives S3, yet the team may keep it at S2 because the cause is still unknown. A rule supports a decision; it does not replace the person who owns it. Reasonable teams draw these lines differently, and the levels should be reviewed after each real incident.
Preserve evidence, not personal data
Preserve relevant evidence without unnecessary personal data. Evidence lets someone else reproduce and check what happened. It does not need every customer's message. Keep: version identifiers (model, configuration, prompt), timestamps, counts and tables, logs of actions taken, and a few redacted examples. Avoid: pasting full tickets into chat or email, screenshots with names, and keeping everything for ever. Set a retention date, limit who can open the evidence, and write down who accessed it. If a dispute may follow, ask your legal adviser before deleting anything.
import hashlib
SALT = "demo-salt" # Toy data. In real use keep the salt secret and apart from the evidence.
KEEP = ("model", "priority", "language_mix", "created")
def evidence(ticket):
pid = "t_" + hashlib.sha256((SALT + ticket["id"]).encode()).hexdigest()[:8]
return {"ref": pid, **{k: ticket[k] for k in KEEP if k in ticket}}
ticket = dict(id="TK-10231", customer="Selam T.", email="[email protected]", text="Refund, please...",
model="ts-2.2", priority="P3", language_mix=True, created="2026-09-16")
print("keep:")
for k, v in evidence(ticket).items():
print(f" {k}: {v}")
print("left out:", sorted(set(ticket) - set(KEEP) - {"id"}))keep:
ref: t_ee021877
model: ts-2.2
priority: P3
language_mix: True
created: 2026-09-16
left out: ['customer', 'email', 'text']The reference t_... is a pseudonym: someone who holds the original list can link it back to the ticket, so treat it as personal data until you have checked otherwise, and keep the salt and the ticket list under tighter access than the evidence file.
When to pause a feature
Identify when a feature should be paused. Pausing is the strongest containment step, so agree the conditions in advance. Our example triggers: harm to people is likely and continuing; a stop-use condition in the policy is met (see High-Stakes Use Cases and Stop-Use Rules: Appeals, Escalation and Fallbacks); the cause is unknown and the level is S1 or S2; a control the feature depends on is known to be failing; or there is evidence of deliberate misuse. Before pausing, ask whether a smaller step contains the harm.
| Option | Example in this case | What it costs |
|---|---|---|
| Limit scope | Turn off automatic closing of P3 tickets | Little; harm may continue |
| Add a human check | An agent reads every P3 ticket from the affected period | Staff time |
| Roll back | Pin the earlier model version | Needs a known-good version |
| Pause | Sort by hand until the cause is known | Slower service for everyone |
Decide who may pause (here, any incident lead for S1 and S2, without asking permission) and who may resume (the owner and a reviewer, with evidence). Views differ on how readily to pause. The support lead notes that hand-sorting hundreds of tickets a day delays every customer. A customer advocate replies that a few slower days cost less than silent mis-prioritisation. An engineer points out that a rollback is already a form of pausing and is often enough. The page does not choose; it asks you to write the rule, the cost and the person responsible before the day it is needed.
Who tells whom what
Define notification and communication responsibilities. In an incident, people lose time asking who should speak. Decide beforehand.
| Role | Responsibility |
|---|---|
| Incident lead | Runs the response, keeps the log, decides what to tell whom, and when |
| System owner | Provides facts about the system; approves the pause and the restart |
| Privacy or legal adviser | Judges duties to regulators and affected people (see the note below) |
| Communications or support lead | Writes and sends messages to customers and staff |
| Vendor contact | Asks the vendor what changed and when, using the contract's incident clauses |
| Director | Informed at S1 and S2; decides on public statements |
A good message to affected people says what happened (only what is known), who is affected, what you are doing, what they can do, how to ask or contest, and when the next update comes. It does not guess a cause, blame a vendor or an individual before the facts are in, or promise what you cannot deliver.
Legal note (as of 2026-10-12; not legal advice): Whether and when you must tell a regulator, customers or other affected people about an incident depends on your country, your sector, the kind of data involved and your contracts. This page states no deadline or threshold. To find yours, ask your privacy or legal adviser, read the incident clauses in your vendor contracts and look for your regulator's official pages. Check the current official text for your country and sector.
Contain first, analyse second
Separate immediate containment from root-cause analysis. Containment stops or limits harm now; analysis understands why, so that it does not recur. Mixing them delays both.
| Containment | Root-cause analysis | |
|---|---|---|
| Goal | Stop and reduce harm | Find the contributing factors and what made the failure possible |
| Time | Hours | Days to weeks, after things are stable |
| Actions | Pin the model, stop auto-close, re-sort affected tickets, tell customers | Build a timeline, test the old and new model on the same cases, read the contract |
| Trap | Changing things so fast that the evidence is lost: snapshot first | Stopping at the first cause ("the vendor changed it") when several factors lined up |
A blameless post-incident review
Write a blameless post-incident review. The Google Site Reliability Engineering book, a published practice from software operations, describes post-mortems as a way to learn rather than to punish: it recommends focusing on contributing causes without blaming individuals, assuming people acted in good faith, fixing systems, deciding in advance which events trigger a review, and sharing the reviews. This course borrows the practice and adds its own gloss. Blameless is not the same as having no accountability: accountability is for completing the corrective actions, not for being the person nearest to the failure. If a case raises a question of misconduct, a separate process handles it, not the learning review.
Template:
Review of: (title) Severity: (S1-S4) Status: (draft / reviewed)
Facts only. Use roles, not names, for people who made decisions.
SUMMARY two sentences: what happened and to whom
IMPACT who, how many, how long; what is not known
DETECTION how and when it was noticed; what should have noticed it earlier
TIMELINE timestamps of changes, discovery, decisions and actions
CONTRIBUTING FACTORS conditions in the system that made it possible (never "person X erred")
WENT WELL / WAS LUCKY what worked; what could have gone worse
ACTIONS each with one owner, a due date and a way to check it worked
OPEN QUESTIONS what we still do not knowWorked example (invented): the review of the TicketSort incident.
Review of: TicketSort labels drifted for mixed-language tickets Severity: S2 Status: draft
Written 2026-10-02 by the incident lead (a support lead). Roles, not names.
SUMMARY From 2026-09-14 to 2026-09-23, urgent tickets written partly in a second language were
missed by the tool (13 of 25, Toy data), against 6 of 60 for English-only tickets.
IMPACT 13 urgent tickets delayed, up to 9 days; 4 had a payment deadline. Unknown: customers
who left without writing again.
DETECTION An agent noticed refund requests waiting on 2026-09-23. No alert existed.
TIMELINE 09-14 vendor model ts-2.2 replaced ts-2.1 (configuration said "latest")
09-23 agent raises concern; incident lead named; severity S2 (provisional)
09-23 model pinned to ts-2.1; auto-close off; hand re-sort of the 9 days begins
09-26 all affected tickets re-prioritised; affected customers contacted
CONTRIBUTING FACTORS
- the configuration followed "latest", so a vendor change reached production unreviewed
- the release test set had no mixed-language urgent tickets
- the weekly dashboard showed one overall average, which hid the group gap
- the contract did not require notice of model changes
WENT WELL a support agent spoke up; rollback took about two hours; messages were plain
WAS LUCKY refunds had a 14-day window, and the gap was found on day 9
ACTIONS tracker items A1 to A5
OPEN was ts-2.1 better for these tickets, or just never measured by language?Notice what is absent: nobody is named as the cause. The question is what let a change reach customers untested, and the answer produces actions that outlast any one person.
Corrective actions with owners and deadlines
Assign corrective actions, owners and deadlines. An action without one owner and one date is a wish. Rate its strength: removing the cause beats detecting it, which beats relying on people to remember. A real plan mixes kinds. The script reads a tracker and reports what is overdue or incomplete, as of a fixed date, and never fills a gap.
from datetime import date
AS_OF = date(2026, 10, 12)
ACTIONS = [ # Toy data: invented tracker
dict(id="A1", what="Pin the model version; remove the 'latest' alias", kind="removes cause",
owner="Bao (platform)", due="2026-09-24", status="done", evidence="config commit 4f2a"),
dict(id="A2", what="Add 12 mixed-language urgent tickets to the release test set", kind="detects",
owner="Rosa (support)", due="2026-10-05", status="open", evidence=""),
dict(id="A3", what="Report priority by language group every week", kind="detects",
owner="", due="2026-10-15", status="open", evidence=""),
dict(id="A4", what="Ask the vendor for a model-change notice clause", kind="reduces impact",
owner="Wanjiru (vendor manager)", due="", status="open", evidence=""),
dict(id="A5", what="Remind staff to check priorities", kind="relies on memory",
owner="Soren (support lead)", due="2026-09-30", status="done", evidence=""),
]
def due_date(a):
try:
return date.fromisoformat(a["due"])
except ValueError:
return None
for a in ACTIONS:
notes = []
if not a["owner"]:
notes.append("MISSING owner")
if due_date(a) is None:
notes.append("MISSING due date")
elif a["status"] != "done" and due_date(a) < AS_OF:
notes.append(f"OVERDUE by {(AS_OF - due_date(a)).days} days")
if a["status"] == "done" and not a["evidence"]:
notes.append("done but no evidence recorded")
print(f"{a['id']} {a['kind']:<17}{'; '.join(notes) or 'ok'}")A1 removes cause ok
A2 detects OVERDUE by 7 days
A3 detects MISSING owner
A4 reduces impact MISSING due date
A5 relies on memory done but no evidence recordedA2 is overdue, A3 and A4 are incomplete, and A5 is marked done with nothing to show for it: a reminder is also the weakest kind. A3 is due in three days, so it is not late, but it has no owner. The tracker is reviewed in a regular meeting, and a changed deadline needs a reason in the record.
Did the actions work?
Verify whether corrective actions actually worked. "Done" says the action happened; it does not say the problem is gone. Re-run the measure that revealed the problem, on new data, with enough cases, and compare it with the original. Here the measure is the share of truly urgent tickets labelled P1 or P2, by language group. The check reports NOT TESTED when a group has too few cases, and one good week is not yet proof.
CHECKS = { # Toy data: {group: (urgent tickets, labelled P1 or P2)}
"during incident": {"english_only": (60, 54), "mixed_language": (25, 12)},
"week 1 after fix": {"english_only": (58, 52), "mixed_language": (22, 19)},
"week 2 after fix": {"english_only": (61, 55), "mixed_language": (11, 10)},
}
def verify(period, max_gap=0.10, min_urgent=20):
c = CHECKS[period]
small = min(total for total, _ in c.values())
if small < min_urgent:
return "NOT TESTED", f"smallest group has {small} urgent tickets (minimum {min_urgent})"
rate = {g: hit / total for g, (total, hit) in c.items()}
gap = rate["english_only"] - rate["mixed_language"]
return ("PASS" if gap <= max_gap else "FAIL"), f"flagged {rate['english_only']:.2f} vs {rate['mixed_language']:.2f}, gap {gap:.2f}"
for period in CHECKS:
result, why = verify(period)
print(f"{period:<18}{result:<11}{why}")during incident FAIL flagged 0.90 vs 0.48, gap 0.42
week 1 after fix PASS flagged 0.90 vs 0.86, gap 0.03
week 2 after fix NOT TESTED smallest group has 11 urgent tickets (minimum 20)The incident period fails (gap 0.42), week 1 passes, and week 2 cannot be judged because only 11 urgent mixed-language tickets arrived. NOT TESTED is a correct answer, not a gap in the script. Also check for side effects: did the fix make English-only tickets worse, or did the team just stop looking?
Reassessment triggers
Define reassessment triggers for changed data or use. An assessment is only valid for the data and use it described. Define what counts as a change, compare the current state with the assessed one, and reassess when they differ.
| Changed | Examples | Why it matters |
|---|---|---|
| Data | New language, new channel, new region, different mix of tickets | Test sets no longer represent the real inputs |
| Model or vendor | New version, new provider, new settings | Behaviour may change without notice |
| Use | A label that was a hint now closes tickets automatically | The same error causes a bigger harm |
| Scale | Far more tickets or users | Rare failures become frequent |
| Time and context | A long gap since review; new law or guidance (check the current official text) | Assumptions go stale |
ASSESSED = dict(model="ts-2.1", languages=["English", "Spanish"], channels=["email"],
weekly_volume=1200, decision_use="priority hint; an agent decides",
regions=["Americas", "Africa"], reviewed="2026-03-01")
CURRENT = dict(model="ts-2.1", languages=["English", "Spanish", "Portuguese"],
channels=["email", "chat"], weekly_volume=2100,
decision_use="closes P3 tickets after 14 days", reviewed="2026-03-01")
def triggers(a, c, max_growth=0.5, max_days=183): # growth and age limits are chosen for this example
out = []
for k in a:
if k not in c:
out.append(f"UNKNOWN {k}: not recorded now, cannot check")
for k in ("languages", "channels"):
new = sorted(set(c.get(k, [])) - set(a[k]))
if new:
out.append(f"new {k}: {', '.join(new)}")
for k in ("model", "decision_use"):
if k in c and c[k] != a[k]:
out.append(f"{k} changed: '{a[k]}' to '{c[k]}'")
growth = c.get("weekly_volume", a["weekly_volume"]) / a["weekly_volume"] - 1
if growth > max_growth:
out.append(f"weekly volume up {growth:.0%}")
age = (AS_OF - date.fromisoformat(a["reviewed"])).days
if age > max_days:
out.append(f"last review {age} days ago")
return out
for line in triggers(ASSESSED, CURRENT) or ["no trigger fired"]:
print("-", line)- UNKNOWN regions: not recorded now, cannot check
- new languages: Portuguese
- new channels: chat
- decision_use changed: 'priority hint; an agent decides' to 'closes P3 tickets after 14 days'
- weekly volume up 75%
- last review 225 days agoFive triggers fire (a new language, a new channel, a change of use, volume growth and the time since review), and one field cannot be checked because nobody recorded it. The change of use is the most serious: a hint that an agent can override has become an automatic action, which is a new decision point, so it needs the change approval taught in Review, Audit and Governance in Practice: Change Approval, Risk Acceptance and Staff Concerns and a fresh assessment.
Starting your review pack
Capstone preparation: assemble a responsible-AI review pack. The final pages ask you to gather what you have built into one pack. Start now by collecting, for one feature: the impact assessment and risk register; the requirements map; fairness measures with their small-sample caveats; data-governance notes; the system card; the oversight and stop-use design; the misuse review; the trade-off note; the governance register entry; the objectives and the control-test results from the previous page; and from this page the severity table, the incident template and the reassessment triggers. Mark every item with a status (done, draft or MISSING) and an owner. Then use the Practice Lab: Assess a Bounded AI Feature with Toy Data and Python; the capstone page, Capstone, Cheat Sheet and What's Next: A Go/No-Go Assessment Pack, turns the pack into a decision.
Where this shows up at work
Support, operations and product teams keep a short incident procedure, a severity table and a tracker long before they have a dedicated safety team. Customers and auditors often ask to see them. The review of a small, ordinary incident like the one above is where most of the improvement happens.
Common mistakes
- Analysing before containing. Every hour spent finding the cause is an hour the harm continues. Contain first, snapshot the evidence, then analyse.
- Copying personal data into the incident chat. It spreads the problem. Share counts, versions and redacted samples.
- Naming a person as the cause. It ends the inquiry and hides the system conditions. Describe the conditions.
- Counting "done" as "fixed". Re-run the measure on new data, and say NOT TESTED when the data is too thin.
- Actions with no owner or date. They are not scheduled. Assign one owner, a due date and evidence of completion.
Try it yourself
Use the namespace from this page. The tasks revisit the idea of residual risk from Risk Scoring, Controls and Decisions: Building a Toy Risk Register.
- Easy. A typo in a help article, found by 12 customers who lost no money or access, is fixed in minutes. Rate it with
severity, and say who is told. - Medium. Rewrite this blaming line as contributing factors: "Bao forgot to pin the model, so he caused the incident."
- Hard. Write a function
fixed(periods)that says VERIFIED only after two consecutive PASS periods, and run it on the two weeks after the fix.
Answers
Easy.
print(severity(dict(harm="inconvenience", people=12, reversible=True)))S4Pass checklist: S4, with no unknown facts; weekly review is enough, no urgent escalation; the page's rule is a choice. A strong answer adds that a typo in a safety instruction would be a different harm and need a different level.
Medium. A strong answer: "The configuration followed 'latest' so a vendor change reached production without review; there was no test or alert to catch it; the process did not assign anyone to approve model changes." Pass checklist: no person is named as the cause; each factor is a condition that can be changed; each points to a possible action. A weak answer says "human error" and stops.
Hard.
def fixed(periods):
results, streak = [], 0
for p in periods:
r = verify(p)[0]
results.append(r)
streak = streak + 1 if r == "PASS" else 0 # a FAIL or NOT TESTED breaks the streak
return results, "VERIFIED" if streak >= 2 else "NOT YET VERIFIED"
print(fixed(["week 1 after fix", "week 2 after fix"]))(['PASS', 'NOT TESTED'], 'NOT YET VERIFIED')Pass checklist: the streak resets on anything but PASS; week 2 is NOT TESTED, so the result is NOT YET VERIFIED, not VERIFIED; the answer explains that more data is needed. A weak answer treats NOT TESTED as a pass.
Summary
- Rate severity on harm to people, treat unknown facts as raising the level, and agree in advance who may pause a feature and what smaller steps exist.
- Keep evidence that lets others reproduce what happened, not more personal data than needed; know who tells whom what, and check your own notification duties.
- Contain first and analyse second; write a blameless review focused on contributing factors in the system.
- Give every corrective action one owner, a date and evidence; verify with a before/after check, and report NOT TESTED honestly.
- Reassess when data, model, use, scale or time have changed from what was assessed.
Next: Practice Lab: Assess a Bounded AI Feature with Toy Data and Python puts the whole course together on one feature, with graded tasks.

