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

  1. 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.
  2. 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.
  3. WebView security: Building a CSP-compliant WebView from scratch required careful separation of all JavaScript into external files and avoiding any inline event handlers.
  4. 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

Share this project:

Updates

posted an update

Update: FlairGuard is Approved & Public! We are excited to announce that FlairGuard has passed Reddit's developer review and is now officially public in the Reddit App Directory!

Here’s what’s new in this build:

Now Public: Ready to be installed on any subreddit directly from the App Store. Secured Mod Dashboard: Added strict backend and frontend checks to ensure only authorized moderators can access or edit configurations. Reliability Boosts: Integrated Redis deduplication to prevent double-triggered actions, and set up an automated welcome modmail for new installs. Install FlairGuard today and streamline your moderation workflow! Thank you for the support!

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

posted an update

Huge milestone reached: FlairGuard has passed Reddit's manual security review!

I am excited to announce that FlairGuard has officially cleared the manual review process for Custom Post apps! This means the production version (v0.0.12) is now fully approved and available for moderators to install.

What we have achieved since the last update:

  • Passed Manual Review: Our 'Zero-Inline' security architecture was successfully audited and approved by the Reddit team.
  • Live Stats Dashboard: Moderators now get real-time feedback on bot status and action counts.
  • Complete Audit Logs: Every moderation action is now searchable, ensuring total transparency for mod teams.
  • Community Announcements: Directly manage subreddit-wide status updates from the mod panel.

Try the approved version here: https://developers.reddit.com/apps/flairguard-app

This journey from a concept to an officially approved Reddit app has been incredible. Thank you to the Devvit community for all the feedback! Now, it is time to finalize the demo video and get ready for the grand finale.

RedditHackathon #Devvit #ModTools #AppApproved

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

posted an update

I am thrilled to announce that FlairGuard is now officially published to the Reddit app directory! It has been an intense development journey, and I wanted to share a look at how the app has evolved over the last few weeks.

Milestone 1: The Foundation We started with a simple goal: automate flare-based removals. The first version was a background script that could identify flares, but it lacked a user interface.

Milestone 2: The Dashboard Revolution I realized that for a tool to be useful, it needs to be accessible. I built a custom WebView dashboard directly within Reddit. This allows moderators to manage their rules without ever leaving the site.

Milestone 3: The Security Hardening (CSP Fixes) One of the biggest technical hurdles was Reddit's strict content security policy (CSP). I completely re-engineered the frontend to move away from inline scripts and styles. This resulted in a "Zero-Inline" architecture that is 100% secure and extremely fast.

Milestone 4: New Feature — Community Status & Logs Based on feedback, I added two major features:

Searchable Action Logs: Total transparency on every bot action. Community Status Post: A one-click way for mods to update a stickied announcement directly from the dashboard. What's live now? v0.1.0 is published! You can find it in the App Directory. Live Stats Bar: Added a premium-looking dashboard header. Markdown Support: Removal reasons now support full Reddit markdown formatting.

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