Analyze text and interpret severity scores with Azure AI Content Safety

domain: learn.microsoft.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create an Azure AI Content Safety resource in the Azure portal and note the endpoint URL and subscription key.
  2. Send a POST request to {endpoint}/contentsafety/text:analyze?api-version=2024-09-01 with the text payload and Ocp-Apim-Subscription-Key header.
  3. The response returns a categories array with a severity field for each detected harm category (Hate, Sexual, Violence, SelfHarm).
  4. Interpret severity values: the underlying model uses a 0–7 scale, but default API output maps adjacent pairs to the trimmed set {0, 2, 4, 6} — where 0 is safe and 6 is high severity.
  5. To receive all eight severity levels (0–7), include outputType: EightSeverityLevels in the request body.
  6. Use the severity scores against your policy thresholds to decide whether to allow, review, or block the content.

Known gotchas

Related routes

Retrieve full 0–7 severity scores from Azure AI Content Safety
learn.microsoft.com · 5 steps · unrated
Moderate game chat text using Azure AI Content Safety API
learn.microsoft.com · 5 steps · unrated
Evaluate a RAG pipeline's faithfulness, answer relevancy, and context precision/recall with Ragas against a labeled test set
docs.ragas.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans