azure-ai-contentsafety-java
Build content moderation apps with Azure AI
Moderate harmful content automatically in your applications. Azure AI Content Safety SDK for Java detects hate speech, violence, sexual content, and self-harm with configurable severity thresholds.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「azure-ai-contentsafety-java」。 Analyze user comment for hate speech and violence
預期結果:
Hate: Severity 2 (low confidence), Violence: Severity 0 (not detected). Content passes moderation threshold.
正在使用「azure-ai-contentsafety-java」。 Check image for adult content
預期結果:
Sexual category detected at Severity 6. Recommendation: Block content per policy threshold of 4.
正在使用「azure-ai-contentsafety-java」。 Validate message against custom blocklist
預期結果:
Blocklist hit detected: Item ID abc123 matched term variant. Content blocked per haltOnBlocklistHit setting.
安全審計
安全Static analyzer produced false positives due to misinterpreting Markdown documentation. All 33 external_commands findings are Java code examples in Markdown fences, not shell execution. Network findings are example URLs for configuration. Environment variable access is standard Azure SDK pattern. No actual security issues detected.
風險因素
🔑 環境變數 (1)
🌐 網路存取 (2)
品質評分
你能建構什麼
Social Platform Moderation
Automatically screen user-generated posts and comments for harmful content before publication. Configure severity thresholds to match community guidelines.
Customer Support Filtering
Detect abusive messages in support tickets and chat systems. Route flagged content to human reviewers while allowing legitimate messages through.
Marketplace Content Review
Scan product listings, reviews, and images for policy violations. Maintain custom blocklists for brand-specific prohibited terms.
試試這些提示
Analyze this text for harmful content using Azure AI Content Safety: [paste text]. Return severity scores for each category.
Analyze [text] for hate and violence categories only. Use 8 severity levels output. Stop if blocklist hit occurs.
Check the image at [URL] for harmful content. Report categories with severity >= 4. Format results as a moderation decision.
Create a blocklist named [name] with description [desc]. Add these terms: [terms]. Then analyze [text] against this blocklist with halt on hit enabled.
最佳實務
- Read Azure SDK documentation for authentication and client configuration before implementation
- Set severity thresholds based on your risk tolerance - severity 4+ is typical for strict moderation
- Allow 5 minutes for blocklist changes to propagate before testing new entries
- Cache analysis results for repeated content to reduce API calls and latency
避免
- Hardcoding credentials instead of using environment variables or DefaultAzureCredential
- Requesting all harm categories when only specific ones are needed - increases latency and cost
- Blocking severity 0 content - this creates false positives for borderline cases
- Synchronous API calls in high-throughput scenarios - use async patterns for batch processing
常見問題
What Azure subscription do I need for Content Safety?
How do I authenticate the SDK?
Can I customize harm detection thresholds?
How quickly do blocklist updates take effect?
Does the SDK support async operations?
What image formats are supported?
開發者詳情
作者
sickn33授權
MIT
儲存庫
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-contentsafety-java引用
main
檔案結構
📄 SKILL.md