Phase 1: When AI Harms — Real-World Cases & the Responsible AI Landscape · 40 min · Python · requests · pandas
The Problem
In 2016, ProPublica published an investigation that would become the most cited algorithmic bias case in history. They analyzed COMPAS — a tool used by U.S. judges to predict whether a criminal defendant would reoffend — and found it was nearly twice as likely to falsely flag Black defendants as high risk compared to white defendants. A Black man named Bernard Parker, who had two prior misdemeanors, was rated high risk. A white man named Dylan Fugett, who had three prior felonies, was rated low risk.
Northpointe (the company behind COMPAS) pushed back, arguing their tool was fair by a different metric. The debate that followed — playing out in academic papers, court cases, and eventually the Wisconsin Supreme Court — established something that every Responsible AI Engineer needs to internalize: fairness is not a single number, and two reasonable people can disagree about what "fair" even means.
COMPAS is not an isolated case. The AI Incident Database — a public, curated repository of real-world AI harms — documented 233 AI safety incidents in 2024 alone, a 56.4% increase from 149 in 2023 (Stanford AI Index Report 2025). These aren't thought experiments. They are real systems that caused real harm to real people:
- Amazon's hiring AI (2018) was scrapped after it systematically downgraded resumes containing the word "women's" — trained on 10 years of male-dominated hiring data, it learned that male candidates were preferable
- SafeRent's scoring algorithm gave a voucher-holding applicant a failing score, automatically rejecting her rental application — the DOJ joined a lawsuit claiming it disproportionately harmed protected classes
- A Chevrolet dealership chatbot (2023) was tricked into agreeing to sell a car for one dollar — a harm that was funny until you realized the same architecture powers customer service bots at banks and hospitals
Every one of these incidents is indexed, categorized, and publicly available. The AI Incident Database is where Responsible AI engineering starts — not with frameworks or regulations, but with understanding what has already gone wrong.
The AI incident database
The AI Incident Database (AID) at incidentdatabase.ai is the closest thing the AI field has to aviation's incident reporting system. It catalogs cases where AI systems caused or nearly caused real-world harm. Each incident includes:
- A description of what happened
- The AI system involved
- The harm type and severity
- The date and source
- Links to original reporting
The database classifies harms into categories that map to how organizations actually think about risk:
| Harm Type | Description | Example |
|---|
| Physical | Bodily injury or death | Autonomous vehicle collision, medical misdiagnosis |
| Financial | Economic loss to individuals or organizations | Discriminatory lending, automated trading losses |
| Reputational | Damage to an individual's or organization's reputation | False content generation, misidentification |
| Civil Rights | Violation of legally protected rights | Discriminatory hiring, biased sentencing, housing discrimination |
| Social | Harm to social systems, institutions, or trust | Election interference, misinformation at scale |
Why "near harms" matter
The AID also tracks "near harms" — incidents where harm could have occurred but was caught before impact. These are the AI equivalent of aviation near-misses. A Responsible AI Engineer studies near harms because they reveal failure modes before they become incidents. If your organization's monitoring caught a biased output before it reached a user, that's a near harm worth documenting — not a non-event to ignore.
The Concept
The COMPAS case: why it still matters
COMPAS (Correctional Offender Management Profiling for Alternative Sanctions) is the canonical case study in algorithmic bias for three reasons:
1. The stakes were maximal. COMPAS scores were shown to judges during sentencing decisions. A high-risk score could mean denial of bail, longer sentences, or denial of parole. This is not a recommendation engine for movies — it's a system that directly affects human liberty.
2. Both sides were "right" — by different fairness definitions. ProPublica showed that COMPAS had:
- Higher false positive rate for Black defendants (44.9% vs. 23.5% for white)
- Lower false negative rate for Black defendants (47.7% vs. 61.2% for white)
Northpointe countered that COMPAS had similar positive predictive value across races — when it said someone was high risk, it was right about equally often regardless of race. Both claims were mathematically correct. The disagreement was about which fairness metric matters, not about the numbers.
3. It proved the impossibility theorem. Alex Chouldechova's 2017 paper formalized what the COMPAS debate demonstrated: when base rates differ across groups (and they always do in real data), you cannot simultaneously satisfy equalized odds and predictive parity. It's mathematically impossible. This means every "fair" model is fair by a chosen definition, and someone else's definition will show it's unfair.
A colleague says "we'll just remove the race column from our training data and the model can't be biased." Using the COMPAS case, explain why this doesn't work.
COMPAS itself didn't use race as a direct input feature — and it still produced false positive rates nearly twice as high for Black defendants. Proxy variables carry the signal: residential zip code correlates with race in the U.S., income correlates with race, prior arrest history correlates with race because of differential policing patterns. Removing the protected attribute is necessary but not sufficient. You must measure bias across protected groups regardless of whether the model uses those attributes as inputs — which is exactly what Fairlearn and AIF360 do in Phase 2.
Building an incident categorizer
The first tool a Responsible AI Engineer builds is not a fairness metric — it's an understanding of what has already gone wrong. Let's build a Python script that queries the AI Incident Database, retrieves real incidents, and categorizes them by harm type.
"""
lesson_00_01_incident_categorizer.py
Queries the AI Incident Database and categorizes incidents by harm type.
"""
import requests
import pandas as pd
from collections import Counter
from datetime import datetime
# Harm type taxonomy (aligned with AID classifications)
HARM_TYPES = {
"physical": "Bodily injury, death, or physical danger",
"financial": "Economic loss to individuals or organizations",
"reputational": "Damage to reputation via false content or misidentification",
"civil_rights": "Violation of legally protected rights (hiring, housing, lending, sentencing)",
"social": "Harm to social systems, institutions, or democratic trust",
}
def fetch_incidents(limit=100):
"""Fetch recent incidents from the AI Incident Database API."""
# The AID provides a downloadable CSV of all incidents
url = "https://incidentdatabase.ai/api/incidents/"
try:
response = requests.get(url, params={"limit": limit}, timeout=15)
response.raise_for_status()
return response.json()
except requests.RequestException as e:
print(f"API request failed: {e}")
print("Falling back to known incidents dataset...")
return get_known_incidents()
def get_known_incidents():
"""Fallback dataset of well-documented AI incidents."""
return [
{
"id": 1,
"title": "COMPAS recidivism bias",
"description": "Risk assessment tool falsely flagged Black defendants at nearly twice the rate of white defendants",
"date": "2016-05-23",
"harm_type": "civil_rights",
"severity": "high",
"source": "ProPublica",
},
{
"id": 2,
"title": "Amazon hiring AI discrimination",
"description": "Recruitment tool downgraded resumes containing 'women's' — trained on male-dominated historical data",
"date": "2018-10-10",
"harm_type": "civil_rights",
"severity": "high",
"source": "Reuters",
},
{
"id": 3,
"title": "SafeRent algorithmic housing discrimination",
"description": "Rental scoring algorithm rejected voucher-holding applicant, disproportionately harming protected classes",
"date": "2023-02-14",
"harm_type": "civil_rights",
"severity": "high",
"source": "DOJ",
},
{
"id": 4,
"title": "Chevrolet chatbot one-dollar car",
"description": "Dealership chatbot tricked into legally binding offer to sell car for one dollar",
"date": "2023-12-19",
"harm_type": "financial",
"severity": "medium",
"source": "Multiple",
},
{
"id": 5,
"title": "ChatGPT suicide encouragement lawsuit",
"description": "Parents sued OpenAI alleging ChatGPT encouraged their son to commit suicide",
"date": "2025-08-21",
"harm_type": "physical",
"severity": "critical",
"source": "CIO",
},
{
"id": 6,
"title": "Deepfake election misinformation",
"description": "AI-generated deepfake audio of political candidate circulated before election",
"date": "2024-01-22",
"harm_type": "social",
"severity": "high",
"source": "Multiple",
},
{
"id": 7,
"title": "Facial recognition false arrest",
"description": "Man wrongly arrested due to false facial recognition match by Detroit police",
"date": "2020-01-06",
"harm_type": "civil_rights",
"severity": "high",
"source": "New York Times",
},
{
"id": 8,
"title": "Google Photos gorilla misclassification",
"description": "Image classification labeled Black people as 'gorillas'",
"date": "2015-06-28",
"harm_type": "reputational",
"severity": "high",
"source": "Gizmodo",
},
]
def categorize_incidents(incidents):
"""Categorize incidents by harm type and produce summary statistics."""
records = []
for inc in incidents:
harm = inc.get("harm_type", "unknown")
records.append({
"id": inc.get("id"),
"title": inc.get("title", "Unknown"),
"date": inc.get("date", "Unknown"),
"harm_type": harm,
"harm_description": HARM_TYPES.get(harm, "Uncategorized"),
"severity": inc.get("severity", "unknown"),
"source": inc.get("source", "Unknown"),
})
df = pd.DataFrame(records)
return df
def generate_summary(df):
"""Generate a harm taxonomy summary report."""
harm_counts = Counter(df["harm_type"].tolist())
severity_counts = Counter(df["severity"].tolist())
report = []
report.append("# AI Incident Categorization Report")
report.append(f"\nGenerated: {datetime.now().isoformat()}")
report.append(f"Total incidents analyzed: {len(df)}\n")
report.append("## Harm Type Distribution\n")
report.append("| Harm Type | Count | Description |")
report.append("|---|---|---|")
for harm, count in harm_counts.most_common():
desc = HARM_TYPES.get(harm, "Uncategorized")
report.append(f"| {harm} | {count} | {desc} |")
report.append("\n## Severity Distribution\n")
report.append("| Severity | Count |")
report.append("|---|---|")
for sev, count in severity_counts.most_common():
report.append(f"| {sev} | {count} |")
report.append("\n## Key Incidents\n")
for _, row in df.iterrows():
report.append(f"- **{row['title']}** ({row['date']}) — {row['harm_type']}, {row['severity']} severity")
return "\n".join(report)
if __name__ == "__main__":
print("Fetching AI incidents...")
incidents = fetch_incidents(limit=50)
print(f"Retrieved {len(incidents)} incidents. Categorizing...")
df = categorize_incidents(incidents)
# Save categorized data
df.to_csv("incident_categorization.csv", index=False)
print("Saved incident_categorization.csv")
# Generate summary report
report = generate_summary(df)
with open("incident_summary.md", "w") as f:
f.write(report)
print("Saved incident_summary.md")
# Print quick stats
print(f"\nHarm type distribution:")
for harm, count in Counter(df["harm_type"]).most_common():
print(f" {harm}: {count}")
API availability
The AI Incident Database API may not always be accessible or may change format. The get_known_incidents() fallback ensures the lab always runs. If the API is available, the script uses real data. If not, it uses the curated set of well-documented incidents. In production, you'd want to cache API responses and handle rate limiting — but for learning purposes, the fallback is sufficient.
The 56.4% increase — why incidents are accelerating
The Stanford AI Index Report 2025 documented that AI safety incidents surged from 149 in 2023 to 233 in 2024 — a 56.4% increase. This is not because AI suddenly became more dangerous. It's because:
- More systems are deployed — every company is shipping AI features, each one a potential incident
- Monitoring is improving — organizations are getting better at detecting harms they would have missed before
- Reporting norms are shifting — what was once "a bug" is now recognized as "an AI incident"
- Regulatory pressure — the EU AI Act's incident reporting requirements (Article 73) create legal incentives to document
For a Responsible AI Engineer, this trend means the job is not going away. Companies like Citi, Marriott, Schwab, and Johnson & Johnson are actively hiring for roles that specifically require the ability to identify, categorize, and respond to AI incidents — exactly what you just built.
Given the harm taxonomy above, how would you categorize an AI-powered medical triage system that correctly handles 99% of cases but systematically deprioritizes patients who speak English as a second language, leading to delayed treatment for that group?
The correct answer is "civil_rights" — the system is producing discriminatory outcomes for a protected class (national origin), even though the harm manifests physically (delayed treatment). The harm type tracks the root cause (discrimination), not the downstream consequence. In the AID, this would be tagged as both "civil_rights" (primary) and "physical" (secondary), because harm categories are not mutually exclusive.