SaveMyCert
Log in
2 of 2 free questions left today·for 5 a day
Implement computer vision solutions

AI-103: Responsible AI for Images — Content Safety, Prompt Shields and Visual Policy

18 min readAI-103 · Implement computer vision solutionsUpdated

Responsible AI for multimodal content is the set of controls that check images — those users upload and those your models generate — for harmful content, hidden instructions and policy breaches before they are processed or published. This lesson covers AI-103 task 3.3: classifying unsafe images with Azure AI Content Safety and Foundry guardrails, detecting and mitigating prompt injection carried as text inside images, and enforcing visual policy rules such as watermarks, prohibited symbols and brand usage.

What you’ll learn

  • Classify unsafe images with the Content Safety Analyze Image API, interpret the 0/2/4/6 image severity scale and set application thresholds.
  • Apply image input rules: size and dimension limits, first-frame analysis of animations, and keyless blob access through the Content Safety resource's managed identity.
  • Moderate images together with their text using the multimodal API with enableOcr, and work around its 1,000-character limits.
  • Configure Foundry guardrail content-harm controls for image inputs and generated images: intervention points, blocking levels and modified-guardrail approval.
  • Detect indirect prompt injection in image text by extracting it and checking it as a Prompt Shields document, within the request limits.
  • Design mitigations for image-borne injection and choose proportionate responses to a detection.
  • Enforce visual policy: visible watermarks vs Content Credentials, custom categories (rapid) image incidents for prohibited symbols, and Content Understanding classify fields with rules in code for brand checks.

The 10 parts · about 12 min of reading

  1. What does responsible AI for multimodal content cover on AI-103?Start hereTask 3.3 covers filtering unsafe images, catching injection in image text and visual policy; services give signals, apps decide.1 min
  2. How do you classify unsafe images with the Content Safety Analyze Image API?Analyze Image scores Hate, Sexual, Violence and Self-harm on a 0, 2, 4, 6 scale; your app compares each severity with its own threshold.1 min
  3. What input limits apply to image analysis?Analyze Image takes up to 4 MB and 7,200 x 7,200 px, reads only an animation's first frame, and reads blobs with its own identity.1 min
  4. How do you moderate an image together with its text?The image-with-text API with enableOcr scores visuals and caption together but reads at most 1,000 characters of text.2 min
  5. How do Foundry guardrails filter images going into and out of a model?Guardrails block harmful images at user input and output for you; the High blocking level blocks low, medium and high severity.1 min
  6. How do you detect prompt injection hidden in image text?Extract an image's text and send it to Prompt Shields as documents; each gets an attackDetected verdict, up to five per request.1 min
  7. Why don't document attack detection and Spotlighting catch text in an image part?Document attack detection and Spotlighting act only on delimited document text, so send a photo's OCR text as a document.1 min
  8. How do you design an app to limit the impact of image-borne injection?Assume injection gets through: a tool-less extraction step, human approval and least privilege limit what injected text can do.1 min
  9. How do you apply watermarks and provenance to generated images?A visible label must be composited into the pixels; Content Credentials are a signed C2PA manifest seen only with a verifier.1 min
  10. How do you flag prohibited symbols and enforce brand rules?Built-in Hate flags known symbols, rapid image incidents flag new ones, classify fields check brands, and code makes the call.2 min

Mind map

Filter unsafe visual contentCatch injection in image textEnforce visual policy rulesServices give signals; apps decide1✓Scope of task 3.3Hate, Sexual, Violence, Self-harmImage severities: 0, 2, 4, 6 onlyScores only; app sets thresholdsSDK: ImageData(content=bytes)2✓Analyze ImageUp to 4 MB and 7,200 x 7,200 pxAnimated GIF: first frame onlyblobUrl: resource identity,Contributor3✓Input limitsenableOcr scores caption with imageText capped at 1,000 charactersLong text: also Analyze Text (10,000)4✓Image with textBlock at user input and outputBlocked input: HTTP 400 content_filterHigh level blocks low, medium and highOutput off needs Limited Accessapproval5✓Foundry guardrailsExtract image text, send as documentsattackDetected Boolean per documentMax 5 documents, 10,000 chars combined6✓Prompt ShieldsImage parts are not document textSpotlighting: Chat Completions onlySend OCR text as a delimited document7✓Document delimitersTool-less step extracts fixed fieldsHuman approval for consequential toolsWithhold flagged content, answer therest8✓Limiting impactVisible label composited into pixelsContent Credentials: signed C2PA,automaticEditing can strip the manifest9✓Watermarks and provenanceKnown hate symbols: Hate categoryNew symbols: rapid image incident,deployBrand checks: classify fieldsFinal decision in deterministic code10✓Symbols and brand rulesResponsible AI forimages
Mind map

