Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/klingai-content-policy

@820dfc8
Run it yourself

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'.

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/klingai-content-policy

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespolicy-violation-logger.md

≈513 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Policy Violation Logger

Policy Violation Logger

from datetime import datetime
import json

class PolicyViolationLogger:
    """Log and track content policy violations."""

    def __init__(self, log_path: str = "policy_violations.json"):
        self.log_path = log_path
        self.violations = []
        self.load()

    def load(self):
        """Load existing violations."""
        try:
            with open(self.log_path) as f:
                self.violations = json.load(f)
        except FileNotFoundError:
            self.violations = []

    def save(self):
        """Save violations to file."""
        with open(self.log_path, "w") as f:
            json.dump(self.violations, f, indent=2)

    def log_violation(
        self,
        prompt: str,
        user_id: str,
        flags: List[str],
        action: str = "blocked"
    ):
        """Log a policy violation."""
        violation = {
            "timestamp": datetime.utcnow().isoformat(),
            "user_id": user_id,
            "prompt_hash": hash(prompt),  # Don't store actual violating content
            "prompt_preview": prompt[:50] + "..." if len(prompt) > 50 else prompt,
            "flags": flags,
            "action": action
        }

        self.violations.append(violation)
        self.save()

        # Check for repeat offenders
        user_violations = [v for v in self.violations if v["user_id"] == user_id]
        if len(user_violations) >= 3:
            print(f"WARNING: User {user_id} has {len(user_violations)} violations")

    def get_violation_stats(self) -> Dict:
        """Get violation statistics."""
        if not self.violations:
            return {"total": 0}

        flag_counts = {}
        for v in self.violations:
            for flag in v["flags"]:
                flag_counts[flag] = flag_counts.get(flag, 0) + 1

        return {
            "total": len(self.violations),
            "by_flag": flag_counts,
            "unique_users": len(set(v["user_id"] for v in self.violations))
        }

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a comprehensive implementation for Kling AI content policy compliance, featuring local regex-based filtering, safety-oriented negative prompts, and integration with external moderation services. No security issues were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.18.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "kling-ai",
  "content-policy",
  "moderation"
]
All 5 allowed tools
ReadWriteEditBash(npm:*)Grep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/klingai-content-policy