Lesson 2 of 6 Responsible AI Principles

Designing AI Systems for Reliability and Safety

This lesson explains reliability and safety, the principle that AI systems should perform reliably and safely, both under normal conditions and when they meet unexpected input or deliberate misuse.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain what reliability and safety mean for an AI system.
  • Identify the practices that support reliability and safety, such as adversarial testing and grounding.
  • Match a control to a reliability or safety risk.

What reliability and safety mean

A reliable AI system behaves as its designers intended, consistently, across the conditions it will encounter in use. A safe system avoids causing harm, responds sensibly to unusual input and resists attempts to manipulate it. Because AI output is probabilistic, reliability is never assumed; it is demonstrated through testing and maintained through monitoring.

Generative AI introduces specific risks. Models can produce fabricated statements (hallucinations) that sound plausible. They can generate harmful content such as hate, sexual, violent or self-harm content. And they can be manipulated by jailbreak prompts that try to override their instructions, or by indirect prompt injection, where instructions are hidden in a document, web page or email that the model processes.

Sort into groups

Name the risk

Exam skills 1.1.2

Identify the generative AI risk behind each incident.

Log in to try this activity Interactive activities are free with an account.

Supporting reliability and safety

Teams test systems with realistic and adversarial data before release, define what the system should do when it is uncertain (such as handing over to a person), ground answers in trusted data to reduce fabrication, and monitor behaviour after release. Systems with physical or medical consequences require especially rigorous testing and human oversight.

Microsoft Foundry supports this principle with guardrails, which are assigned to model deployments and agents. A guardrail's content filters classify hate, sexual, violence and self-harm content in prompts and responses by severity and block content above a configured threshold. Prompt Shields detect user prompt attacks (jailbreaks) and indirect attacks in documents. Other controls detect protected material, such as copyrighted lyrics or code, in model output. Deployments use a default guardrail unless a custom one is assigned.

The following diagram places the guardrail controls around a model.

Controls that support reliability and safety around a model in Foundry. A guardrail is assigned to a model deployment or agent. On the way in, Prompt Shields detect jailbreak attempts and indirect attacks in documents, and content filters classify hate, sexual, violence and self-harm content by severity. On the way out, content filters check the response again and protected material detection finds copyrighted text or code. Testing before release and monitoring after it surround the whole system.
Guardrails check both the prompt and the response.
Scenario questions

Choose the control

Exam skills 1.1.2

Choose the measure or guardrail control that addresses each risk.

Log in to try this activity Interactive activities are free with an account.
Worked example

Matching a control to a risk

A school deploys a homework-help chatbot. Testers find that students can make it produce violent stories by claiming to be writing a novel, and that it sometimes invents historical dates. Which principle do these findings concern, and which measures address them?

Both findings show the system behaving unsafely or unreliably, so the principle is reliability and safety.

A guardrail with stricter violence filtering and Prompt Shields addresses the harmful stories and the jailbreak-style framing. Grounding answers in a trusted textbook and instructing the model to say when it does not know addresses the invented dates. Publishing the chatbot's limitations would support transparency but would not stop either behaviour.

Check yourself

What do guardrails apply to model deployments and agents?

Show answer

Content filters and Prompt Shields, which detect harmful content and jailbreak attempts.

Exam Tips

Remember for the exam

  • Fabrication, harmful content and jailbreaks are reliability and safety risks.
  • Guardrails apply content filters and Prompt Shields to deployments and agents.
  • Testing with adversarial input and monitoring after release support this principle.