💡 Inspiration

Reddit is home to some of the most vibrant, fast-paced discussion boards on the internet. However, moderators face a constant uphill battle: viral escalations and coordinated brigading. A single spark can turn a peaceful thread into a toxic flame war in minutes.

Existing moderation bots (built on old Data APIs) are reactionary—they only alert moderators or take actions after a thread has already accumulated hundreds of toxic comments, when the damage is already done.

We built Thread Sentinel to be the ultimate early-warning radar and proactive shield for Reddit communities. It is designed to act like a smoke detector, detecting and containing toxicity the absolute second it begins, rather than waiting to fight a raging forest fire.


🔍 What it Does

Thread Sentinel is a real-time thread safety management system that acts as a proactive defensive grid for subreddits. It operates on a three-pillared architecture:

  1. 🔥 Multi-Signal Heat Engine: Rather than scanning only keywords, Sentinel computes a unified Heat Score (0-100) in real-time for every thread based on three distinct, weighted parameters:

    • Report Velocity (50% weight): Tracks a sudden surge of user reports over a rolling 10-minute window.
    • New-Account Ratio (30% weight): Detects brigading or ban evasion by measuring the percentage of comments written by accounts younger than 30 days.
    • Keyword hits (20% weight): Scans for blocks of harassing, toxic, or brigaded terms.
    • Self-Dilution Safeguard: Includes a smart algorithm where civil comments (like moderators stepping in) dynamically reduce the score to avoid false alarms.
  2. 📊 Live Command Dashboard (Custom Post): Sentinel creates a secure, mod-only interactive Custom Post right inside your subreddit feed. Mods can see live metrics, at-risk threads, and execute instant administrative commands (🔒 Lock, 🗑️ Remove, ✅ Dismiss) in one click with safety confirmation modals.

  3. 👥 "Claim & Coordinate" Team Handoff: To prevent multiple mods from handling the same alert, mods can click Claim. The dashboard instantly updates for the entire team to show 🟡 Claimed by u/ModName, bringing enterprise-level team collaboration directly to Reddit.

  4. 🛡️ "Auto-Shield" Dynamic Crowd Control: The second a thread crosses a critical threshold, Sentinel automatically activates Auto-Shield on that thread only. Any comments written by new accounts are automatically filtered/removed with a moderator log. Once the heat decays back to normal, the shield automatically lifts!


🛠️ How We Built It

Thread Sentinel is built 100% natively on Devvit (Reddit's Developer Platform), leveraging its speed and state caching:

  • TypeScript & TSX: The core logic is structured in clean modular TypeScript, while the dashboard is engineered using Devvit's interactive UI blocks.
  • Redis KV Store: Sentinel tracks comment/report rolling windows, alert states, and active team claims with microsecond speed using Devvit's built-in Redis client.
  • Real-time Triggers: Uses high-speed CommentCreate and PostReport triggers to intercept and calculate heat scores instantaneously.

🚧 Challenges We Faced

  • Type Alignment in Event Payloads: Trigger events receive truncated metadata (like CommentV2), which lacks standard API fields. We solved this by implementing an API bridge that fetches the full Comment object dynamically.
  • State Decay over Time: We needed heat scores to naturally decay to prevent inactive threads from clogging the dashboard. We engineered a mathematical decay algorithm that naturally reduces scores by 10% for every 5 minutes of inactivity.
  • Avoiding API Limits: Fetching user profiles to check account age can quickly hit API limits in viral threads. We solved this by implementing an intelligent Redis Cache Layer that caches user account ages for 24 hours.

🎉 Accomplishments We're Proud Of

  • We successfully created a dynamic, local-first Crowd Control system (Auto-Shield) that locks down specific threads without restricting the entire subreddit.
  • The UI dashboard renders beautifully, works in real-time, and responds to clicks with robust, native Reddit API actions like lock and remove.
  • Achieved a flawless code architecture with zero TypeScript warnings or compilation errors.

🧠 What We Learned

We learned how powerful Devvit's sandboxed environment is. Having access to high-speed triggers, persistent Redis storage, and interactive UI components in one consolidated, serverless platform allowed us to build a tool that would have required multiple servers, databases, and fragile polling structures on old Data APIs.


🚀 What's Next for Thread Sentinel

  • Discord Webhook Alerts: Push critical alarms directly to moderator Discord channels for external team notifications.
  • Weekly Briefings: An automated custom post that summarizes weekly subreddit analytics, alerts fired, and false-alarm rates to help mods fine-tune their thresholds over time.

Built With

Share this project:

Updates