- Home
- Skills
- Sickn33
- Antigravity Awesome Skills
- Azure Ai Contentsafety Py
azure-ai-contentsafety-py_skill
- Python
10.4k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill sickn33/antigravity-awesome-skills --skill azure-ai-contentsafety-py- SKILL.md5.6 KB
Overview
This skill provides a Python client wrapper for Azure AI Content Safety to detect and classify harmful content in text and images. It exposes ContentSafetyClient and BlocklistClient functionality to analyze multi-category harm, manage custom blocklists, and control severity granularity. Use it to pre-moderate user-generated or AI-generated content and enforce policy-driven rejection or escalation flows.
How this skill works
The skill authenticates to an Azure Content Safety resource using an API key or Entra ID and sends AnalyzeTextOptions or AnalyzeImageOptions requests. Responses return per-category severity scores (Hate, Sexual, Violence, SelfHarm) and optional blocklist matches; image analysis accepts base64 content or blob URLs. You can configure output severity levels (4 or 8-level scales), supply blocklists to halt on matches, and read category analysis to make acceptance/rejection decisions.
When to use it
- Pre-moderating text output from LLMs before displaying to end users
- Scanning user-submitted images and captions in social platforms or forums
- Enforcing content policy in chatbots, comment systems, and customer support tools
- Applying custom blocklists to block domain-specific terms quickly
- Auditing historical content for safety classification and reporting
Best practices
- Store endpoint and credentials in environment variables and use AzureKeyCredential or DefaultAzureCredential for production
- Define per-category severity thresholds and map them to actions (block, review, warn)
- Maintain and version custom blocklists for domain-specific prohibited terms
- Log full analysis results for auditing and model improvement while redacting sensitive user data
- Use halt_on_blocklist_hit for critical blocking and the 8-level output for finer-grained moderation decisions
Example use cases
- Reject user posts where any category exceeds your configured severity threshold and alert moderation team
- Pre-filter LLM responses and replace or escalate outputs flagged for self-harm or explicit content
- Automatically block or flag images uploaded by users when image analysis reports high severity in sexual or violence categories
- Run periodic scans of stored content to generate safety reports and identify trends in harmful content
- Integrate blocklist management into admin tooling to quickly add emergency terms without code deploys
FAQ
API key via AzureKeyCredential and Entra ID via DefaultAzureCredential are both supported.
Can I analyze images from a URL?
Yes. Image analysis accepts either base64 content or a blob_url pointing to the image.