Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 2 of 30
❮Prev Next❯

Responsible AI: Principles, Harms and Mitigations

Module 1: Responsible AI ⏱ 10 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Responsible AI means using AI in a way that's fair, safe and accountable. Microsoft's six principles are fairness, reliability and safety, privacy and security, inclusiveness, transparency and accountability. With Copilot, the harms to watch are hallucinated or insecure code, bias, licensing questions, privacy leaks and over-reliance, and you reduce them with human review, tests, code scanning, content exclusions, the public code filter, fake sample data and being open about AI use.

    Simulate it » No Azure account needed

    Exam objective: 1.1.2 Describe ethical and responsible AI usage. 1.1.3 Identify potential harms and mitigation strategies of AI usage. (Skills measured as of August 7, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    VS Code & GitHub: Use Copilot responsibly in a team Spot bias, protect data and keep a human in the loop.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading…

    Responsible AI principles (fairness, reliability and safety, privacy and security, inclusiveness, transparency, accountability) apply to code too. Watch for <strong>bias</strong> and assumptions in generated text and logic.

    👆 Click the glowing item on screen to continue

    Read the steps as text
    1. Responsible AI principles (fairness, reliability and safety, privacy and security, inclusiveness, transparency, accountability) apply to code too. Watch for bias and assumptions in generated text and logic.
    2. Privacy: don’t paste secrets or personal data into prompts; use content exclusions for sensitive files.
    3. Transparency and accountability: say when AI helped, keep a person reviewing every change, and own the result. Harm is reduced by review, tests, scanning and policies, not by trusting the tool.

    🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.

    😟 THE PROBLEM

    A team ships AI-written code nobody really reviewed.

    😊 THE SOLUTION

    Apply responsible AI principles to how the team uses Copilot.

    • Nobody owns the result✓ A human reviewer for every change
    • Secrets pasted into prompts✓ Fake data and content exclusions
    • Nobody knows AI helped✓ Be open about AI use
    🛠️ Solved with: Responsible AI

    Start with a question

    If Copilot writes a bug that leaks customer data, who gets the phone call at 2 a.m.?

    You do. Or your team lead. Not Copilot.

    That one answer explains most of responsible AI. The tool can draft code faster than any of us, but it can’t be held responsible, so people have to be. Responsible AI is the set of principles and habits that keep a person in charge: checking for bias, protecting data, being open about AI use, and owning the result.

    Explain it like I’m 10

    The technical explanation

    Microsoft describes six responsible AI principles. GitHub builds Copilot with them in mind, and the GH-300 exam expects you to know them and apply them to everyday coding.

    The six principles, in Copilot terms

    PrincipleWhat it meansWhat it looks like with Copilot
    FairnessNo unfair treatment of groups of peopleCheck generated validation, sample data and messages for assumptions about names, genders, regions or languages
    Reliability and safetyWorks as intended and fails safelyTest suggestions, cover edge cases, don’t ship code you don’t understand
    Privacy and securityProtects data and resists attackNo secrets or real personal data in prompts, content exclusions, code scanning
    InclusivenessWorks for people of all abilities and backgroundsAsk for accessible UI (labels, contrast, keyboard use) and test it
    TransparencyPeople understand the system and know when AI was usedSay in the pull request when Copilot drafted code; know its limits
    AccountabilityPeople stay responsibleA person reviews, approves and owns every change

    The last two are the ones people forget. Transparency isn’t about blame. It helps reviewers know where to look harder. Accountability means “Copilot wrote it” is never a reason a bug shipped.

    Harms and the mitigation for each

    The exam likes to pair a harm with the right fix. Learn these as pairs.

    HarmExampleMitigation
    Hallucination / wrong codeAn API that doesn’t exist, a function that returns NaNHuman review, tests, checking the docs
    Insecure codeString-built SQL, missing input checksCode scanning (for example CodeQL), secure review, dependency review
    BiasA form that rejects one-word namesDiverse test data, review for assumptions
    IP and licensingA suggestion that matches public codePublic code filter (Block, or Allow with code references), licence check
    Privacy leaksReal customer data pasted into chatFake sample data, content exclusions, team guidance
    Over-relianceAccepting everything with Tab, skills fadingReview every suggestion, understand before you accept

    Here’s a small fairness example in contoso-shop:

    // Copilot's first suggestion
    const valid = /^[A-Za-z]+ [A-Za-z]+$/.test(fullName);
    // Rejects "Siddharth", "O'Brien", "José García" and many real names

    The fix is less clever code: accept any non-empty display name, and test with names from different cultures.

    Architect level Policies help, people still decide

    An organization can set Copilot policies (which features are on, whether suggestions matching public code are blocked, which models and MCP servers are allowed) and content exclusions. Those reduce risk across hundreds of developers. They don’t make a suggestion correct or fair. Responsible use is the mix of both: guardrails from admins, and a person who reviews, tests and owns each change.

    Real-world business scenario

    Online retail

    Contoso Shop (fictional)

    The problem
    Copilot was rolled out to 60 developers with no guidance. Within a month, one pull request included real customer emails used as test data and another had name validation that rejected many international customers.
    What they used
    A short responsible AI guide built on the six principles, a pull request template asking whether Copilot helped, fake sample data for tests, content exclusions for the customer export folder, the public code filter set to Block, and required reviews with CodeQL scanning.
    Why that choice
    Each harm got a matching mitigation, and the template made transparency normal instead of awkward. Reviewers knew which parts to read more carefully.
    The result
    No more real data in test fixtures, international sign-ups stopped failing, and the team kept the speed gains from Copilot.

    When to use it and when not to

    ✓ Use it when…

    • Every time you use Copilot: the principles apply to small suggestions as much as big features.
    • Code that touches people directly, such as forms, names, addresses, accessibility and personal data.
    • Setting team rules for a Copilot rollout.

    ✕ Think twice when…

    • Treating the principles as a one-off training slide with no checks in the pipeline.
    • Relying on Copilot policies alone to make output safe or fair.
    • Hiding AI use from reviewers.

    ↔ Alternatives to consider

    • Organization policies and content exclusions to enforce part of this for everyone.
    • Pull request templates and required checks to make review and transparency routine.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A developer merges code suggested by GitHub Copilot, and the code later causes a production incident. According to responsible AI principles, who is accountable for the code?

    Question 2

    Question 2 of 5

    A team adds a pull request template that asks contributors to state whether GitHub Copilot helped write the change. Which responsible AI principle does this practice support most directly?

    Question 3

    Question 3 of 5

    GitHub Copilot generates a name validation regular expression that rejects names containing apostrophes or accented characters. Which responsible AI principles are MOST directly affected?

    Question 4

    Question 4 of 5 · Select 2

    A company wants to reduce the risk of sensitive data being exposed when developers use GitHub Copilot Business. Which TWO actions should the company take?

    Question 5

    Question 5 of 5

    You need to mitigate the risk that GitHub Copilot suggestions closely match code from public repositories with incompatible licenses. What should you configure?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Name Microsoft's six responsible AI principles.

    Model answer

    Fairness, reliability and safety, privacy and security, inclusiveness, transparency, and accountability. I remember that the last two are about people: say when AI was used, and someone owns the result.

    Intermediate Copilot wrote a sign-up form that rejects names with an apostrophe. Which principle does that touch, and what do you do?

    Model answer

    Fairness and inclusiveness, because it fails for real people with names like O'Brien. I'd fix the validation, add test cases with names from different cultures, and mention the pattern to the team so reviewers look for it.

    Interviewer follows up

    Is that Copilot's fault?

    You

    It's where the bias came from, but accountability sits with us. We accepted and merged it, so we own fixing it.

    Experienced developer Which Copilot features help with the privacy and security principle?

    Model answer

    Content exclusions keep sensitive paths out of Copilot's context, the public code filter can block matching suggestions, and on Business and Enterprise plans our code isn't used to train models. On the team side, we don't paste secrets or real customer data into prompts, and code scanning checks what Copilot writes.

    Scenario Your manager asks whether you should tell reviewers that a pull request was mostly written with Copilot. What do you say?

    Model answer

    Yes. That's the transparency principle. A short note in the description helps reviewers look harder at the parts that came from AI, and it's honest. It doesn't lower the bar; the code still gets the same review and tests.

    Architecture & design How would you turn responsible AI principles into something enforceable for 200 developers?

    Model answer

    Policies and pipelines, not just a slide. Organization Copilot policies for the public code filter and allowed features, content exclusions for sensitive repos, required reviews and status checks with tests and code scanning, a pull request template that asks about AI use, and short training on the known harms.

    Quick revision

    Key points

    • Six principles: fairness, reliability and safety, privacy and security, inclusiveness, transparency, accountability.
    • Harms with AI coding tools: hallucinated or insecure code, bias, IP and licensing questions, privacy leaks, over-reliance.
    • Each harm has a matching mitigation, and human review sits under all of them.
    • Accountability stays with the people who accept and ship the code, never with the tool.
    • Transparency means telling people when AI helped and being clear about its limits.
    • Use fake sample data, never real personal data or secrets, in prompts.

    Important terminology

    Responsible AI
    Designing and using AI so it's fair, safe, private, inclusive, transparent and has a person accountable for it.
    Fairness
    AI systems should treat all people fairly and not produce biased results for some groups.
    Reliability and safety
    AI systems should behave as intended, including in unexpected conditions, and fail safely.
    Privacy and security
    AI systems should protect personal and confidential data and resist attacks.
    Inclusiveness
    AI systems should work for people of all abilities and backgrounds.
    Transparency
    People should understand how an AI system works, its limits, and when AI was involved.
    Accountability
    People remain responsible for AI systems and the results they produce.
    Human in the loop
    A person reviews and approves AI output before it takes effect.

    Common mistakes

    • Treating Copilot as accountable for a bug it suggested.
    • Pasting real customer records into chat to "get better answers".
    • Thinking policies alone make AI use responsible without review and tests.

    Exam tips

    • "Who is responsible for AI-generated code" = the developer and team (accountability).
    • "Disclose that AI helped write this" = transparency.
    • "Works for users of all abilities and backgrounds" = inclusiveness.
    • "Keep sensitive files out of Copilot" = content exclusions (privacy and security).

    Five quick revision questions

    1. 1.Which principle says people stay responsible for AI results?Show

      Accountability.

    2. 2.Which principle covers biased output against a group?Show

      Fairness.

    3. 3.Which mitigation fits the harm of matching public code?Show

      The public code filter (Block, or Allow with code references) plus a licence check.

    4. 4.Which mitigation fits privacy leaks in prompts?Show

      Don't paste secrets or personal data, use fake data and content exclusions.

    5. 5.What mitigation applies to every harm?Show

      Human review, backed by tests and scanning.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Validate Copilot Output and Use It Responsibly

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.