Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 90
  • 51k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-py

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install azure-ai-contentsafety-py in Claude Code

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

A

No 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 →

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.

azure-ai-contentsafety-py Install

Add to stack

Loading.