Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ KidGuard

AI-powered YouTube content guardian for young children

English | ็น้ซ”ไธญๆ–‡

Hackathon Submission

Event: Built with Opus 4.6: The Claude Code Hackathon
Team Size: 1
Timeline: Feb 10-16, 2026


๐ŸŽฏ The Problem

Every parent knows this scenario:

Your 5-year-old sits down at the computer. Within seconds, they've opened YouTube (not YouTube Kids) and started clicking through autoplay recommendations. By the time you notice, they've stumbled onto content that's inappropriate, scary, or just plain weird.

YouTube's age verification? A joke. Kids just click "I'm over 18" without reading.

Restricted Mode? One toggle away from being disabled.

YouTube Kids? Great, but kids don't know the difference โ€” they just see "the video app."

Parents can't monitor 24/7. We need AI to help.

A Parent's Reality

"Sure, you might say: just don't let kids touch screens or YouTube โ€” problem solved!"

But here's my reality as a father of three:

My first child grew up without TV or tablets until elementary school. Just books. By kindergarten, he was reading at a 4th-grade level.

Then came child #2, and #3. Suddenly it's just Mom and Dad managing three kids. We can't give each one the same one-on-one attention. We can't even catch our breath.

That's when we needed help. Not to replace parenting, but to extend our reach when we physically can't be everywhere at once.

This is where AI can truly help families:

  • Not just AdGuard or simple blocklists
  • Intelligent, context-aware protection that understands what kids are actually watching
  • Low-cost, embedded assistance that doesn't require a computer science degree
  • A safety net for when parents are cooking dinner, helping with homework, or just trying to survive the day

Many people say they're afraid to have kids, or don't know how to raise them. What if AI could make parenting more manageable? What if technology could be a guardian, not just a babysitter?

That's the idea behind KidGuard.


๐Ÿ’ก The Solution

KidGuard uses Claude's vision capabilities to create a real-time content guardian:

[YouTube Opens] 
       โ†“
[Webcam Check] โ†’ Who's watching? (Age estimation / Family member ID)
       โ†“
   Under 12?
       โ†“ Yes
[Capture 5-sec clip]
       โ†“
[Claude Vision Analysis] โ†’ Is this kid-appropriate?
       โ†“
   Inappropriate?
       โ†“ Yes
[Auto-skip / Redirect to safe channel]
       โ†“
[Notify parent via Telegram]

Why Claude?

  • Vision API analyzes video frames for violence, horror, adult themes, and "YouTube rabbit hole" content
  • Nuanced understanding โ€” not just keyword blocking, but contextual analysis
  • Multi-modal โ€” can analyze both visuals AND audio transcription
  • Fast enough for real-time intervention

๐Ÿ”ง Technical Architecture

Component Technology Notes
YouTube Detection Browser extension / Process monitor Detects youtube.com
Face Recognition OpenCV + face_recognition Local processing, privacy-first
Age Estimation Claude Vision Fallback for unknown faces
Screen Capture ffmpeg / Windows API 5-second clips
Content Analysis Claude Vision API Core intelligence
Browser Control Puppeteer / Extension API Skip / redirect
Parent Notification Telegram Bot Real-time alerts

Privacy-First Design

  • All face recognition runs locally
  • Video clips are analyzed and immediately deleted
  • No data leaves the device except API calls to Claude
  • Parent controls what gets logged

๐Ÿš€ Features

MVP (Hackathon Scope)

  • Detect YouTube browser activity
  • Webcam-based viewer identification
  • Age estimation for unknown viewers
  • Screen capture of YouTube content
  • Claude Vision content analysis
  • Auto-skip inappropriate content
  • Redirect to whitelisted channels
  • Telegram notifications to parents
  • ๐Ÿ†• Parent custom rules (language, actions, audio, themes, keywords)
  • ๐Ÿ†• Smart video transition detection - Only analyzes when videos change (saves API costs)
  • ๐Ÿ†• Window title extraction - Gets video info without Selenium/OCR
  • ๐Ÿ†• Auto monitoring mode - Hands-free protection

Future Roadmap

  • Family member profile management
  • Viewing history dashboard
  • Custom filter rules โœ… DONE - Fully configurable parent rules
  • Video transition detection โœ… DONE - Smart cost-saving analysis
  • Audio analysis (screaming, profanity detection)
  • Cross-platform support (tablet, phone)
  • Integration with router-level controls
  • Per-child custom rules

๐ŸŽฏ Parent Custom Rules (NEW!)

KidGuard now supports highly customizable filtering rules that let parents define exactly what content is appropriate for their children:

What You Can Customize

Rule Type Examples Configuration
๐ŸŒ Language Only Chinese, Only English, etc. Block non-allowed languages
๐Ÿคบ Actions No sword fighting, No dangerous stunts Detect specific movements
๐Ÿ”Š Audio No screaming, No loud yelling Analyze facial expressions
๐ŸŽจ Visual Style No dark themes, No blood Check visual aesthetics
๐Ÿ“บ Themes No gambling, No pranks Context understanding
๐Ÿ”ค Keywords Custom blacklist Title/description matching

