Inspiration
Reddit already has great tools for manual moderation — saved responses, auto-lock on removal and AutoModerator. But all of these require the mod to actively click "Remove," then select a response, then decide on locking.
More importantly, none of Reddit's native tools can trigger actions based on a flare change. Flairs are one of the most common signals mods use to categorize posts — but they're purely visual. There's no native way to say When a mod applies the 'Rule Violation' flair, automatically remove the post, post a stickied removal reason, and send the author a modmail."
FlairGuard was built to fill that exact gap—turning a flare into a powerful, configurable automation trigger.
What it does
FlairGuard is a Devvit app that automates moderation actions the moment a A moderator applies a specific flair to a post. Unlike Reddit's built-in tools (which trigger on submission or require manual clicks), FlairGuard listens for flare changes and instantly enforces the matching rule.
For each flare, moderators can configure: • Auto-remove the post • Post a custom stickied removal reason comment • Lock the thread • Send a modmail to the post author with a removal explanation • Issue a temporary ban (configurable duration in days)
All rules are managed through a secure, moderator-only Rules Dashboard— a custom WebView interface built with a premium dark-mode UI. Every action FlairGuard takes it and records it in a live Audit Log visible on the dashboard. giving moderation teams full transparency.
The dashboard also supports a Community Status panel, allowing moderators to post subreddit-wide announcements directly from the FlairGuard interface.
How we built it
FlairGuard is built entirely on Devvit using the Devvit Web framework: • Backend: TypeScript server (Devvit Web) handling all API endpoints, flair trigger events, and Reddit API calls (remove, lock, comment, ban, modmail). • Frontend: Vanilla HTML/CSS/JS WebView dashboard with a premium dark-mode UI, glassmorphism design, and smooth micro-animations. • Storage: Redis (via Devvit's built-in KV store) for persisting rules, audit logs and deduplication keys. • Security: Every dashboard API endpoint is protected by a a moderator-verification layer that calls Reddit. getModerators() and confirms the requesting user is an active mod before allowing access. • Flair Trigger: The PostFlairUpdate Devvit trigger fires the automation. pipeline, with 120-second deduplication to prevent double-processing. • CSP Compliance: The WebView is fully Content Security Policy compliant. with no inline scripts or unsafe eval.
Challenges we ran into
- Flair trigger payload shape: The Devvit Web PostFlairUpdate trigger delivers a non-obvious JSON payload. We had to inspect the raw body carefully to correctly extract post ID, flair text, and author name.
- Moderator verification in the simulator: The local Devvit playtest simulator returns an empty moderator list from reddit.getModerators(), making it impossible to test the dashboard as a mod locally. We implemented a safe localhost-only bypass that is automatically disabled in production.
- WebView security: Building a CSP-compliant WebView from scratch required careful separation of all JavaScript into external files and avoiding any inline event handlers.
- Framing the value proposition: Early feedback from moderators pointed out that Reddit already has saved responses and auto-lock defaults for manual removals. We refined FlairGuard's description to clearly communicate that its unique value is the flair-change trigger— something Reddit's native tools do not support.
Accomplishments that we're proud of
• Built a fully functional flair-triggered automation pipeline end-to-end on Devvit Web, including remove, lock, comment, modmail, and ban. • Designed a premium moderator dashboard with a dark-mode UI that feels native to Reddit's aesthetic. • Implemented a robust moderator-only access control layer securing all API endpoints. • Built a live Audit Log giving moderation teams full transparency into every automated action. • Achieved full CSP compliance with no security compromises in the WebView.
What we learned
• The Devvit trigger system is powerful but requires careful attention to the payload shape for each trigger type. • The local Devvit simulator has limitations (like empty moderator lists). that require workarounds during development. • Community feedback from active moderators is invaluable — their input directly shaped how we frame FlairGuard's value proposition. • Moderators already have good tools for manual removals; the real gap is automation triggered by flair changes, which Reddit does not natively support.
What's next for FlairGuard
• Regex-based flare matching (partially implemented) — allow rules to Match any flair containing a keyword, not just exact text. • Per-flair custom modmail templates with dynamic variables like {post_title}, {author}, {flair}. • Scheduled post sweeps—automatically re-check posts that have been flared for longer than a configurable time limit. • Multi-language removal reasons for international subreddits. • Integration with Reddit's native Removal Reasons system as a fallback for communities that already have reasons configured.
Built With
- css3
- devvit
- devvit-web
- html5
- redis
- typescript


Log in or sign up for Devpost to join the conversation.