AI-103: Responsible AI for Images — Content Safety, Prompt Shields and Visual Policy

Filter unsafe visual contentCatch injection in image textEnforce visual policy rulesServices give signals; apps decide1✓Scope of task 3.3Hate, Sexual, Violence, Self-harmImage severities: 0, 2, 4, 6 onlyScores only; app sets thresholdsSDK: ImageData(content=bytes)2✓Analyze ImageUp to 4 MB and 7,200 x 7,200 pxAnimated GIF: first frame onlyblobUrl: resource identity,Contributor3✓Input limitsenableOcr scores caption with imageText capped at 1,000 charactersLong text: also Analyze Text (10,000)4✓Image with textBlock at user input and outputBlocked input: HTTP 400 content_filterHigh level blocks low, medium and highOutput off needs Limited Accessapproval5✓Foundry guardrailsExtract image text, send as documentsattackDetected Boolean per documentMax 5 documents, 10,000 chars combined6✓Prompt ShieldsImage parts are not document textSpotlighting: Chat Completions onlySend OCR text as a delimited document7✓Document delimitersTool-less step extracts fixed fieldsHuman approval for consequential toolsWithhold flagged content, answer therest8✓Limiting impactVisible label composited into pixelsContent Credentials: signed C2PA,automaticEditing can strip the manifest9✓Watermarks and provenanceKnown hate symbols: Hate categoryNew symbols: rapid image incident,deployBrand checks: classify fieldsFinal decision in deterministic code10✓Symbols and brand rulesResponsible AI forimages

How the exam tests this

Expect short scenarios in which a company moderates uploads or generated images under a constraint — no model in the flow, no moderation code, no keys or SAS tokens, within a day without training, one request, least custom code, or the same decision for the same signals. You choose the right service (Analyze Image, the image-with-text API, a guardrail, Prompt Shields, a rapid image incident, a Content Understanding analyzer), the right setting (blocking level, intervention point, enableOcr, role assignment), or interpret results such as image severities and documentsAnalysis. Short Python items ask you to complete an SDK or REST call, and some items combine two facts, such as the trimmed image scale with an app threshold, or the per-request limits with a batching decision.

Key takeaways

  1. Analyze Image scores Hate, Sexual, Violence and Self-harm; the app compares each severity with its own threshold — the API never blocks.
  2. Image severities use only 0, 2, 4 and 6 (safe, low, medium, high); write image thresholds against those values.
  3. Images must be at most 4 MB and 50 x 50 to 7,200 x 7,200 pixels; animated images are judged by their first frame only.
  4. With a blobUrl, the Content Safety resource's system-assigned identity reads the blob and needs Storage Blob Data Contributor or Owner.
  5. The image-with-text API with enableOcr judges an image and its text together, but only up to 1,000 characters; score longer text with Analyze Text.
  6. Guardrail blocking levels: Low blocks high only, Medium blocks medium and high, High blocks everything above safe; safe content is never blocked.
  7. Turning a harm control off on outputs needs modified-guardrail approval; on inputs it doesn't.
  8. Prompt Shields reads text, not pixels: extract image text and send it in the documents array, then act on documentsAnalysis[].attackDetected.
  9. Content Credentials are an automatic, signed C2PA manifest seen only with verification tools; a visible label must be composited by the app.
  10. New or organisation-specific symbols need a deployed custom categories (rapid) image incident; blocklists and standard custom categories are text-only.
0/10
Ready to start

Part 1: What does responsible AI for multimodal content cover on AI-103?

Task 3.3 covers filtering unsafe images, catching injection in image text and visual policy; services give signals, apps decide.

1 min read · 10 parts, about 12 min in allStart lesson

Frequently asked questions

What severity values does Azure AI Content Safety return for images?

The Azure AI Content Safety image model returns a trimmed severity scale of 0, 2, 4 and 6, meaning safe, low, medium and high, for each of the Hate, Sexual, Violence and Self-harm categories. Values such as 3 or 5 don't occur for images, so application thresholds should be written against 2, 4 and 6.

Does Content Safety analyze every frame of an animated GIF?

No. For animated image formats, the Analyze Image API extracts and analyzes only the first frame. To moderate a whole animation, the application must split it into frames and send each frame, or a dense enough sample, as a separate image and combine the results.

Which role does Content Safety need to read images from Blob Storage?

When an image is passed as a blobUrl, the Content Safety service reads it itself, so enable the Content Safety resource's system-assigned managed identity and assign it Storage Blob Data Contributor or Storage Blob Data Owner on the storage account. Microsoft documents these as the only valid roles; no SAS token or account key is needed.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?