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
Use with care
53/ 100 5-point scale 2.7 / 5
1 2 3 4 5 6
1Trust17 / 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.

2Reliability7 / 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.

3Adaptability9 / 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.

4Convention10 / 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.

5Effectiveness6 / 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.

6Verifiability4 / 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 does this skill do, and when should you 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.

What are this skill's strengths and limitations?

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 do you install this skill?

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 do you use this skill?

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.

How does this skill compare with similar options?

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 AI Content Safety for TypeScript

Add text and image harm detection with customizable blocklists to TypeScript applications.

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 App Configuration for Python

Centralize Python application settings, feature flags, and dynamic configuration in Azure.

Dev & Engineering ✓ Microsoft · Official

Azure Container Registry for Python

Manage Azure container images, artifacts, and repositories from Python.

Dev & Engineering ✓ Microsoft · Official

Azure AI Content Safety for Java

Helps Java applications detect harmful text and images and manage custom blocklists.

Dev & Engineering ✓ Microsoft · Official

Azure Blob Storage for Python

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

Dev & Engineering ✓ Microsoft · Official

Azure File Share for Python

Guides Python developers through secure Azure SMB share, directory, and file management.

Dev & Engineering ✓ Microsoft · Official

Azure Voice Live for Python

Guides Python developers in building real-time, bidirectional voice AI applications on Azure.

Dev & Engineering ✓ Microsoft · Official

Azure Conversation Understanding for Python

Helps Python developers analyze conversation intents and entities with the Azure SDK.

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 API Center Python Manager

Manage Azure API inventories, metadata, and governance with Python.

Dev & Engineering ✓ Microsoft · Official

Azure Identity for TypeScript

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

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 Queue Storage for Python

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

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 Key Vault Certificates for Rust

Guides Rust applications in creating, managing, and using X.509 certificates in Azure Key Vault.

Dev & Engineering ✓ Microsoft · Official

Azure Bot Service Python Manager

Create, manage, and configure Azure Bot Service resources and channels from Python.

Dev & Engineering ✓ Microsoft · Official

Azure Communication Common for Java

Guides Java developers through shared ACS authentication, token refresh, and communication identifier handling.

Dev & Engineering ✓ Microsoft · Official

Azure Text Translation for Python

Add real-time Azure text translation to Python applications.

Dev & Engineering ✓ Microsoft · Official

Azure Batch Java Job Orchestration

Run and manage large-scale parallel and HPC workloads on Azure from Java.

Related skills