Responsible AI for Visual Content
image harm categories · severity and blocking levels · Analyze image · Prompt Shields · provenance and watermarks · custom categories
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Classify unsafe images
The content filtering system classifies harm into four categories for text and image: hate and fairness, sexual, violence, self-harm. It uses neural multiclass classification models.
| Content type | Severity values returned |
|---|---|
| Image | 0, 2, 4, 6 (trimmed scale) |
| Image with text (multimodal) | Full 0 to 7 scale; can be mapped to 0, 2, 4, 6 if you specify |
| Safe level | Annotated, never blocked, not configurable |
| Blocking level | Blocks |
|---|---|
| Off | Nothing (annotations can still be returned); modified Guardrails on output need approval |
| Low | High severity only (least restrictive) |
| Medium (default) | Medium and high severity |
| High | Low, medium and high severity (most restrictive) |
- Core-harm filters evaluate both user prompts (input) and model completions (output). Classifiers can give false positives and false negatives; a Safe result does not mean the content is free of other risks.
- Vision-enabled chat models also use model-level mitigation to identify individuals or infer sensitive attributes. Image generation models use model-level mitigation for protected material (art and studio characters). These are not configurable through guardrail settings.
- Request-level guardrail specification is not available for image input (chat with images); the default guardrail is used.
- Azure AI Content Safety cannot detect illegal child exploitation images.
Analyze image API
Analyze image scans images for sexual content, violence, hate and self-harm with multiple severity levels. Python: azure-ai-contentsafety.
client = ContentSafetyClient(endpoint, AzureKeyCredential(key))request = AnalyzeImageOptions(image=ImageData(content=file.read()))response = client.analyze_image(request)- Read
response.categories_analysis: each item has acategory(ImageCategory) and aseverity.
- Input an image as a base64 local filestream (recommended) or as a Blob Storage URL. An animated format is analyzed by its first frame.
- In Foundry, Guardrails + controls then Try it out has a Moderate image content panel; it returns severity per category and an Accepted or Rejected result from your filter settings.
- Image with text: the multimodal API analyzes the image, text in it (
enableOcr) and associated text. It retires April 30, 2027; the replacement is Analyze Image plus OCR (Document Intelligence or Content Understanding) plus Analyze Text.
Indirect prompt injection and Prompt Shields
| Attack | Where it comes from | Default in Foundry |
|---|---|---|
| User prompt attack | Malicious user input that tries to bypass system instructions (field userPrompt) | Enabled |
| Document attack (indirect) | Hidden instructions in documents, emails or web pages (field documents) | Off; must be enabled |
- Prompt Shields analyze supplied text. Document attacks are scanned at the user input point for model API calls, and also at the tool response point for agents with supported tools (Preview).
- Spotlighting (preview): tags documents as lower trust by base-64 encoding them. Off by default; Chat Completions API only; raises token use; the response can mention base-64 encoding.
- In Foundry you choose block or annotate. In the standalone Content Safety API (one
userPrompt, up to fivedocuments) the API does not block: your application readsattackDetectedand acts. - Prompt Shields do not judge harm, accuracy, grounding or policy fit; use other controls for those.
Learn describes Prompt Shields for text. It gives no steps for reading text inside image pixels with Prompt Shields. Its retirement notice for Analyze Multimodal points to OCR text extraction (Document Intelligence or Content Understanding) followed by Analyze Text for extracted text.
Visual policy rules: provenance, symbols and custom detection
| Policy need | Learn-backed tool | Key facts |
|---|---|---|
| Is this media AI-made or credentialed? | Content Provenance Detection (Detect API) | Finds C2PA Content Credentials and invisible watermarks in image, audio and video; asynchronous; types Watermark or C2PA |
| Credentials on generated images | Default image generation policy | A Content credentials row applies to completions |
| Prohibited symbols and hate imagery | Image harm categories | Image severity examples: Low lists Nazi symbolism, the confederate flag and Ku Klux Klan symbolism; Medium lists the Nazi flag and confederate flag; High lists glorified Nazi, Confederate flag and Ku Klux Klan symbolism |
| Protected art and studio characters | Default image generation mitigation | Model-level, not configurable through guardrail settings |
| New harmful image trend | Custom categories (rapid) | Define an incident from a few examples; image flow: create incident, add samples, deploy, detect; retires April 30, 2027 |
| Inappropriate content | Harm categories and blocking levels | Pick the blocking level per category |
- Provenance Detect call: POST
/contentsafety/provenance:detectwith a blob URI, then poll/contentsafety/provenance/operations/{id}until the status leaves NotStarted and Running. - Setup: Microsoft Entra token for
https://cognitiveservices.azure.com; Cognitive Services User on the Content Safety resource; the resource's managed identity needs Storage Blob Data Reader on the storage account (role assignments can take up to 5 minutes). - No marker found (
NoProvenanceDetected) does not mean the file is inauthentic. - Submit rate for provenance detection is 1 request per 10 seconds on both F0 and S0.
Learn pages in the cache do not describe an app feature to stamp visible watermarks on generated images or a brand-usage (logo or colour) checker. Do not assume Foundry offers one.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| Analyze an image (Python, azure-ai-contentsafety) | response = client.analyze_image(request) | - |
| Install the Content Safety Python library | python -m pip install azure-ai-contentsafety | - |
| Submit a provenance detection job (REST) | - | Invoke-WebRequest -Method POST "$endpoint/contentsafety/provenance:detect?api-version=$version" |
Exam Tips
Tick each tip once you can answer it without looking.
“Harm categories for images” → Hate and fairness, sexual, violence, self-harm. Trap: User prompt attacks (jailbreak) and protected material are separate controls.
“Severity values from the image classifier” → 0, 2, 4, 6. Trap: The full 0 to 7 scale belongs to image with text (multimodal).
“Default blocking level for the four core harms” → Medium: blocks medium and high severity. Trap: Low severity passes at Medium.
“Block even low-severity imagery” → Set the blocking level to High (most restrictive). Trap: The Low level blocks high severity only.
“Safe-level content” → Annotated, never blocked, not configurable. Trap: A Safe result does not prove other risks are absent.
“Python call to moderate an image” → request = AnalyzeImageOptions(image=ImageData(content=file.read())), then response = client.analyze_image(request); read categories_analysis. Trap: ImageCategory is for reading results, not building the request.
“Chat with an image and a request-level guardrail” → Not available for image input: the default guardrail is used. Trap: The usual request-level override does not apply here.
“Moderating an animated image” → The service analyzes the first frame. Trap: It does not score every frame.
“Retiring Analyze Multimodal (April 30, 2027): what next?” → Analyze Image + OCR (Document Intelligence or Content Understanding) + Analyze Text. Trap: Custom categories (rapid) retires on the same date.
“Hidden instructions in an email or web page the assistant reads” → Document attack: enable document attack detection (off by default). Trap: User prompt attack detection is the one that is on by default.
“Which field holds third-party text in the standalone Prompt Shields API?” → documents (up to five); the user's question goes in userPrompt. Trap: Swapping the fields skips the document attack check.
“Spotlighting” → Preview; off by default; Chat Completions only; base-64 encodes documents to mark them lower trust. Trap: It adds document tokens because of base-64 encoding, and large documents can exceed input size limits.
“Prompt Shields flagged an attack but the app still used the document” → The standalone API does not block; your application must act on attackDetected. Trap: Foundry blocking is a separate setting.
“Is this image AI-generated or credentialed (C2PA, watermark)?” → Content Provenance Detection Detect API (asynchronous: submit, then poll). Trap: Analyze image scores harm; it does not read provenance.
“Detect API says NoProvenanceDetected” → No recognized markers were found; it does not prove the file is inauthentic. Trap: Do not read it as a fake or edited verdict.
“React fast to a new harmful image trend with a few samples” → Custom categories (rapid): create incident, add samples, deploy, detect (retires April 30, 2027). Trap: It is preview and retiring; plan the migration.
Sources
- Harm categories in Azure AI Content Safety
- Azure AI Content Safety overview
- Quickstart: Analyze image content
- Quickstart: Analyze multimodal content
- Content Provenance Detection API
- Use the custom categories (rapid) API
- Prompt Shields in Microsoft Foundry
- Default safety policies in Microsoft Foundry
- Configure guardrails and controls
- Sora 2 video generation overview
- How to use image generation models from OpenAI
Checked against Microsoft Learn on November 13, 2026.