Azure AI Content Safety for Java
Helps Java applications detect harmful text and images and manage custom blocklists.
The evidence shows credentials are supplied through environment variables or Azure identity credentials, with no malware or covert exfiltration; however, URL-based image analysis sends data to an external Azure service, examples print potentially sensitive blocklist text, and blocklist creation, modification, and deletion lack confirmation, permission boundaries, or rollback guidance, so points are deducted.
The evidence covers client creation, text and image analysis, blocklists, and exception handling, including synchronous and asynchronous patterns; however, the main document uses 1.1.0-beta.1 while the reference uses 1.0.16, some examples omit visible imports or variable definitions, and no skill-specific reproducible tests are provided, so the score is conservative under the static ceiling.
The evidence identifies the Java SDK audience, use cases, and trigger phrases fairly clearly, covering text, images, and blocklists; however, non-fit boundaries, input/output contracts, semantic boundaries, Chinese-language handling, and mainland-China network reachability are not stated, and the triggers remain broad, so points are deducted.
The evidence includes front matter, MIT licensing, a version field, installation notes, structured sections, and a separate examples file; however, dependency versions conflict between files, and changelog, maintenance ownership and update path, troubleshooting, and known limitations are not documented, so points are deducted.
The evidence provides directly adaptable Java snippets for core analysis and blocklist operations, offering clear value over writing the integration from scratch; however, the code was not executed, API/version consistency is uncertain, and production decisions such as thresholds, retries, and privacy handling require review, so full marks are not justified.
The evidence consists mainly of the skill's own code samples, metadata, and repository documentation; although the repository contains generic tests and CI files, no skill-specific tests covering key paths or third-party execution evidence are shown, so only limited static auditability is credited.
- Align the SDK dependency versions in the main document and references/examples.md, then compile-check all examples against the target version.
- Document least privilege, privacy, log redaction, and data flows for API keys, input text, image URLs, and blocklist match text.
- Deleting a blocklist is high-impact; add explicit confirmation and backup or recovery guidance.
- Document mainland-China reachability, Chinese-content handling, and regional service limitations.
What it does & when to use it
This skill supports developers building moderation applications with the Azure AI Content Safety SDK for Java. It covers text and image analysis, detection of hate, sexual, violence, and self-harm content, and text blocklist administration. It includes client setup with API keys or DefaultAzureCredential. It is a good fit for Azure-based Java services that need moderation guidance, but its examples use a beta SDK version and the source does not provide skill-specific test results.
Explains how to add com.azure:azure-ai-contentsafety:1.1.0-beta.1, create ContentSafetyClient and BlocklistClient instances, analyze text, local image bytes, or image URLs, read category and severity results, select categories and severity output modes, apply blocklists, and create, update, retrieve, list, add, remove, and delete blocklists and blocklist items. It also documents HttpResponseException handling, required environment variables, and practices involving batching, caching, category selection, and severity thresholds.
- A Java web service needs to screen user-submitted text for hate, violence, sexual, or self-harm content.
- An image-upload application needs to moderate local images before storing or displaying them.
- A community or customer-support system needs custom blocklists and must stop processing when a match occurs.
- A production Java service using Azure managed identity needs to access Content Safety through DefaultAzureCredential.
Pros & cons
- Covers text analysis, image analysis, and custom blocklist management.
- Provides both API-key and DefaultAzureCredential authentication examples.
- Includes severity handling, exception handling, environment variables, and common operations.
- Released under the MIT license and suited to Java/Azure development workflows.
- The examples use SDK version 1.1.0-beta.1; stability and API-change risks are not discussed.
- Requires network access to an Azure AI Content Safety endpoint.
- The source provides no dedicated test coverage or acceptance results for this individual skill.
- Pricing, regional availability, and service quota information are not included.
How to install
Add the following dependency to the Java project's Maven configuration: com.azure:azure-ai-contentsafety:1.1.0-beta.1. The source does not provide a complete project file or additional build commands. The broader skill collection can be installed with npx skills add microsoft/skills, then selected through its wizard.
How to use
Ask the coding agent for “content safety Java,” “content moderation Azure,” “analyze text safety,” “image moderation Java,” or “blocklist management.” Set CONTENT_SAFETY_ENDPOINT. Set CONTENT_SAFETY_KEY when using AzureKeyCredential, or set AZURE_TOKEN_CREDENTIALS when using DefaultAzureCredential in production. Create the client and call analyzeText, analyzeImage, or the relevant blocklist-management methods.