| name | klingai-content-policy |
| description | Implement content policy compliance for Kling AI prompts and outputs. Use when filtering
user prompts or handling moderation. Trigger with phrases like 'klingai content policy',
'kling ai moderation', 'safe video generation', 'klingai content filter'.
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.18.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","kling-ai","content-policy","moderation"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Kling AI Content Policy
Overview
Kling AI enforces content policies server-side. Tasks with policy-violating prompts return task_status: "failed" with a content policy message. This skill covers pre-submission filtering to avoid wasted credits and API calls.
Restricted Content Categories
Kling AI prohibits prompts that generate:
| Category | Examples |
|---|
| Violence/gore | Graphic injuries, torture, weapons used violently |
| Adult/sexual | Explicit nudity, sexual acts, suggestive content |
| Hate/discrimination | Slurs, targeted harassment, supremacist imagery |
| Illegal activity | Drug manufacturing, terrorism, fraud instructions |
| Real people | Deepfakes of identifiable individuals without consent |
| Copyrighted characters | Trademarked characters (Mickey Mouse, Spider-Man) |
| Misinformation | Fake news, fabricated events presented as real |
| Self-harm | Suicide, eating disorders, self-injury instructions |
Pre-Submission Prompt Filter
import re
class PromptFilter:
"""Filter prompts before sending to Kling AI to save credits."""
BLOCKED_PATTERNS = [
r"\b(nude|naked|explicit|nsfw|porn)\b",
r"\b(gore|dismember|torture|mutilat)\b",
r"\b(bomb|terroris|weapon|firearm)\b",
r"\b(suicide|self.harm|kill.yourself)\b",
r"\b(deepfake|impersonat)\b",
]
BLOCKED_TERMS = {
"blood splatter", "graphic violence", "child abuse",
"drug manufacturing", "hate speech",
}
def __init__(self):
self._patterns = [re.compile(p, re.IGNORECASE) p .BLOCKED_PATTERNS]
() -> [, ]:
lower = prompt.lower()
term .BLOCKED_TERMS:
term lower:
,
pattern ._patterns:
= pattern.search(prompt)
:
,
(prompt) > :
,
(prompt.strip()) < :
,
,
() -> :
pattern ._patterns:
prompt = pattern.sub(, prompt)
prompt.strip()