Configuration Examples

Strict Mode (Ages 4-7):

custom_rules:
  language:
    allowed_languages: ["ไธญๆ–‡"]  # Chinese only
  actions:
    blocked_actions:
      - "็ ๆ“Šๆฎ็ "  # No sword fighting
      - "ๅฑ้šช็‰นๆŠ€"  # No dangerous stunts
  audio:
    blocked_audio_types:
      - "ๅฐ–ๅซ"  # No screaming

Relaxed Mode (Ages 10-12):

custom_rules:
  language:
    allowed_languages: ["ไธญๆ–‡", "่‹ฑๆ–‡"]
    action: "warn"  # Warn but don't block
  themes:
    blocked_themes:
      - "่ณญๅš้Šๆˆฒ"  # Gambling only

๐Ÿ“– Full Documentation: See docs/CUSTOM_RULES.md for detailed guide

๐Ÿ”ง Config Templates:

  • config/config.strict.yaml - For young children (ages 4-7)
  • config/config.relaxed.yaml - For older children (ages 10-12)

๐ŸŒ Web UI - Parent Control Panel (NEW!)

No more editing YAML files! Configure KidGuard through a beautiful web interface.

Features

โœจ 5 Configuration Tabs:

  1. ๐Ÿ”ง Basic Settings - API keys, detection rules, safe channels
  2. ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Family Members - Add/manage family profiles
  3. ๐ŸŽฏ Custom Rules - Visual configuration of all filtering rules
  4. ๐Ÿ“ฑ Notifications - Telegram alerts setup
  5. ๐Ÿ“‹ Quick Templates - Pre-configured strict/relaxed modes

๐ŸŽจ User-Friendly:

  • Checkboxes and dropdowns instead of text editing
  • Real-time validation
  • Preview before saving
  • Test API connection with one click
  • Mobile-responsive design

Quick Start

python web_ui.py
# Open http://localhost:5555

๐Ÿ“– Full Web UI Guide: See docs/WEB_UI.md


๐ŸŽฌ Live Monitoring Modes (NEW!)

KidGuard offers three monitoring modes to fit different use cases:

1. ๐Ÿค– Auto Monitor (Recommended)

Smart, cost-efficient, hands-free

python live_monitor_auto.py

โœจ Features:

  • Video transition detection - Only captures when videos change
  • Window title extraction - Gets video info without Selenium/OCR
  • Cost-saving - ~90% fewer API calls vs. fixed interval
  • Dual analysis modes - AI analysis OR keyword filtering
  • Automatic - No manual intervention needed

How it works:

  1. Monitors YouTube window title every 2 seconds
  2. Detects when video changes (title change)
  3. Captures screenshot + extracts video info (title, channel, description)
  4. Choose analysis mode:
    • AI Mode (use_ai_analysis: true): Claude analyzes screenshot โ†’ You execute recommended action
    • Keyword Mode (use_ai_analysis: false): Keyword filtering โ†’ Auto-suggest action
  5. Repeats for next video

๐Ÿ’ฐ Cost:

  • AI Mode: ~$0.01 per video (~0.3 TWD)
  • Keyword Mode: $0 (completely free!)

2. โŒจ๏ธ Manual Monitor

Full control, manual triggering

python live_monitor_manual.py

โœจ Features:

  • Press Enter to capture screenshot
  • Execute actions via commands
  • Best for spot-checking

Commands:

  • Enter - Capture screenshot
  • close - Close current tab
  • redirect - Go to safe channel
  • pause - Pause video
  • warn - Show warning
  • ok - Content is safe

3. ๐Ÿ”ง Full Mode (with Face Recognition)

Complete protection with user identification

python kidguard.py

โœจ Features:

  • Webcam-based viewer identification
  • Age-based rule enforcement
  • Automatic intervention
  • Telegram notifications

๐ŸŽฏ Analysis Modes: AI vs. Keyword Filtering

KidGuard supports two analysis modes - choose based on your needs and budget:

Mode 1: AI Analysis (use_ai_analysis: true)

When to use:

  • Need deep content understanding
  • Detect subtle inappropriate content
  • Analyze visual elements (violence, horror, etc.)
  • Best accuracy

How it works:

  1. Extract video title + channel from window
  2. Capture screenshot
  3. Send to Claude Vision API for analysis
  4. Claude provides detailed assessment + recommended action
  5. You confirm and execute

Cost: ~$0.01 per video (~0.3 TWD)

Configuration:

# config/config.yaml
analysis:
  use_ai_analysis: true

claude:
  api_key: "your-api-key"

Mode 2: Keyword Filtering (use_ai_analysis: false)

When to use:

  • Budget-conscious (zero API costs)
  • Simple blacklist filtering is enough
  • Block obvious inappropriate content
  • Fast decision making

How it works:

  1. Extract video title + channel from window
  2. Check against keyword blacklist
  3. Auto-suggest action if match found
  4. You confirm and execute
  5. Screenshot saved for records (optional)

Cost: $0 (completely free!)

Configuration:

# config/config.yaml
analysis:
  use_ai_analysis: false

  keyword_filter:
    blocked_keywords:
      - "้ฌผ"
      - "ๆๆ€–"
      - "ๆšดๅŠ›"
      # ... more keywords
    blocked_channels:
      - "ๆๆ€–"
      - "้ˆ็•ฐ"

Comparison

Feature AI Analysis Keyword Filtering
Cost ~$0.01/video $0 (Free)
Accuracy โญโญโญโญโญ Very High โญโญโญ Good
Visual Analysis โœ… Yes โŒ No
Context Understanding โœ… Yes โŒ No
Speed ~2-3 seconds Instant
Setup Need API key Just keywords
Best for Deep protection Budget-conscious

๐Ÿ’ก Recommendation:

  • Start with Keyword Mode to save costs
  • Upgrade to AI Mode when you need deeper analysis
  • Hybrid approach: Use keyword as pre-filter, AI for edge cases

๐Ÿ“‹ Content Analysis Criteria

Claude analyzes captured content for:

Category Examples Action
๐Ÿ”ด Violence Fighting, weapons, gore Immediate skip
๐Ÿ”ด Horror Jump scares, creepy content Immediate skip
๐Ÿ”ด Adult Sexual content, drugs Immediate skip
๐ŸŸก Inappropriate Excessive consumerism, clickbait Warn + log
๐ŸŸก Rabbit Hole Elsagate-style, weird animations Redirect to safe content
๐ŸŸข Safe Educational, age-appropriate Allow

๐Ÿ› ๏ธ Installation

Prerequisites

# Using uv (recommended)
pip install uv
uv venv
uv pip install -r requirements.txt

# Or using pip
pip install -r requirements.txt

Option 1: Quick Start - Auto Monitor (Recommended) ๐Ÿš€

Fastest way to start protecting - no configuration needed!

# Clone the repo
git clone https://github.com/sharbui/kidguard.git
cd kidguard

# Install dependencies
uv pip install -r requirements.txt

# Start monitoring
uv run python live_monitor_auto.py

# Open YouTube and play videos
# Monitor will auto-detect video changes and capture screenshots

Option 2: Web UI Configuration ๐ŸŒ

# Launch Web UI
python web_ui.py

# Open http://localhost:5555 in your browser
# Configure settings through the friendly web interface

Option 3: Full Mode (Face Recognition + Automation)

# Configure
cp config/config.example.yaml config/config.yaml
# Edit config.yaml with your settings

# Run
python kidguard.py

Configuration

# config.yaml
claude_api_key: "your-api-key"

family:
  - name: "ๅฐ้›ž"
    age: 8
    face_encoding: "encodings/chicken.pkl"
  - name: "้ดจ้ดจ" 
    age: 6
    face_encoding: "encodings/duck.pkl"
  - name: "่‡ญ้ญš"
    age: 4
    face_encoding: "encodings/fish.pkl"

rules:
  max_child_age: 12
  auto_skip: true
  safe_channels:
    - "UCX6OQ3DkcsbYNE6H8uQQuVA"  # MrBeast
    - "UC295-Dw_tDNtZXFeAPAQKEw"  # Cocomelon
  
notifications:
  telegram_bot_token: "your-bot-token"
  telegram_chat_id: "your-chat-id"

๐Ÿ“ฑ Demo

[Demo video will be here]

Scenario:

  1. Child opens YouTube on family computer
  2. KidGuard detects YouTube + identifies viewer as "้ดจ้ดจ" (age 6)
  3. Child clicks on a horror game video
  4. KidGuard captures 5 seconds, Claude analyzes โ†’ "Horror content detected"
  5. Video auto-skips to a Cocomelon episode
  6. Parent receives Telegram notification with details

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Why This Matters

  • 4.5 billion videos are watched on YouTube daily
  • 80% of parents worry about what their kids watch online
  • Elsagate showed us how algorithm-driven content can harm children
  • Existing parental controls are easily bypassed

KidGuard puts AI to work protecting the most vulnerable internet users.


๐Ÿ“„ License

MIT License โ€” Use it, modify it, protect your kids with it.


๐Ÿ™ Acknowledgments

  • Built with Claude by Anthropic
  • Powered by OpenClaw
  • Made with โค๏ธ by a parent who's tired of monitoring YouTube 24/7

About

AI-powered YouTube content guardian for young children using Claude Vision API. Features custom rules, live monitoring, and web UI for parental control. Built for Claude Code Hackathon 2026.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages