Baidu Content Censor for Openclaw

A powerful AI moderation tool for real-time text and image safety screening integrated via Openclaw Skills.

heke-uestc
v1.0.0
Mar 23, 2026
0
787
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install baidu-content-censor

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install baidu-content-censor using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Baidu Content Censor?

Baidu Content Censor is a specialized technical module designed for AI agents to perform deep content moderation on both text and visual data. By leveraging Baidu Cloud's robust security APIs, this skill enables automated detection of sensitive, illegal, or inappropriate material, ensuring that agent interactions remain compliant and safe.

Integrating this into your workflow through Openclaw Skills provides a seamless way to handle complex security requirements. It automates the heavy lifting of authentication by managing access tokens and refreshing them dynamically, allowing developers to focus on core logic while the skill handles high-performance safety checks.

Baidu Content Censor Use Cases

  • Automating the moderation of user-generated comments and forum posts to filter out prohibited keywords.
  • Scanning uploaded images or remote URLs for inappropriate visual content before they are displayed or stored.
  • Real-time safety auditing of AI-generated responses to prevent the output of sensitive information.
  • Batch processing local image directories to ensure compliance with regional digital safety regulations.

How Baidu Content Censor Works

  1. The AI agent identifies a request for content moderation, such as a user asking to check a specific paragraph or an image path.
  2. The skill determines the content type (text vs. image) and retrieves the necessary local or remote assets.
  3. The skill checks for a valid access token in the local cache located at ~/.claude/skills/baidu-content-censor/token_cache.json.
  4. If the token is missing or expired, it automatically authenticates with Baidu Cloud using the provided API Key and Secret Key.
  5. The payload is sent to the Baidu Content Censorship API endpoint with automatic Base64 encoding for local images.
  6. The skill parses the JSON response (identifying conclusion types like 'compliant' or 'non-compliant') and returns a user-friendly summary.

Baidu Content Censor Setup

To enable this capability within Openclaw Skills, you must configure your Baidu Cloud credentials as environment variables:

# Set your Baidu Cloud API Key and Secret Key
export BCE_SINAN_AK="your_api_key"
export BCE_SINAN_SK="your_secret_key"

The system will automatically manage the token lifecycle thereafter.

Baidu Content Censor Data Schema & Taxonomy

The skill returns a structured JSON object containing the audit results. Below are the primary fields included in the metadata:

Field Type Description
logId long Unique request identifier for auditing.
conclusion string Human-readable result (e.g., Compliant, Non-compliant, Suspected).
conclusionType int Numeric status (1: Compliant, 2: Non-compliant, 3: Suspected, 4: Audit Failed).
data array Detailed breakdown of specific violations or triggers found.

Baidu Content Censor Advanced Features

  • Automatic Token Management: Features an intelligent caching mechanism that refreshes tokens 5 minutes before expiration or upon receiving invalid token errors.
  • Smart Content Identification: Includes a universal censor() method that automatically distinguishes between text, remote URLs, and local file paths.
  • High-Volume Text Support: Capable of processing large text blocks up to 20,000 bytes in a single request.
  • Automated Image Processing: Seamlessly converts local image files to Base64 format without requiring manual developer intervention.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*