Dev & Engineering ✓ Microsoft · Official azurecontent-moderationpython-sdkharmful-content-detectionblocklist-managemententra-id

Azure AI Content Safety for Python

Guides Python applications in detecting harmful text and images and enforcing custom blocklists.

FollowSkills review · FSRS-2.0
Not recommended
53/ 100 5-point scale 2.7 / 5
Trust17 / 25 · 3.4/5

The skill explicitly prefers DefaultAzureCredential, constrains production credential chains, and places endpoints, tokens, and API keys in environment variables; it also labels API keys as a legacy path and supports image URLs, logging, and blocklist management. Points are deducted because it does not require user confirmation before external Azure calls, adequately disclose that text, images, and URLs are sent to a cloud service, or address sensitive-content handling, log redaction, least-privilege Azure roles, rollback, or image-URL access risks.

Reliability7 / 20 · 1.8/5

The documentation is mostly consistent about synchronous client lifecycle, authentication preference, and separating sync from async usage, and it advises validating current API method names. However, an example uses an undefined endpoint variable, and the skill lacks exception, timeout, retry, quota, and network-failure handling plus skill-specific reproducible tests. Under static calibration, reliability is capped at 10, so it receives 7.

Adaptability9 / 15 · 3.0/5

Triggers, Python SDK scope, text/image moderation, blocklists, and severity classification scenarios are fairly clear for coding agents using Azure AI Content Safety. It does not define non-fit boundaries, input limits, output contracts, exclusion triggers, Chinese-language quality, regional availability, or mainland-China network reachability.

Convention10 / 15 · 3.3/5

The YAML metadata supplies name, MIT license, author, version, and package name. The material is organized into installation, authentication, core scenarios, best practices, and reference files. Points are deducted for the absence of a changelog, explicit maintenance owner and update path, dependency version constraints, FAQ, troubleshooting guidance, and cleanup/delete examples; some reference content is duplicated.

Effectiveness6 / 15 · 2.0/5

Examples cover text and image analysis, blocklists, severity levels, and client selection, providing directly usable guidance for common introductory implementations. Production error handling, a complete async path, threshold decisions, privacy handling, and cleanup paths remain incomplete, and example correctness is not supported by skill-specific execution evidence. Under static calibration, effectiveness is capped at 7, so it receives 6.

Verifiability4 / 10 · 2.0/5

The skill provides limited Microsoft Learn attribution, a named package, and auditable code snippets. The repository also shows generic CI, Vally evaluation, and test-harness material, but the supplied evidence does not establish coverage of this skill's key paths or provide skill-specific test results or independent corroboration. Under static calibration, verifiability is capped at 5, so it receives 4.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 9ccaf7c3704a
Before you use it
  • Before sending user text, image content, or remote image URLs to Azure, document the data flow, region, retention policy, and authorization boundary, and avoid logging sensitive analysis results verbatim.
  • The examples leave endpoint undefined and omit exception, retry, timeout, quota, and complete async paths; validate method names, model fields, and severity semantics against version-pinned official documentation and project tests before adoption.
  • Mainland-China network reachability, Azure regional availability, and enterprise proxy requirements are not addressed, so target-environment availability is unverified.
See the full review method →

What it does & when to use it

This skill provides coding guidance for the Azure AI Content Safety SDK for Python. It covers text and image analysis, severity levels, four harm categories, and custom text blocklist management. It recommends DefaultAzureCredential with Microsoft Entra ID and deterministic client lifecycle management through context managers. It is a good fit for Python teams integrating Azure content moderation, provided they have an Azure Content Safety resource and authentication configured.

Guides an agent to install azure-ai-contentsafety, read CONTENT_SAFETY_ENDPOINT and related environment variables, create ContentSafetyClient or BlocklistClient instances, and call operations such as analyze_text, analyze_image, create_or_update_text_blocklist, and add_or_update_blocklist_items. It shows how to encode a local image or submit an image URL, inspect Hate, Sexual, Violence, and SelfHarm results with severities, select four- or eight-level output, and apply blocklists during text analysis.

  1. A Python developer moderating user-generated text before it is published can check hate, sexual, violence, and self-harm categories.
  2. A team building image uploads can analyze local images or image URLs before displaying them to users.
  3. An application owner with domain-specific prohibited terms can create a blocklist and reject text when a match is found.
  4. An AI product team can pre-moderate model outputs and log analysis results for auditing and improvement.

Pros & cons

Pros
  • Covers text analysis, image analysis, and custom blocklist management.
  • Includes concrete examples for four harm categories, severity levels, and eight-level output.
  • Provides clear guidance for DefaultAzureCredential and synchronous or asynchronous client cleanup.
  • Includes local-image, image-URL, blocklist-match, and AI-output pre-moderation patterns.
Limitations
  • Requires an Azure Content Safety resource, endpoint, and authentication; it does not run independently of Azure.
  • The supplied material does not document pricing, quotas, regional availability, or retry behavior.
  • The README describes a test harness, but provides no skill-specific test result for this skill.
  • The skill references capabilities.md and non-hero-scenarios.md, whose contents are not included.

