Azure AI Content Safety SDK for Python
Detect harmful content with Azure AI Content Safety
User-generated and AI-generated content can contain harmful material that violates community guidelines. This skill helps you automatically detect hate speech, self-harm content, sexual content, and violence with configurable severity thresholds.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "Azure AI Content Safety SDK for Python". Text containing mild profanity but no hate speech
Expected outcome:
Hate: severity 0 (Safe), SelfHarm: severity 0 (Safe), Sexual: severity 0 (Safe), Violence: severity 0 (Safe)
Using "Azure AI Content Safety SDK for Python". Image containing weapons or violent imagery
Expected outcome:
Violence: severity 4 (Medium), other categories: severity 0 (Safe). Content flagged for review based on threshold settings.
Using "Azure AI Content Safety SDK for Python". Text matching custom blocklist term with halt_on_blocklist_hit enabled
Expected outcome:
BlocklistsMatch: true. Blocked term: [TERM]. Analysis halted before AI processing. Action: reject submission.
Security Audit
SafeThis skill contains only documentation for the Azure AI Content Safety Python SDK. Static analysis scanned 0 files with 0 security issues detected. The skill provides legitimate instructions for content moderation using Azure services with proper credential handling via environment variables. No executable code or malicious patterns found.
Quality Score
What You Can Build
Social Media Content Moderation
Automatically screen user posts and comments for harmful content before publishing to your platform.
AI Output Safety Filtering
Pre-screen AI-generated responses to ensure they meet safety guidelines before displaying to end users.
Chat Application Safety
Real-time monitoring of chat messages to detect and block harmful content in customer support or community chats.
Try These Prompts
Analyze this text for harmful content: [INSERT TEXT]. Report severity levels for hate, self-harm, sexual, and violence categories.
Create a blocklist named [BLOCKLIST_NAME] for my domain. Add these terms: [TERM1, TERM2, TERM3]. Configure text analysis to halt when blocked terms are detected.
Analyze this image for harmful visual content: [IMAGE_FILE or URL]. Use 8-severity scale and return results for all harm categories.
Build a content moderation pipeline that: 1) Checks text against custom blocklists first, 2) Analyzes remaining content with Azure AI, 3) Applies different actions based on severity thresholds (0-2: allow, 4: flag for review, 6+: block). Log all results for audit.
Best Practices
- Set severity thresholds appropriate for your audience and platform guidelines
- Use custom blocklists for domain-specific terms that Azure AI may not recognize
- Log all analysis results for audit trails and continuous improvement of moderation policies
Avoid
- Do not rely solely on automated moderation for high-stakes content decisions
- Avoid using default severity thresholds without testing against your specific content types
- Do not store or log raw harmful content in analysis results for compliance reasons
Frequently Asked Questions
What Azure subscription do I need for Content Safety?
How do I choose between 4-level and 8-level severity?
Can I analyze content in multiple languages?
What is the difference between blocklists and AI analysis?
How do I handle false positives in content moderation?
Is API Key or Entra ID authentication more secure?
Developer Details
Author
sickn33License
MIT
Repository
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-contentsafety-pyRef
main
File structure
📄 SKILL.md