Courses / Getting Started with AI

Session 8 of 8

Responsible AI in Practice

Overview

Chapter 8 — Responsible AI in Practice

Course: Getting Started with AI

Prerequisites: You can read and run a short Python script that uses dictionaries, lists and division. You know that a model-backed feature can be placed before real users, and that checks can be written in code between the model and the user. Every other term, including selection rate and impact ratio, is defined in the notes before it is used.

What the reader can do after this chapter:

  • Turn a vague requirement such as “be fair and transparent” into a short list of release checks, each of which is true or false for a given system.
  • Compute selection rates for groups of people, compare each with the highest, and flag a group whose ratio falls below a stated threshold.
  • Check a set of conversations for an AI disclosure line and a release manifest for the conditions that must hold before launch, and decide release or block.

Core question this chapter answers: What must be true of an AI system before it faces users, stated so that someone can check each item and say yes or no?

Connections:

  • Builds on: guardrails at the boundary (taught in Building AI Agents), where rules are enforced in code; this chapter adds the conditions about people: telling them, treating groups comparably, and letting a person contest an outcome.
  • Leads into: a chapter in Taking AI to Production, which makes a system’s behaviour visible after launch: tracing one request end to end and recording tokens and cost.

Your answers are scored

This chapter is assessed. The quiz is marked against a key held separately from your materials. Questions 1–8 are multiple choice and are marked by comparing your letter with the key. Questions 9–10 ask for a short answer in an exact format, and each one is marked by a rule printed with the question.

  • Nothing is judged by reading it for style. An answer either matches the rule or it does not.
  • All three project tasks are scored from an evidence file of key: value lines. Every accepted value, or the rule that decides it, follows from what the task prints.

Notes

Getting Started with AI — Chapter 8: Responsible AI in Practice

Before you start

Nothing to install for the reading. For the project you need Python 3 and nothing beyond its standard library. You do not need an account with any model provider or an API key: every conversation, count and manifest the project uses is printed in the project file.

This chapter mentions laws and a standard. It is a study text about engineering checks and not legal advice: which rules apply depends on where the system runs, who uses it and what it decides. Where a rule is named, the notes say what the cited text actually states and no more.

Keep one question in mind while you read: what would I have to show someone to prove this system was ready for users?

Summary

Responsible AI, as this chapter uses the phrase, is a set of conditions that must hold before a system faces users, each written so that it can be checked. One public framework from NIST organises AI risk work into four functions, govern, map, measure and manage, and is intended for voluntary use. A European regulation requires providers of systems that interact directly with people to design them so people are informed they are dealing with an AI, unless that is obvious. A US regulation on employee selection gives a screening measure, the four-fifths rule, for comparing selection rates between groups. A European data protection article gives people subject to certain solely automated decisions a right to human intervention and to contest the decision. Engineers turn these into checks: a disclosure line, a group comparison, a review path, a log and a named owner, combined in a release gate.

Key concepts

Term Definition
Release gate A written, checkable list of conditions that must all be true before a system launches.
AI RMF The NIST AI Risk Management Framework, “intended for voluntary use”, organised around four functions.
Govern, Map, Measure, Manage The four functions of the AI RMF: culture of risk management; context that frames risks; tools to analyse, assess and monitor risk; allocating resources to risks.
Disclosure Telling a person, in the interface, that they are interacting with an AI system.
Selection rate For a group: the number selected divided by the number of people considered, from 0 to 1.
Impact ratio A group’s selection rate divided by the highest group’s selection rate.
Four-fifths rule A screening rule of thumb: a group rate below four-fifths (0.800) of the highest group’s rate is generally regarded as evidence of adverse impact.
Human intervention A person with authority reviews an automated decision when the affected person asks.
Contest The affected person’s ability to challenge a decision and have the challenge considered.
Decision log A record of each automated decision with its inputs and result, so it can be reviewed later.
Owner A named person or team accountable for the system after launch.

Explanations

The failure, before the explanation

A bank’s loan-prefilter assistant is built, tested for accuracy and launched. Accuracy overall is high. Later an analyst compares outcomes by applicant group and finds that one group is passed on to a human underwriter far less often than the others. Nobody can say why, because decisions were not logged. Applicants who were turned away have no address to write to, and some did not realise a machine had screened them. Each gap was small and each was never on anyone’s launch list.

The model did not behave in a surprising way. The conditions around it were never written down as things that must be true.

Turning “be responsible” into checks

Start with an example. “Be transparent” is not a test. “The first message of every conversation says it is an AI assistant” is: a script can read conversations and answer yes or no. A second example: “be fair” is not a test; “the selection rate of every group is at least 0.800 of the highest group’s rate” is.

