CONTENT MODERATION / Microsoft
Azure AI Content Safety REST SDK for TypeScript
Microsoft's TypeScript guide to the @azure-rest/ai-content-safety REST client: scoring text and images for hate, sexual, violence and self-harm severity, managing custom blocklists, and folding the results into one allow-or-block decision.
“Analyze text and images for harmful content using Azure AI Content Safety (@azure-rest/ai-content-safety). Use when moderating user-generated content, detecting hate speech, violence, sexual content, or self-harm, or managing custom blocklists.”
01 / THE REASONING
Why this made the selection.
- It warns that ContentSafetyClient is a function, not a class, and checks isUnexpected() after each call whose response body it reads.
- It maps severity levels to actions (0 allow, 2 review or allow with warning, 4 block or require human review, 6 block immediately) and explains FourSeverityLevels (the default: 0, 2, 4, 6) and EightSeverityLevels (0-7).
- It tabulates the REST paths it uses, including blocklist item add and remove, and gives a moderateContent helper that refuses content above a severity threshold or with any blocklist match.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- .github/plugins/azure-sdk-typescript/skills/azure-ai-contentsafety-ts/SKILL.md (all 311 lines)
- .github/plugins/azure-sdk-typescript/README.md
- .github/plugins/azure-sdk-typescript/.claude-plugin/plugin.json
- README.md
- LICENSE
Our findings
- The Installation line adds @azure-rest/ai-content-safety, @azure/identity and @azure/core-auth.
- The harm categories are Hate, Sexual, Violence and SelfHarm, each with a one-line description.
- The practice list says to set thresholds per category, use blocklists for domain-specific terms and log moderation decisions as an audit trail.
- CONTENT_SAFETY_ENDPOINT and CONTENT_SAFETY_KEY are listed, plus AZURE_TOKEN_CREDENTIALS, marked required only if DefaultAzureCredential is used in production.
- The frontmatter declares license MIT, author Microsoft, version 1.0.0 and package @azure-rest/ai-content-safety. It declares no allowed-tools.
Not established by this review
- No text or image was analysed, and no blocklist was created, changed or deleted.
- @azure-rest/ai-content-safety, @azure/identity and @azure/core-auth were not installed from npm.
- Neither the azure-sdk-typescript plugin nor azure-ai-contentsafety-ts was installed.
- Not executed: it was not installed or run.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Add a skill to your workflow.
- The azure-sdk-typescript plugin README prints `npx skills add microsoft/skills --skill azure-sdk-typescript` under Install. It installs the whole azure-sdk-typescript plugin, whose skill table lists azure-ai-contentsafety-ts; it does not install that skill alone.
- The same README prints `/plugin install azure-sdk-typescript@skills`, which also brings in azure-ai-contentsafety-ts together with every other skill in the plugin. The repository README runs plugin commands inside Copilot CLI after `/plugin marketplace add microsoft/skills`.
Before you start
- The skill prints `npm install @azure-rest/ai-content-safety @azure/identity @azure/core-auth`. This review did not run it.
- A Content Safety resource at CONTENT_SAFETY_ENDPOINT, with CONTENT_SAFETY_KEY for key authentication or an Entra credential for DefaultAzureCredential (AZURE_TOKEN_CREDENTIALS in production).
- Copilot CLI, where `/plugin install azure-sdk-typescript@skills` adds this Content Safety skill with the rest of the plugin.
04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/microsoft/skills/blob/fc164ba1d7a0c10377dbcc1c9ac07253b9329fdb/.github/plugins/azure-sdk-typescript/skills/azure-ai-contentsafety-ts/SKILL.md
Supports: name, upstreamDescription, summary, whySelected, bestFor, limitations, review.findings, install.prerequisites, access.permissions
https://github.com/microsoft/skills/blob/fc164ba1d7a0c10377dbcc1c9ac07253b9329fdb/.github/plugins/azure-sdk-typescript/README.md
Supports: install.sourceUrl, install.steps, limitations (install scope)
https://github.com/microsoft/skills/blob/fc164ba1d7a0c10377dbcc1c9ac07253b9329fdb/.github/plugins/azure-sdk-typescript/.claude-plugin/plugin.json
Supports: publisher, license (plugin licence field)
- Repository README ↗Checked
https://github.com/microsoft/skills/blob/fc164ba1d7a0c10377dbcc1c9ac07253b9329fdb/README.md
Supports: compatibility, install.steps (Copilot CLI plugin commands)
- Repository LICENSE ↗Checked
https://github.com/microsoft/skills/blob/fc164ba1d7a0c10377dbcc1c9ac07253b9329fdb/LICENSE
Supports: license
https://github.com/microsoft/skills/commit/ee33ce9d2b4372b0cfe58375bebbf0bd989e3ac9
Supports: limitations (last commit date)