AI-103: Responsible AI for Images — Content Safety, Prompt Shields and Visual Policy
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
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
- Analyze Image scores Hate, Sexual, Violence and Self-harm; the app compares each severity with its own threshold — the API never blocks.
- Image severities use only 0, 2, 4 and 6 (safe, low, medium, high); write image thresholds against those values.
- 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.
- With a blobUrl, the Content Safety resource's system-assigned identity reads the blob and needs Storage Blob Data Contributor or Owner.
- 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.
- Guardrail blocking levels: Low blocks high only, Medium blocks medium and high, High blocks everything above safe; safe content is never blocked.
- Turning a harm control off on outputs needs modified-guardrail approval; on inputs it doesn't.
- Prompt Shields reads text, not pixels: extract image text and send it in the documents array, then act on documentsAnalysis[].attackDetected.
- Content Credentials are an automatic, signed C2PA manifest seen only with verification tools; a visible label must be composited by the app.
- New or organisation-specific symbols need a deployed custom categories (rapid) image incident; blocklists and standard custom categories are text-only.
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.
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.