Implement a responsible generative AI solution in Microsoft Foundry | AI-103 | Episode 6
Generative AI is non-deterministic: the same system can produce unexpected or harmful outputs. Responsible AI therefore needs to be engineered into the complete application lifecycle—not added as a final check.
The core lifecycle
MAP → MEASURE → MITIGATE → DEPLOY & MONITOR ↻
| Step | Engineering focus |
|---|---|
| Map | Identify harms, attack vectors, risky inputs and misuse scenarios |
| Measure | Evaluate actual model outputs against those risks |
| Mitigate | Add multiple, layered controls |
| Monitor | Observe production behavior and feed new risks back into Map |
Defense in depth
Think of safety as an AI request/response pipeline:
Input → UX Controls → System Prompt + Grounding → Guardrails → Model → Guardrails → Output
UX controls limit the attack surface, for example through input or conversation limits. System prompts and grounding constrain model behavior, but prompts alone are not a security boundary.
Microsoft Foundry guardrails add enforcement around the model and can intervene before input reaches the model and after output is generated. Controls can target:
Jailbreaks · Hate · Violence · Sexual content · Self-harm · Protected material · Groundedness · PII
Guardrails have configurable blocking thresholds, allowing stricter policies for higher-risk applications.
Model refusal ≠ Guardrail blocking
This distinction matters:
Model refusal: Request → Model → "I can't help with that."
The model received and processed the request.
Guardrail blocking: Request → Guardrail → BLOCKED ⛔ → Model
The unsafe request never reaches the model.
What to remember
There is no single safety control. Combine UX restrictions, system instructions, grounding, guardrails, appropriate model selection, evaluations, and production monitoring.
Treat responsible AI like security engineering: identify → test → defend → monitor → repeat.
Comments