Preface¶
Content moderation, risk control, and operations teams frequently need to determine whether an image is a real photograph or AI-generated (AIGC). Simply asking a large language model to “take a look” within a conversation yields non-reproducible results and is difficult to integrate with business rules. A more robust approach is to use a dedicated cloud-side detection interface and encapsulate the calling method as a Skill that an Agent can execute.
The following is an introduction to TencentCloud Image AIGC Detection on SkillHub (coordinate @tencent-adm/tencentcloud-aigc-recog-image). It encapsulates the AI-generated image recognition capabilities from Tencent Cloud’s Image Content Security into a SKILL.md specification and a scripts/main.py script, facilitating direct detection within clients that support Skills, such as Cursor and Claude Code.
What is this¶
TencentCloud Image AIGC Detection is an enterprise-sourced Skill released by the Tencent Cloud Content Recognition team (SkillHub category it-ops-security, current version 1.0.8). It is positioned as an AI-Generated Content Detection Tool: it judges whether an input image is AIGC-generated. It applies to scenarios such as AI-generated image detection, image authenticity identification, AI painting detection, and Deepfake detection.
The Skill tags indicate requires_api_key=true, depending on Tencent Cloud API keys and console policy IDs. Under the hood, it performs recognition via the ImageModeration interface with Type=IMAGE_AIGC (for details, see references/image_moderation_api.md within the Skill).
The SkillHub community page shows: Rating 100000, Downloads 4626, Installations 372 (data is subject to the SkillHub page display).
Core Functions¶
The following capabilities are derived from the Skill’s official SKILL.md and script descriptions, and can be verified against the documentation within the installation package.
- AI-Generated Image Determination: Analyzes the input image and returns whether it is AI-generated.
- Risk Score: A confidence score of 0–100; the higher the score, the more likely it is AI-generated.
- Action Recommendations:
Pass(real image),Review(suspicious),Block(AI-generated). - Detailed Results: Includes hit labels, sub-labels, etc. (e.g.,
GeneratedContentRisk,AIImageGenerated).
Input Methods
| Method | Description |
|---|---|
| Image URL | Pass a network address |
| Local File | Pass a path; the script reads and Base64 encodes it |
Limitations (Stated in Skill Documentation)
- Single image size limit: 5MB
- Formats: PNG, JPG, JPEG, BMP, GIF, WEBP
- API call frequency is subject to Tencent Cloud console quotas
The documentation also mentions that it can identify images generated by mainstream models such as Stable Diffusion, Midjourney, and GPT-4o; specific effectiveness is subject to the online service.
Installation and Activation¶
1. Install SkillHub CLI (if not installed)¶
First, check if the CLI exists:
command -v skillhub && skillhub --version
If not installed, follow the SkillHub installation documentation (CLI only):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
For complete installation instructions, see: https://skillhub.cn/install/skillhub.md
2. Install this Skill¶
When installing, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ which may not be recognized.
skillhub install @tencent-adm/tencentcloud-aigc-recog-image --dir <your skills directory>
Common path examples (from SkillHub installation documentation):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
You can also follow the prompts on the SkillHub skill page to let the Agent read https://skillhub.cn/install/skillhub.md and then install @tencent-adm/tencentcloud-aigc-recog-image.
3. Activate Service and Configure Environment Variables¶
Before running the script, complete console activation and key configuration (Skill documentation “Environment Configuration Guide”).
- Activate AI Generated Image Detection at the Tencent Cloud Content Security Generation Recognition Console (experience it after initial configuration).
- Obtain
SecretId/SecretKeyat API Key Management. - Find the AI Generated Detection Supporting Policy in “Application Management” at Policy Management, and note the BizType corresponding to Image Content Security.
- Set environment variables (Linux / macOS example):
export TENCENTCLOUD_SECRET_ID="yourSecretId"
export TENCENTCLOUD_SECRET_KEY="yourSecretKey"
export TENCENTCLOUD_AIGC_RECOG_IMAGE_BIZ_TYPE="yourBizType"
TENCENTCLOUD_AIGC_RECOG_IMAGE_BIZ_TYPE is mandatory; if not configured, the script will exit with BIZ_TYPE_NOT_CONFIGURED. If using STS temporary credentials, you can additionally set TENCENTCLOUD_TOKEN.
4. Install Python Dependencies¶
The Skill requires Python 3.7+ and depends on the Tencent Cloud SDK:
pip install tencentcloud-sdk-python
Typical Usage¶
The core entry point is scripts/main.py in the Skill directory. Replace <SKILL_DIR> with the actual path after installation (e.g., ~/.cursor/skills/@tencent-adm/tencentcloud-aigc-recog-image).
Detect using an Image URL:
python3 <SKILL_DIR>/scripts/main.py "https://example.com/image.jpg"
Or explicitly specify the URL:
python3 <SKILL_DIR>/scripts/main.py --url "https://example.com/image.jpg"
Detect using a Local File:
python3 <SKILL_DIR>/scripts/main.py /path/to/image.png
python3 <SKILL_DIR>/scripts/main.py --file /path/to/image.png
Attach Business Data ID (up to 128 characters):
python3 <SKILL_DIR>/scripts/main.py --data-id "business_123" /path/to/image.png
Upon success, the script outputs JSON, for example:
{
"suggestion": "Block",
"label": "GeneratedContentRisk",
"score": 95,
"sub_label": "AIImageGenerated",
"detail_results": [...],
"request_id": "..."
}
suggestion can be directly mapped to business actions: Pass implies a real image, Review suggests manual review, Block implies AI-generated. score corresponds to low, medium, and high risk tiers in the 0–60, 60–80, and 80–100 ranges respectively (subject to Skill documentation).
In Agent scenarios, the Skill requires that results must be based on the script/API output; the model must not guess the conclusion itself when the call fails.
Applicable Scenarios and Notes¶
Who is it for
- Teams that need to perform AIGC image spot checks, submission reviews, or identification before material ingestion within Agent workflows.
- Developers already using or planning to use Tencent Cloud Image Content Security who wish to write less SDK glue code.
Usage Notes
- Do not write keys and BizType into the code repository; in production environments, use environment variables or key management services.
- Limitations such as 5MB per image, formats, and quotas need to be validated in advance in the upload pipeline.
- Detection results are used to assist decision-making;
Reviewlevels still suggest retaining manual re-verification. - This is an enterprise-sourced Skill; please confirm billing and compliance requirements on SkillHub and the Tencent Cloud console before use.
Conclusion¶
TencentCloud Image AIGC Detection encapsulates Tencent Cloud’s AI-generated image recognition into an installable Agent Skill: after configuring keys and BizType, a single python3 .../main.py command yields structured judgments. Official Skill package address: https://api.skillhub.cn/tencent-adm/tencentcloud-aigc-recog-image; Community introduction page: https://www.skillhub.cn/skills/tencent-adm/tencentcloud-aigc-recog-image.