Responsible AI principles
Microsoft and AWS name the same responsible AI ideas
Fairness, safety, privacy, transparency, accountability: matched across providers.
Every provider publishes responsible AI principles. Microsoft has six. Fairness. Reliability and safety, which AWS splits into safety and veracity and robustness. Privacy and security. Inclusiveness, close to fairness. Transparency, with explainability on the AWS side. And accountability, which AWS calls governance and controllability. Learn the ideas, and either list follows.
Measuring bias
Measure bias by comparing groups in the data and the outcomes
Class imbalance 0.60, DPL 0.25, disparate impact 0.58.
Bias can be measured. Group a has eight hundred applicants, sixty percent approved. Group d has two hundred, thirty five percent approved. Class imbalance: the groups differ in size, 0.6. The difference in approval rates is 0.25. Disparate impact divides them: 0.58, below the usual line of point eight. A model trained on this data will learn the gap unless you fix it.
Bias after training · Going deeper
Equal precision can hide very unequal recall
Post-training metrics (DPPL, DI, RD) compare the model's decisions per group.
Explainability
SHAP values show why the model decided this case
SHAP: from the average 0.42 to this 0.38, feature by feature.
Why was this applicant declined? Start from the average score, 0.42. High income pushes it up. A high debt ratio pulls it down. Two missed payments pull hardest. Years employed and account age add a little. The total is 0.38, below the approval line. Each push is a SHAP value; together they add up exactly to the prediction.
Explainability · Going deeper · 1 of 2
Which models explain themselves
Simple models are interpretable; complex ones need tools.
Shapley values · Going deeper · 2 of 2
A SHAP value averages a feature's effect over every order of reveal
Shapley values share the prediction fairly, and always sum to prediction − base.
Hallucination
Models state false things fluently; make it rarer and catch it
Hallucination: ground, cite, allow “I don’t know”, check, review.
Ask about a paper that does not exist, and a model may name an author and a university, fluently. It predicts likely words, not checked facts. You cannot switch that off, so you stack defences. Give it the facts with RAG. Ask for citations, and let it say it does not know. Lower the temperature for factual work. Check its claims against the sources automatically. And have a person review where mistakes are costly.
Prompt injection
Prompt injection makes a model obey text it should only read
Direct from the user; indirect hidden in data the model reads.
Models read instructions and data in the same stream of text, and cannot reliably tell them apart. In direct injection, the user types an attack. In indirect injection, the attack hides in something the model reads: here, invisible text in an email. The assistant, asked only to summarise, obeys it and forwards the inbox. The fix is less about filtering text and more about limiting what the model is allowed to do.
Prompt injection · Going deeper
OWASP Top 10 for LLM applications
Ten risks, from prompt injection to unbounded consumption.
Guardrails
Guardrails filter what goes into and comes out of a model
Input checks, the model, output checks, human review when unsure.
Guardrails wrap the model in checks it cannot argue with. A message arrives. Input checks look for prompt attacks, banned topics and personal data, and can block it with a set reply. The model answers. Output checks filter harmful content, redact personal data, and test the answer against its sources. Low-confidence cases go to a person. Only then does the user see it.
Governance and regulation
Rules scale with risk: the EU AI Act and management frameworks
Unacceptable, high, limited, minimal risk; NIST AI RMF; ISO/IEC 42001.
The EU AI Act sorts AI by risk. A few uses are banned outright, like social scoring. High-risk uses, such as hiring and credit, carry strict duties: risk management, good data, logs, human oversight. Limited risk means telling people they are dealing with AI. Most systems are minimal risk, with no new duties. Inside companies, frameworks such as NIST’s AI risk management framework and ISO 42001 organise the work.
Governance and regulation · Going deeper
When the EU AI Act applies
Bans and general-purpose AI rules apply now; high-risk duties later.
Lesson complete
You finished “Responsible AI and security”
Nicely done.