One public framework gives a structure for the whole effort. NIST says the AI Risk Management Framework is “a framework to better manage risks to individuals, organizations, and society associated with artificial intelligence (AI)” and “intended for voluntary use” (NIST, AI Risk Management Framework, retrieved 2026-10-04). Its four core functions are described there as:

  • Govern: “cultivates and implements a culture of risk management within organizations designing, developing, deploying, evaluating, or acquiring AI systems.”
  • Map: “establishes the context to frame risks related to an AI system.”
  • Measure: “employs quantitative, qualitative, or mixed-method tools, techniques, and methodologies to analyze, assess, benchmark, and monitor AI risk and related impacts.”
  • Manage: “entails allocating risk resources to mapped and measured risks on a regular basis and as defined by the govern function.” (NIST, AI RMF Core, retrieved 2026-10-04.)

A second way to see the functions: they are a project’s questions in order. Who is accountable (govern)? What is this system for and who does it affect (map)? What do the numbers show (measure)? What do we do about it (manage)? The release checks in this chapter are one team’s illustration of how those questions become yes/no items; the mapping is this chapter’s, not NIST’s.

  • Applied use: write each condition as a check that has an owner, an input and a yes/no result.
  • Practical consequence: a gate made of such checks is something you can run in a pipeline, show to a reviewer and re-run after a change.
  • Selection: a condition that cannot be made checkable is not yet a requirement; keep refining it until it can be.

Disclosure: telling people it is an AI

Picture a customer who types into a chat window and believes a person is answering. They share more than they would with a machine, and they would want to know. A second picture: a recorded telephone menu says it is automated before it asks for anything.

A European regulation states a duty on providers: “Providers shall ensure that AI systems intended to interact directly with natural persons are designed and developed in such a way that the natural persons concerned are informed that they are interacting with an AI system unless this is obvious from the point of view of a natural person who is reasonably well-informed, observant and circumspect, taking into account the circumstances and the context of use” (EU AI Act, Article 50(1), via artificialintelligenceact.eu, retrieved 2026-10-04). The same article has an exception for certain systems authorised by law to detect, prevent, investigate or prosecute criminal offences. Whether and how the article applies to a given system is a legal question; the engineering point is that disclosure can be designed in and tested.

  • Applied use: put the disclosure in the first message, in the interface itself, and test for it.
  • Practical consequence: a simple script can read stored conversations and list those whose first assistant message lacks the line.
  • Selection: do not rely on the model to choose to disclose; write the line in the application, so a prompt change cannot remove it.

Comparing groups: selection rate and impact ratio

An example with numbers. A screening feature considers 50 applicants from group A and selects 30; it considers 40 applicants from group B and selects 18. Group A’s selection rate is 30 ÷ 50 = 0.600; group B’s is 18 ÷ 40 = 0.450. The impact ratio of group B is 0.450 ÷ 0.600 = 0.750.

A second picture: two lifts in a building, one taking 60 of every 100 people up and one taking 45. The overall average hides that the second lift is slower; you only see it by comparing the lifts.

The regulation on employee selection procedures in the US states a screening rule: “A selection rate for any race, sex, or ethnic group which is less than four-fifths (4/5) (or eighty percent) of the rate for the group with the highest rate will generally be regarded by the Federal enforcement agencies as evidence of adverse impact” (29 CFR § 1607.4(D), retrieved 2026-10-04). The same paragraph says that “Smaller differences in selection rate may nevertheless constitute adverse impact, where they are significant in both statistical and practical terms”, and that a rate above four-fifths “will generally not be regarded” as evidence of adverse impact. In the example, 0.750 is below 0.800, so group B is flagged.

Three limits. The rule is a screening rule of thumb written for employee selection in one jurisdiction; this chapter borrows it as a worked example of a measurable threshold and does not claim it is the standard for every AI system. A flag is a reason to investigate, not a verdict. And a pass is not proof of fairness, for the reason the quoted text itself gives: smaller differences may still matter.

  • Applied use: compute the rates and ratios for every group on a labelled evaluation set and on live data, and put the lowest ratio in the release gate.
  • Practical consequence: because the measure is by group, it can reveal what an overall accuracy figure hides.
  • Selection: a threshold is a choice. State it before measuring, name its source, and say what happens when a group falls below it.

Letting a person contest an outcome

An example. An applicant is declined by an automated process and the message says only “Not approved”. They cannot ask anyone to look again, and nobody can see why. A second example: a message that says the decision was automated, gives an address, and promises that a person will review a challenge.

