Technical & DevelopmentIntermediate
azure-ai-contentsafety-py
Harmful content detection
Developer Setup
Setup & Installation
bash
npx skills add https://github.com/microsoft/skills --skill azure-ai-contentsafety-pynpx skills add https://github.com/microsoft/skills --skill azure-ai-contentsafety-pyOr paste this URL into your assistant to install:
Overview
What This Skill Does
Azure AI Content Safety SDK for Python connects to Microsoft's content moderation API to analyze text and images for harmful content. It classifies results across four harm categories (hate, sexual, violence, self-harm) with severity scores. Supports custom blocklists for domain-specific filtering.
Application
When to use this Skill
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
Documentation
Show Skills.md file
Azure AI Content Safety SDK for Python
Detect harmful user-generated and AI-generated content in applications.
Installation
pip install azure-ai-contentsafety
Environment Variables
CONTENT_SAFETY_ENDPOINT=https://<resource>.cognitiveservices.azure.com # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
CONTENT_SAFETY_KEY=<your-api-key> # Only required for the legacy API-key auth path below
Authentication & Lifecycle
🔑 Two rules apply to every code sample below:
- Prefer
DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
- Local dev:
DefaultAzureCredentialworks as-is.- Production: set
AZURE_TOKEN_CREDENTIALS=prod(orAZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
Lines 1 - 25 of 230
Recommendations
Explore other random skills
CreativeIntermediate
figma
Use the Figma MCP server to fetch design context and translate nodes into production code
CreativeIntermediate
figma-code-connect-components
Connect Figma design components to code components using Code Connect
CreativeBeginner
figma-create-design-system-rules
Rules for implementing Figma designs using the Figma MCP server