azure-ai-contentsafety-py
Skill by sickn33
Azure AI Content Safety SDK guide for Python that detects harmful text and images. It returns severity levels for hate, sexual, violence and self-harm categories. Built for developers adding content moderation to applications.
Install azure-ai-contentsafety-py
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/azure-ai-contentsafety-py ~/.claude/skills/azure-ai-contentsafety-pyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install azure-ai-contentsafety-py in Claude Code
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/azure-ai-contentsafety-py ~/.gemini/antigravity-cli/skills/azure-ai-contentsafety-pyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install azure-ai-contentsafety-py in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill shows how to use the Azure AI Content Safety SDK for Python to detect harmful user-generated and AI-generated content. It covers installation, API key and Entra ID authentication, and analyzing text and images. Each analysis returns a severity for harm categories including Hate, Sexual, Violence and SelfHarm.
The skill also covers custom text blocklists, including creating a blocklist, adding items, and analyzing text with halt_on_blocklist_hit. Text can return 4 severity levels (0, 2, 4, 6) by default or 8 levels (0 to 7). It is aimed at developers who build moderation into applications and want to pre-moderate AI outputs. The source notes that uploads send text or images to a hosted classifier and that results can miss harm.
Written from the project's SKILL.md and checked against it.
What it can do
- Analyze textRuns analyze_text on a string and reports severity for each harm category.
- Analyze imageRuns analyze_image on image bytes or an image blob URL and reports category severities.
- Harm categoriesChecks Hate, Sexual, Violence and SelfHarm categories.
- Eight severity levelsUses the EIGHT_SEVERITY_LEVELS output type to return levels 0 to 7 for text.
- Blocklist managementCreates or updates text blocklists and adds block items with BlocklistClient.
- Blocklist analysisAnalyzes text against named blocklists with optional halt_on_blocklist_hit.
- AuthenticationConnects with an API key or with Entra ID using DefaultAzureCredential.
What you need
- Python
- pip package azure-ai-contentsafety
- Azure Content Safety endpoint and API key
- azure-identity for Entra ID authentication
Try asking
- Check this user comment for hate, violence or self-harm severity
- Write a Python script that analyzes an image URL with Content Safety
- Create a custom blocklist and block listed terms in my text analysis
Good to know
- Classification can miss harm or flag benign context.
- Severity zero is not a universal safety guarantee.
- Thresholds should be validated on representative languages and domains.
- Blocklist changes can affect real moderation and need explicit scope.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/azure-ai-contentsafety-py/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to azure-ai-contentsafety-py
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
azure-ai-contentsafety-py: common questions
What harm categories does it detect?
The skill lists Hate, Sexual, Violence and SelfHarm. Each result gives a severity level for the category.
What severity levels are returned?
Text returns 0, 2, 4 and 6 by default. Setting the 8 severity output type returns levels 0 to 7.
Does it support Entra ID?
Yes. The source shows ContentSafetyClient with DefaultAzureCredential and notes that azure-identity is needed for this.
How do I install azure-ai-contentsafety-py?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is azure-ai-contentsafety-py free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is azure-ai-contentsafety-py safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to azure-ai-contentsafety-py?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
