diff --git a/config.yml b/config.yml index 82cf76c..e9f704e 100644 --- a/config.yml +++ b/config.yml @@ -3,65 +3,66 @@ # Bot Settings bot: - prefix: "!" - owner_ids: - # Add your Discord user ID here - # Example: - 123456789012345678 + prefix: "!" + owner_ids: + # Add your Discord user ID here + # Example: - 123456789012345678 # Spam Detection (No AI cost) automod: - enabled: true - anti_spam_enabled: true - message_rate_limit: 5 # Max messages per window - message_rate_window: 5 # Window in seconds - duplicate_threshold: 3 # Duplicate messages trigger - mention_limit: 5 # Max mentions per message - mention_rate_limit: 10 # Max mentions per window - mention_rate_window: 60 # Mention window in seconds + enabled: true + anti_spam_enabled: true + message_rate_limit: 5 # Max messages per window + message_rate_window: 5 # Window in seconds + duplicate_threshold: 3 # Duplicate messages trigger + mention_limit: 5 # Max mentions per message + mention_rate_limit: 10 # Max mentions per window + mention_rate_window: 60 # Mention window in seconds # AI Moderation (Images, GIFs only) ai_moderation: - enabled: true - sensitivity: 80 # 0-100, higher = stricter - nsfw_only_filtering: true # Only filter sexual/nude content - - # Cost Controls (Conservative: ~$25/month for 1-2 guilds) - max_checks_per_hour_per_guild: 25 # Very conservative limit - max_checks_per_user_per_hour: 5 # Prevent user abuse - max_images_per_message: 2 # Check max 2 images per message - max_image_size_mb: 3 # Skip images larger than 3MB - - # Feature Toggles - check_embed_images: true # Check GIFs from Discord picker (enabled per user request) - check_video_thumbnails: false # Skip video thumbnails (disabled per user request) - url_image_check_enabled: false # Skip URL image downloads (disabled per user request) + enabled: true + sensitivity: 80 # 0-100, higher = stricter + nsfw_only_filtering: true # Only filter sexual/nude content + + # Cost Controls (Conservative: ~$25/month for 1-2 guilds) + max_checks_per_hour_per_guild: 25 # Very conservative limit + max_checks_per_user_per_hour: 5 # Prevent user abuse + max_images_per_message: 2 # Check max 2 images per message + max_image_size_mb: 3 # Skip images larger than 3MB + + # Feature Toggles + check_embed_images: true # Check GIFs from Discord picker (enabled per user request) + check_video_thumbnails: false # Skip video thumbnails (disabled per user request) + url_image_check_enabled: false # Skip URL image downloads (disabled per user request) # User Blocklist (No AI cost) # Block all images, GIFs, embeds, and URLs from these users # Add Discord user IDs here blocked_user_ids: - # Example: - 123456789012345678 + - 552511874269315073 + # Example: - 123456789012345678 # NSFW Video Domain Blocklist (No AI cost) # These domains are blocked instantly without AI analysis nsfw_video_domains: - - pornhub.com - - xvideos.com - - xnxx.com - - redtube.com - - youporn.com - - tube8.com - - spankwire.com - - keezmovies.com - - extremetube.com - - pornerbros.com - - eporner.com - - tnaflix.com - - drtuber.com - - upornia.com - - perfectgirls.net - - xhamster.com - - hqporner.com - - porn.com - - sex.com - - wetpussy.com + - pornhub.com + - xvideos.com + - xnxx.com + - redtube.com + - youporn.com + - tube8.com + - spankwire.com + - keezmovies.com + - extremetube.com + - pornerbros.com + - eporner.com + - tnaflix.com + - drtuber.com + - upornia.com + - perfectgirls.net + - xhamster.com + - hqporner.com + - porn.com + - sex.com + - wetpussy.com diff --git a/src/guardden/services/ai/openai_provider.py b/src/guardden/services/ai/openai_provider.py index 7cbfe91..85fdeb4 100644 --- a/src/guardden/services/ai/openai_provider.py +++ b/src/guardden/services/ai/openai_provider.py @@ -40,25 +40,36 @@ class OpenAIProvider(AIProvider): sensitivity: int = 50, ) -> ImageAnalysisResult: """Analyze an image for NSFW or inappropriate content.""" - system = """Analyze this image for content moderation. Classify NSFW content with precision. + system = """You are a content moderation system for a Discord server. Your job is to analyze images and classify them for NSFW content. This is a legitimate moderation task to protect users. -NSFW CATEGORIES (in order of severity): -- none: Safe content, no sexual elements -- suggestive: Revealing clothing, provocative poses, cleavage, but no nudity -- partial_nudity: Underwear visible, partial exposure, censored nudity -- nudity: Full nudity visible (breasts, genitals, buttocks) but no sexual acts +IMPORTANT: You MUST analyze ALL artwork types equally, including: +- Human characters +- Anime/manga characters +- Furry/anthropomorphic characters (animals with human traits) +- Fantasy creatures +- Any drawn or digital artwork + +Apply the SAME standards to drawn/artwork content as you would to photographs. Artistic style does NOT exempt content from classification. + +NSFW CATEGORIES (classify based on what is depicted): +- none: Fully clothed, no sexual elements, safe for work +- suggestive: Revealing clothing, provocative poses, emphasis on body parts, tight/skimpy outfits, seductive positioning +- partial_nudity: Underwear/lingerie visible, bare chest, partially exposed, strategically covered nudity +- nudity: Exposed breasts, buttocks, or genitals visible (even if stylized/drawn) - explicit: Sexual acts, pornographic content, genitalia in sexual context -DETECTION CRITERIA: -- Focus on human bodies; anime/artwork should be judged by same standards -- Swimwear in beach/pool context = suggestive at most -- Artistic nudity (classical art, sculptures) = nudity but note in description +KEY DETECTION RULES: +- Leather/latex bodysuits, harnesses, BDSM gear = suggestive or higher +- Exposed chest (any gender, any species) = partial_nudity or higher +- Sexualized poses with minimal clothing = suggestive +- Characters in underwear/lingerie = partial_nudity +- "Bara", "yiff", or similar adult artwork styles = likely nudity or explicit ALSO CHECK FOR: - Violence or gore (blood, injuries, weapons used violently) - Disturbing content (shock imagery, extreme content) -Respond in JSON format: +Respond ONLY with valid JSON: { "is_nsfw": true/false, "nsfw_category": "none|suggestive|partial_nudity|nudity|explicit", @@ -66,11 +77,13 @@ Respond in JSON format: "is_violent": true/false, "is_disturbing": true/false, "confidence": 0.0-1.0, - "description": "Brief description including context", + "description": "Brief factual description of what you see", "categories": ["category1"] } -NSFW SEVERITY GUIDELINES: none=0, suggestive=20-35, partial_nudity=40-55, nudity=60-75, explicit=80-100""" +SEVERITY SCALE: none=0, suggestive=25-40, partial_nudity=45-60, nudity=65-80, explicit=85-100 + +If unsure, err on the side of caution and classify higher rather than lower.""" if sensitivity < 30: sensitivity_note = " SENSITIVITY: LENIENT - Allow suggestive content, only flag partial_nudity and above, set is_nsfw=false for suggestive."