Design Layered Content Safety Filtering for a Copilot Chat Experience
Last updated: November 29, 2026
Quick Overview
Design the ML system that screens user prompts and model responses in a consumer Copilot chat for harmful content, jailbreak attempts and indirect prompt injection from retrieved web pages, without adding noticeable latency to streaming replies.
Microsoft
November 29, 20260
0
0 solved
Design the ML system that screens user prompts and model responses in a consumer Copilot chat for harmful content, jailbreak attempts and indirect prompt injection from retrieved web pages, without adding noticeable latency to streaming replies.
Microsoft's responsible AI requirements mean every Copilot surface runs content classifiers on inputs and outputs, and web-grounded chat adds prompt injection risk from retrieved pages. The interviewer checks a layered design, severity-based policies, streaming-aware output checks, and how classifiers are evaluated and updated against new attacks.
What the Interviewer Expects
- Screen inputs, retrieved content and outputs as separate stages
- Use multi-label severity classifiers for harm categories plus a jailbreak detector
- Handle streaming output with incremental checks and retraction
- Treat retrieved documents as untrusted and detect injected instructions
- Define policies per severity and surface (consumer vs enterprise)
- Evaluate with red-team sets, precision and recall per category, and over-blocking metrics
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How do you check a streamed response without waiting for the whole answer?
- How would you measure over-blocking of legitimate medical or security questions?
- How quickly can you respond to a new jailbreak that goes viral?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
- Categories: hate, sexual, violence, self-harm, plus jailbreak and prompt-injection attempts; severity levels per category.
- Added latency: under about 50 ms before the first token, near zero per st...
High-Level Design
- Input stage: classify the prompt (and conversation context) for harm severity and jailbreak patterns. Block, answer with a safe completion, or pass.
- Grounding stage: for retrieved web pa...
Submit Your Answer
Microsoft Machine Learning Engineer Interview Guide
Interview process, tips, and preparation timeline