A European data-protection article gives, for certain decisions, “the right not to be subject to a decision based solely on automated processing, including profiling, which produces legal effects concerning him or her or similarly significantly affects him or her” (GDPR Article 22(1), retrieved 2026-10-04). Where the decision is allowed under the article’s exceptions, the controller must implement measures including “the right to obtain human intervention on the part of the controller, to express his or her point of view and to contest the decision” (Article 22(3)). The article has exceptions and a defined scope, so the engineering reading is narrower than the law: build a way for a person to ask for human review, and a log that makes the review possible.

  • Applied use: a review address or form, a person with authority to change the outcome, and a decision log entry for each automated decision.
  • Practical consequence: the log is what lets a reviewer reconstruct what the system saw and decided.
  • Selection: treat the review path as a release condition, not a later feature, for any system whose decisions significantly affect people.

The release gate

Bring the checks together. A gate reads a short manifest, a record of facts about the system, and tests each condition:

  1. ai_disclosure is true.
  2. The lowest group impact ratio is at least 0.800 (this chapter’s threshold, from the example rule above).
  3. A human review path is named (not empty).
  4. A decision log is switched on.
  5. An owner is named (not empty).

If every check passes, release; otherwise block, and name the failed checks. A second way to see it: a pre-flight checklist, where a pilot does not take off with one item unticked, however good the other four are.

Situation What it means What the gate does
Everything true except a low group ratio A measured disparity exists Block; investigate which group and why, fix or justify, measure again
No owner named Nobody is accountable after launch Block
A launch date is close Pressure is a reason to start earlier, not to weaken the gate Block until the checks pass; change the date, not the threshold

A gate is the chapter’s own device. NIST’s govern function is where you would decide who owns the gate and what happens when it blocks.

Flashcards

Say the answer aloud before revealing it. Speaking it is what exposes the gaps that reading past a written answer hides.

Why must a responsible-AI requirement be written as a check?

A vague requirement such as “be fair” cannot be run. A check with an input and a yes/no result can be automated, shown to a reviewer and re-run after a change.

Name the four functions of the NIST AI RMF.

Govern, map, measure and manage. NIST describes the framework as intended for voluntary use.

What does the map function do, in NIST's words?

It “establishes the context to frame risks related to an AI system”.

What does Article 50(1) of the EU AI Act ask of providers of systems that interact directly with people?

That they design the systems so people are informed they are interacting with an AI system, unless that is obvious to a reasonably well-informed, observant and circumspect person in context.

How would you test for a disclosure line?

Read the stored conversations and list those whose first assistant message does not contain it. Write the line in the application so a prompt change cannot remove it.

How do you compute a selection rate and an impact ratio?

Selection rate is the number selected divided by the number considered, per group. Impact ratio is a group’s rate divided by the highest group’s rate.

What does the four-fifths rule say, and what is it not?

A rate below four-fifths (0.800) of the highest group’s rate is generally regarded as evidence of adverse impact. It is a rule of thumb for employee selection: smaller differences can matter too, and passing it is not proof of fairness.

What does GDPR Article 22(3) say about human involvement?

Where a solely automated decision is allowed, the controller must implement measures including the right to obtain human intervention, to express a point of view and to contest the decision. The article has exceptions and a defined scope.

List the five checks in the chapter's release gate.

AI disclosure true; lowest impact ratio at least 0.800; a human review path named; a decision log on; an owner named.

The launch date is close and one group's ratio is 0.74. What does the gate do?

It blocks. Investigate the group, fix or justify, and measure again; move the date, not the threshold.

Model answer

The question: “What would you check before launching a model-backed system that makes decisions about people?” A strong answer hits five beats, in this order:

  1. Checkable — each condition written as a yes/no check.
  2. Disclosure — people are told they are dealing with an AI, in the product itself.
  3. Group comparison — selection rates and impact ratios by group against a stated threshold.
  4. Recourse — a way to reach a person who can review and change a decision, plus a decision log.
  5. Accountability — a named owner and a gate that blocks when any check fails.

“I’d turn the principles into checks someone can run. The product says in its first message that it’s an AI, and I’d test that on stored conversations. I’d compute selection rates for each group and the ratio to the highest, against a threshold stated beforehand: the four-fifths screening rule is a familiar one, bearing in mind it’s a rule of thumb. People affected need a way to ask a person to review a decision, and every decision goes in a log so the review can reconstruct it. There’s a named owner, and a release gate that blocks if any of this is missing, however close the launch date is.”

Missing a beat is a failure state. Without checkable the rest is aspiration. Without disclosure people may not know a machine is involved. Without group comparison an overall score hides gaps. Without recourse an error has no remedy. Without accountability nobody acts when a check fails.

Why this matters

  • Launch reviews. A gate with named checks is something a reviewer, a customer or a regulator can read and test.
  • Hiring, lending, triage and support. Wherever a system sorts people, group-level numbers show what a single accuracy figure hides.
  • Incident response. A decision log and a review path make it possible to find and fix a wrong outcome for a specific person.
  • Customer conversations. “What did you check before launch?” is answered with the list and its results.

After this chapter

The project for this chapter is Gate a Launch (project.md). You will compute selection rates and impact ratios for four groups, check eight conversations for a disclosure line, and run a release gate over four manifests.

Taking AI to Production starts after launch: tracing one request end to end, recording tokens and cost, and rebuilding why a particular answer happened, which a decision log and review path depend on.

Project

Hands-on Project — Gate a Launch

Objective

Compute group selection rates and impact ratios, check conversations for an AI disclosure line, and run a release gate over several launch manifests, so that you hold a small, re-runnable launch check whose every result is a yes or a no.

What this project needs: Python 3 with its standard library only. No task needs an account with a model provider, an API key, an internet connection or any payment. Every count, conversation and manifest the tasks use is printed below. All three tasks are required, and each can be done on its own, in any order.

Your evidence file. Keep one plain-text file, chapter8-evidence.txt. Each task tells you which lines to add. Every line has the form key: value, one per line, with the key in lower case exactly as printed. Write what your code printed, not what you expected it to print.

Task 1 — Compare groups

An automated screening step considered applicants in four groups. Each row is (group, number considered, number selected):

GROUPS = [("A", 50, 30), ("B", 40, 18), ("C", 60, 33), ("D", 25, 15)]
  1. Compute each group’s selection rate: selected ÷ considered.
  2. Find the highest rate. Compute each group’s impact ratio: its rate ÷ the highest rate.
  3. A group is flagged when its impact ratio is below 0.800 (strictly below).

Print rates and ratios to 3 decimal places, in group order A, B, C, D.

Add to your evidence file:

t1_rates: <four rates in group order, 3 decimal places, comma-separated, no spaces>
t1_ratios: <four ratios in group order, 3 decimal places, comma-separated, no spaces>
t1_flagged: <flagged group letters, in order, comma-separated, no spaces>

Output: a short script, and three evidence lines.

Task 2 — Check for a disclosure line

The first assistant message of eight stored conversations:

FIRST_MESSAGES = [
    ("t01", "Hi, I'm an AI assistant for order questions. How can I help?"),
    ("t02", "Hello! What can I do for you?"),
    ("t03", "This is an automated assistant. Ask me about returns."),
    ("t04", "Hi there, Sam here. How can I help today?"),
    ("t05", "I am your AI Assistant and may make mistakes."),
    ("t06", "Welcome. I am a virtual helper."),
    ("t07", "You are chatting with an automated assistant."),
    ("t08", "Hello, this chat is answered by an ai assistant."),
]

A message has the disclosure when, ignoring letter case, it contains the text automated assistant or the text ai assistant. Nothing else counts.

Add to your evidence file:

t2_missing_ids: <ids of messages without the disclosure, id order, comma-separated, no spaces>
t2_pass_count: <number of messages with the disclosure>

Output: a short script, and two evidence lines.

Task 3 — Run a release gate

Four systems each have a manifest. Each row is (system id, manifest):

MANIFESTS = [
    ("s1", {"ai_disclosure": True,  "min_impact_ratio": 0.91, "human_review_path": "appeals@desk",
            "decision_log": True,  "owner": "risk-team"}),
    ("s2", {"ai_disclosure": True,  "min_impact_ratio": 0.75, "human_review_path": "appeals@desk",
            "decision_log": True,  "owner": "risk-team"}),
    ("s3", {"ai_disclosure": False, "min_impact_ratio": 0.80, "human_review_path": "",
            "decision_log": True,  "owner": ""}),
    ("s4", {"ai_disclosure": True,  "min_impact_ratio": 0.80, "human_review_path": "appeals@desk",
            "decision_log": False, "owner": "risk-team"}),
]

Write failed_checks(manifest) returning the names of the failed checks, in this order, from these five rules:

  1. ai_disclosure fails unless the value is True.
  2. min_impact_ratio fails if the value is below 0.8 (strictly below).
  3. human_review_path fails if the value is empty or only spaces.
  4. decision_log fails unless the value is True.
  5. owner fails if the value is empty or only spaces.

A system is release if it has no failed checks, otherwise block.

Add to your evidence file:

t3_decisions: <four decisions in system order, comma-separated, no spaces>
t3_s3_failed_checks: <the failed checks for s3, in rule order, comma-separated, no spaces>

Output: a failed_checks function, and two evidence lines.

What carries forward

Keep chapter8-evidence.txt and your failed_checks function. The next course, Taking AI to Production, starts where this one stops: once a system is live, how do you record what it did, so that a decision log entry or a review request can be traced back to the request, the model call and the cost behind it?

TechEazy Consulting training material — not affiliated with or endorsed by OpenAI, Anthropic or any other company named in this course.