Create an Azure AI Content Safety resource in the Azure portal and note the endpoint URL and subscription key.
Send a POST request to {endpoint}/contentsafety/text:analyze?api-version=2024-09-01 with the text payload and Ocp-Apim-Subscription-Key header.
The response returns a categories array with a severity field for each detected harm category (Hate, Sexual, Violence, SelfHarm).
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.
To receive all eight severity levels (0–7), include outputType: EightSeverityLevels in the request body.
Use the severity scores against your policy thresholds to decide whether to allow, review, or block the content.
Known gotchas
The severity scale is 0–7 internally, but the default API output uses only {0, 2, 4, 6} — do not describe it as a 0–6 scale; the maximum possible value on the full scale is 7.
Classification can be multi-labeled: a single text sample may receive non-zero severity scores for more than one harm category simultaneously.
The image model always returns the trimmed {0, 2, 4, 6} output; the EightSeverityLevels option applies to text and multimodal (image-with-text) inputs only.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp