Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Guardian-Net: Privacy-First Digital Safety Platform

Guardian-Net is a revolutionary approach to online child and teenager safety that prioritizes education and empowerment over surveillance. Instead of tracking, recording, and reporting children's private messages to parents, Guardian-Net acts as an on-device, real-time digital safety assistant. It guides young users through context-aware, educational interventions directly at the point of communication, fostering agency and trust.


πŸ“– Table of Contents


πŸ” What is Guardian-Net?

Guardian-Net is a prototype of an intelligent digital safety keyboard/web application designed to protect minors in real-time. Operating entirely on-device to protect user privacy, it runs incoming text through a hybrid sentiment and semantic analysis engine to classify risk levels and suggest safety interventions when potentially dangerous situations (grooming, direct threats, cyberbullying, self-harm, location leakage) are detected.


🧠 Core Philosophy

Guardian-Net represents a paradigm shift:

  • Privacy-First: User messages are never stored, logged, or uploaded to servers. All logic is executed in the user's local runtime.
  • Education Over Surveillance: Instead of locking down communication or secretly notifying guardians of specific texts, Guardian-Net teaches the user why a message is risky and allows them to self-correct.
  • Trust Building: It avoids parental surveillance loops that lead to kids finding workarounds. It rebuilds healthy communication channels between teens and guardians.

πŸ“¦ Project Structure & Components

The workspace contains both prototype mockups and a fully functional React web application:

Guardian-Net web app/
β”œβ”€β”€ .gitignore                   # Root Git ignore configuration
β”œβ”€β”€ .vscode/                     # VS Code local workspace configurations (ignored by Git)
β”œβ”€β”€ README.md                    # Root project documentation (this file)
β”œβ”€β”€ Project.docx                 # Project proposal documentation (ignored by Git)
β”œβ”€β”€ pro.pdf                      # Comprehensive project proposal/spec PDF (ignored by Git)
β”œβ”€β”€ files.zip                    # Archive of core files (ignored by Git)
└── files/                       # Core source files directory
    β”œβ”€β”€ PROJECT_SUMMARY.md       # High-level feature summary & roadmap
    β”œβ”€β”€ TECHNICAL_SPEC.md        # Technical design & architecture specification
    β”œβ”€β”€ IMPLEMENTATION_GUIDE.md  # Detailed step-by-step setup guides
    β”œβ”€β”€ README.md                # Component-level documentation
    β”œβ”€β”€ guardian-net.jsx         # Standalone React Component prototype
    β”œβ”€β”€ demo.html                # Standalone HTML demo (no build required, browser-ready)
    β”œβ”€β”€ package.json             # Legacy package.json for Create React App
    └── web-app/                 # Complete, modern web application (React 19 + Vite + Tailwind CSS 4)
        β”œβ”€β”€ .gitignore           # Web app-specific gitignore
        β”œβ”€β”€ .oxlintrc.json       # Oxlint linter settings
        β”œβ”€β”€ package.json         # Package configuration & modern dependencies
        β”œβ”€β”€ package-lock.json    # Package lockfile
        β”œβ”€β”€ index.html           # HTML entry point for Vite
        β”œβ”€β”€ vite.config.js       # Vite build configurations (React + Tailwind plugins)
        β”œβ”€β”€ public/              # Static assets (Favicons, SVG icons)
        └── src/                 # Application source
            β”œβ”€β”€ main.jsx         # Web application mount point
            β”œβ”€β”€ index.css        # Global CSS, Google Fonts, Tailwind 4 directives
            β”œβ”€β”€ App.jsx          # Interactive main interface & safety engine
            β”œβ”€β”€ App.css          # Main layout styles
            └── assets/          # Static images & graphics (hero backgrounds, logos)

✨ Key Features

  1. Asynchronous Text Analysis Engine:
    • Non-blocking Architecture: Input is debounced at 300ms and analyzed asynchronously in the background. The keyboard or text field remains 100% fluid with 0ms lag.
    • Hybrid Filtering: Pre-filters obvious phrases instantly, then performs broader semantic evaluation.
    • Multi-line Evasion Detection: Input is normalized before analysis β€” newlines, tabs, and extra whitespace are collapsed into single spaces so phrases split across lines (e.g. "i\nwill\nkill\nyou") are correctly detected.
  2. 4-Tier Risk Classification System:
    • SAFE (Green): Standard message. No interventions.
    • NUDGE (Blue): Mild bullying expression or frustration. Gentle check-in and reflection prompt.
    • HIGH (Orange): Cyberbullying (received), solicitation requests. Immediate modal popup with safety guidance.
    • CRITICAL (Red/Pulse): Self-harm patterns, direct threats, grooming. Popup with support resources (hotlines) and guardian alert.
  3. Dual Detection Engines:
    • Child Distress Detector β€” scans messages typed by the child for self-harm signals, anger, bullying language, and general distress.
    • Stranger Threat Detector β€” scans messages incoming from strangers for grooming, physical threats, solicitation, and cyberbullying.
  4. Visual Feedback System:
    • Visual borders dynamically alert the user. Color borders (Green β†’ Orange/Glow β†’ Yellow β†’ Red) shift in real-time as they type, providing ambient, non-intrusive safety status checks.
  5. Educational Interventions:
    • Modal windows offer clear explanations, reflection prompts, and support resources/hotlines (e.g., Suicide & Crisis Lifeline, NCMEC CyberTipline).
  6. Gamification & Dashboard:
    • Tracks consecutive safe communication streaks, awards badges, and showcases positive choice metrics.
  7. Guardian Dashboard:
    • Privacy-preserving parent alerts (event type only β€” never message content). Configurable detection sensitivities per threat category.

πŸ”Ž Detection Engine

Safe Context Whitelist

Common phrases that contain flagged words but are safe in context are whitelisted and never trigger alerts:

  • "kill it in the game", "killing it", "die laughing", "gonna kill this exam", etc.

checkChildDistress β€” Child's Own Messages

Detects distress signals in what the child types. Runs through four ordered tiers:

Tier Examples Response
Crisis "i want to die", "kill yourself", "end my life" CRITICAL modal + crisis hotlines + breathing exercise
Anger / Threat "i will kill you", "i hate everyone", "i'm going to hurt" Empathy check-in modal (no punishment)
Bullying Expression "you're so stupid", "nobody likes you" Gentle nudge before sending
General Distress "i feel hopeless", "nobody cares", "i hate my life" Support modal with resources

checkStrangerThreat β€” Incoming Stranger Messages

Detects danger in messages sent to the child from an unknown contact. Four ordered checks:

Check Sensitivity Gate Examples Alert Level
Grooming grooming setting "don't tell your parents", "send me pics of yourself", "our little secret" 🚨 CRITICAL
Direct Threats threats setting "i will kill you", "i'm at your home", "open the door", "you're dead", "watch your back", "i know where you are" 🚨 CRITICAL
Solicitation solicitation setting "send me some pics", "can we meet", "video call me" ⚠️ HIGH
Bullying / Harassment Always active "you are so ugly", "nobody likes you", "you're worthless", "go die" πŸ›‘ HIGH

Multi-line Evasion Normalization

Both engines normalize input before pattern matching:

const lower = text.replace(/[\r\n\t]+/g, ' ').replace(/  +/g, ' ').toLowerCase();

This means splitting a phrase across lines is not an evasion technique:

i          β†’  detected as
will           "i will kill you"
kill
you

βš™οΈ Requirements & Dependencies

System Requirements

  • Node.js: version 18.0.0 or higher (recommended: 20.x or latest LTS).
  • npm: version 8.0.0 or higher.
  • A modern web browser (Chrome, Firefox, Safari, Edge) with JavaScript enabled.

Dependencies (files/web-app/package.json)

Guardian-Net relies on a modern frontend stack:

  • React: ^19.2.7 (UI Component model)
  • React DOM: ^19.2.7 (Browser rendering)
  • Lucide React: ^1.24.0 (Minimalist UI Icons)
  • Tailwind CSS: ^4.3.2 (Modern CSS framework integration)
  • Vite: ^8.1.1 (Next-gen frontend build tool / fast hot reloading)
  • Oxlint: ^1.71.0 (Ultra-fast JavaScript/React linter)

πŸš€ Setup & How to Run

Follow these steps to launch the modern web application locally:

Option A: Running the Vite Web App (Recommended)

  1. Open your terminal or command prompt.
  2. Navigate to the web-app project directory:
    cd "files/web-app"
  3. Install the required dependencies:
    npm install
  4. Launch the local development server:
    npm run dev
  5. Open your browser and navigate to the URL shown in your terminal (typically http://localhost:5173).

Option B: Standalone HTML (Immediate Execution)

If you wish to view a conceptual demo without installing Node.js or run-time packages:

  1. Navigate to the files/ directory.
  2. Double-click demo.html to open it directly in any web browser.

πŸ§ͺ Test Scenarios

Use the Demo Scenarios panel in the sidebar, or type messages manually to test. Switch between Child and Stranger roles using the role switcher in the chat header.

Demo Scenarios (click to auto-run)

Scenario Role Message Sent Expected Popup
Stranger Grooming Attempt Stranger "you seem so mature for your age, don't tell your parents we're talking" 🚨 CRITICAL β€” Grooming alert
Receive Bullying Message Stranger "you are so ugly and nobody likes you" πŸ›‘ HIGH β€” Bullying detected popup
Child In Distress Child "i feel so hopeless and i hate my life" πŸ’™ Support modal with resources
Self-Harm Language Child "i want to die" 🚨 CRISIS β€” Crisis support modal
Normal Safe Message Child "hey just checking in, how are you?" βœ… No alert β€” Safe message

Manual Test Cases

Risk Level Input Example Expected Behavior
Safe (Contextual) "I'm going to kill it in this game!" No alert β€” gaming slang whitelisted
High β€” Bullying (Stranger) "you are so ugly and nobody likes you" πŸ›‘ Bullying message popup
Critical β€” Threat (Stranger) "i will kill you" 🚨 Threatening message popup
Critical β€” Threat (Stranger) "i am at your home, open the door" 🚨 Threatening message popup
Critical β€” Threat (Stranger) "you're dead, watch your back" 🚨 Threatening message popup
Critical β€” Self-harm (Child) "i want to die" 🚨 Crisis support modal
Distress (Child) "i feel hopeless and nobody cares" πŸ’™ Support modal
Multi-line evasion i ↡ will ↡ kill ↡ you 🚨 Detected β€” line breaks collapsed

πŸ“‚ Git & GitHub Upload Readiness Check

Before publishing this repository to GitHub, verify that your local environment matches the exclusion policies set up in .gitignore.

πŸ” What Will Be Uploaded (Ready for GitHub):

  • files/ directory containing markdown specifications, standalone code files (guardian-net.jsx, demo.html), and the web-app source code (src/, public/, config files).
  • Root configuration files (README.md, .gitignore).

🚫 What Will Be Ignored (Excluded from Upload):

  • node_modules/ (All package dependencies inside files/web-app/node_modules/ will be ignored, preventing uploads of thousands of vendor files).
  • dist/ and dist-ssr/ (Local production builds).
  • *.local (Local environment secret configurations).
  • pro.pdf & Project.docx (Heavy documentation binaries).
  • files.zip & Mobile.zip (Compressed binary archives).
  • .vscode/ (Local editor settings and workspace configurations).
  • *.log & logs/ (System debug logs generated during development).

πŸ›‘οΈ Ethical Considerations & Privacy Commitments

Guardian-Net is designed under strict ethical parameters:

  1. Local Inference: Natural language analysis occurs strictly client-side using JavaScript β€” no data ever leaves the browser.
  2. No Snooping: The parent dashboard receives event types, but never the content of private messages, ensuring teenage agency is respected.
  3. Non-Punitive Design: When a child types something concerning, Guardian-Net always allows the message to be sent. It intervenes with empathy and education, not locks or punishments.
  4. Federated Learning Potential: Future iterations will support federated model fine-tuning where parameters, not private text records, are aggregated.

πŸ“„ License

This project is open-source and distributed under the Apache License 2.0. Feel free to use, modify, and distribute it in accordance with the terms of the license.

About

Privacy-first, on-device real-time digital safety assistant for youth. Empowering kids & teens with education over surveillance. πŸ›‘οΈ

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages