Inspiration

What it does

RuleGuard scans every new post and comment in your subreddit, checks them against custom rules (keywords + regex), and optionally uses GPT-4o-mini for semantic AI analysis. When a violation is found, it can flag content, auto-remove at high confidence, post an explanation comment (bilingual EN/DE), send Discord/Slack webhook alerts, and track user risk scores.

How we built it

Built on Reddit's Devvit platform with a React 19 + TypeScript web dashboard, Hono server, and GPT-4o-mini for AI analysis. The full-stack TypeScript app uses Devvit's built-in Redis for storage and Vite for bundling.

Key Features

  • Rule Engine: Keyword + regex pattern matching with configurable thresholds
  • AI Analysis: GPT-4o-mini catches semantic violations regex alone would miss
  • Auto-Moderation: Auto-remove, auto-report, auto-comment (EN/DE)
  • Dashboard: Stats, charts, flag table with approve/remove/evidence actions
  • User Risk Scoring: Weighted algorithm with risk levels (low→critical)
  • Repeat Offender Tracking: Confidence boost for repeat violators
  • Self-Learning: Tracks false positive rates per rule
  • AI Rule Suggestions: Analyzes recent posts to suggest new rules
  • Discord/Slack Alerts: Real-time webhook notifications
  • Evidence Module: One-click AI evidence generation per flag
  • Rule Templates: 3 pre-built rule sets (AMA, Quality, No Self-Promotion)

Challenges

Integrating AI with Devvit's limited runtime required careful architecture. The Redis singleton didn't support hash operations on Reddit's platform, requiring a migration to composite keys. Making the dashboard bilingual (EN/DE) added complexity to every user-facing string.

What's next

In-modqueue integration, image moderation (AI vision), ban evasion detection, additional AI models.

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for RuleGuard

Built With

Share this project:

Updates

Submission history