How to install

Add the repository to a coding agent with npx skills add microsoft/skills, then select the skill in the wizard. For manual installation, clone https://github.com/microsoft/skills and copy .github/plugins/azure-sdk-python/skills/azure-ai-contentsafety-py into the agent skill directory, such as .github/skills/. Install the Python SDK with: pip install azure-ai-contentsafety.

How to use

Useful trigger phrases include “azure-ai-contentsafety”, “ContentSafetyClient”, “content moderation”, “harmful content”, “text analysis”, and “image analysis”. Ask the agent to generate or update Python code for text analysis, image analysis, blocklist management, or severity configuration. Before running the code, set CONTENT_SAFETY_ENDPOINT; when using DefaultAzureCredential in production, set AZURE_TOKEN_CREDENTIALS=prod, and set CONTENT_SAFETY_KEY only for the documented legacy key-based path.

Compared to similar skills

The source explicitly contrasts DefaultAzureCredential with the legacy AzureKeyCredential path: new code should prefer DefaultAzureCredential, while AzureKeyCredential is intended for existing keyed deployments that have not migrated to Entra ID.

FAQ

What Azure setup is required?
CONTENT_SAFETY_ENDPOINT is required. With DefaultAzureCredential, production should also set AZURE_TOKEN_CREDENTIALS=prod or a specific credential; the legacy key path additionally requires CONTENT_SAFETY_KEY.
What does the skill analyze?
It guides ContentSafetyClient through text and image analysis for Hate, Sexual, Violence, and SelfHarm, returning category severity results.
Can it enforce custom prohibited terms?
Yes. BlocklistClient can create or update text blocklists and add items; analyze_text can use the list and halt_on_blocklist_hit can stop processing on a match.

More skills from this repository

All from microsoft/agent-skills

Dev & Engineering ✓ Microsoft · Official

Azure Identity for Python

A practical skill for securing Python Azure applications with Microsoft Entra ID credentials.

Dev & Engineering ✓ Microsoft · Official

Azure Event Hubs Java Skill

Build production-oriented Java event streaming applications on Azure Event Hubs.

Dev & Engineering ✓ Microsoft · Official

Azure Tables for Python

A practical guide to building authenticated Azure Tables applications with Python entity CRUD, queries, and partition-scoped batch operations.

Dev & Engineering ✓ Microsoft · Official

Azure Identity for TypeScript

Configure secure, flexible Microsoft Entra ID authentication for TypeScript Azure applications.

Automation & Ops ✓ Microsoft · Official

Azure Reliability Advisor

Assess and improve reliability for Azure Functions and App Service.

Dev & Engineering ✓ Microsoft · Official

Azure Cloud Architect

Guides coding agents through production-grade Azure architecture design and review using Azure Architecture Center practices.

Dev & Engineering ✓ Microsoft · Official

Azure AI Text Analytics for Python

Guides Python developers through Azure-powered text analysis and NLP workflows.

Automation & Ops ✓ Microsoft · Official

Azure Resource Architecture Visualizer

Analyze Azure resource groups and turn their dependencies into detailed Mermaid architecture diagrams.

Dev & Engineering ✓ Microsoft · Official

Azure Maps for .NET

Build .NET location features for search, routing, maps, geolocation, and weather.

Dev & Engineering ✓ Microsoft · Official

Azure AI Vision Image Analysis

Guides Python coding agents in implementing Azure AI Vision image understanding.

Dev & Engineering ✓ Microsoft · Official

Azure Blob Storage for Python

Guides secure, production-minded Blob Storage operations in Python.

Dev & Engineering ✓ Microsoft · Official

Azure Queue Storage for Python

Gives coding agents reliable Python patterns for secure Azure Queue Storage messaging and asynchronous task processing.

Automation & Ops ✓ Microsoft · Official

Azure AI Gateway Governance

Use Azure API Management to govern traffic across AI models, MCP tools, and agents.

Automation & Ops ✓ Microsoft · Official

AKS Automatic Readiness

Assess Kubernetes workloads for AKS Automatic compatibility and identify migration blockers before you switch.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB ARM for .NET

Provision and manage Azure Cosmos DB resources from .NET through ARM.

Dev & Engineering ✓ Microsoft · Official

Azure Playwright Workspace Manager

Provision and manage Microsoft Playwright Testing workspaces with .NET and Azure Resource Manager.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Python

A practical guide for building reliable Python applications on Azure Cosmos DB’s NoSQL API.

Dev & Engineering ✓ Microsoft · Official

Azure Key Vault SDK for Python

Gives Python coding agents practical guidance for securely managing Azure Key Vault secrets, keys, and certificates.

Dev & Engineering ✓ Microsoft · Official

Azure API Management for Python

Gives coding agents practical Python SDK patterns for managing Azure API Management services, APIs, products, subscriptions, and policies.

Dev & Engineering ✓ Microsoft · Official

Azure Monitor Query for Python

Generate Python code for querying Azure Monitor logs and metrics.

Related skills