msnugget
Stop Your AI From Going Rogue: Content Safety in Microsoft Foundry
10 By Jannik Reinhard & Florian Salzmann · Published · Updated

Stop Your AI From Going Rogue: Content Safety in Microsoft Foundry

The Problem

You’ve deployed a generative AI app on Azure. Users start chatting — and suddenly your model outputs harmful content, falls for a prompt injection, or hallucinates confidently. Without guardrails, every AI deployment is one creative prompt away from a PR disaster. The challenge: building a safety layer that’s actually configurable, not just a black box.

The Nugget

Microsoft Foundry Content Safety gives you a fully configurable, multi-layered safety system — from harm detection and prompt injection shields to hallucination catching and copyright protection — all manageable through the Foundry portal or API.

How to Set It Up

  • Open the Foundry Portal → Navigate to your project → Go to Safety + SecurityContent filters

  • Create a new content filter — give it a descriptive name (e.g., prod-chatbot-strict)

  • Configure Input Filters — set severity thresholds (Low / Medium / High) for the four harm categories: Violence, Hate, Sexual, and Self-harm. Enable Prompt Shields in Block mode to catch jailbreak and indirect injection attempts.

  • Configure Output Filters — same severity controls for model completions, plus enable Groundedness Detection (catches hallucinations), Protected Material Detection for text and code, and PII Detection.

  • Add Blocklists (optional) — create custom blocklists for brand-specific terms or enable the built-in profanity blocklist.

  • Associate the filter with your deployment — each deployment gets exactly one active filter configuration.

What Each Layer Does

LayerProtects AgainstDirectionHarm Categories (4x)Violence, hate, sexual, self-harm contentInput + OutputPrompt ShieldsJailbreak attacks + indirect prompt injectionInputGroundedness DetectionHallucinations / ungrounded claimsOutputProtected Material (Text)Copyrighted text (lyrics, articles)OutputProtected Material (Code)Code matching public GitHub reposOutputPII DetectionNames, addresses, SSNs in responsesOutputCustom CategoriesYour own classifiers (just provide examples)Input + OutputCustom BlocklistsSpecific terms you want blockedInput + Output

Why This Matters

  • Prompt injection is OWASP’s #1 LLM threat — Prompt Shields is one of the first real-time defenses available at GA level

  • Groundedness Detection auto-corrects hallucinations — the correction feature rewrites ungrounded text aligned to your source data

  • Flexible deployment — runs on cloud, on-premises via containers, or embedded on devices

  • No ML experience required — Custom Categories let you train a new classifier with just a text description or a few examples

💡 Pro Tip: Don’t use the same filter config for input and output. Input filters should focus on prompt injection (Prompt Shields). Output filters should focus on harmful generation, groundedness, and copyright. Also: use Async mode for streaming scenarios — it runs filters in parallel and significantly reduces the 100–300ms latency hit of synchronous filtering.

Try It Now

Head to the Microsoft Foundry Portal, open your project, and create your first custom content filter under Safety + Security → Content filters. Start with the recommended defaults for your scenario:

  • B2C chatbot: Medium threshold + Prompt Shields (Block) + Protected Material + Groundedness

  • Internal B2B tool: Low threshold (fewer false positives with technical content)

  • Education platform: High threshold + all safety features + aggressive blocklists

📖 Full documentation: Content Safety Overview on Microsoft Learn

Stop Your AI From Going Rogue: Content Safety in Microsoft Foundry means using safety filters, prompt protection and monitoring before generative AI apps reach production users. The Microsoft Foundry context matters because content safety is part of the operational guardrail for enterprise AI workloads.