Fighting Spam at Scale: How We Use Gemini to Protect the DEV Community — Gemini Blog | Neura Market
    Neura MarketNeura Market/Gemini
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityGemsExtensionsTrendingGenerate
    GeminiBlogFighting Spam at Scale: How We Use Gemini to Protect the DEV Community
    Back to Blog
    Fighting Spam at Scale: How We Use Gemini to Protect the DEV Community
    ai

    Fighting Spam at Scale: How We Use Gemini to Protect the DEV Community

    Ben Halpern January 21, 2026
    0 views

    Eliminating spam has been a massive priority for us at DEV (and the wider Forem ecosystem). If you’ve...

    Eliminating spam has been a **massive priority** for us at DEV (and the wider Forem ecosystem). If you’ve been with us for a while, you recall that this has been a significant problem in the past. While no platform can claim to be 100% spam-free, the situation is much improved today. Our primary goal with these recent updates is simple: **get super low-quality content off the platform before a human moderator ever has to deal with it.** Moderator burnout is real. By automating the removal of the "obvious" junk, we allow our mods to focus on nuanced community interactions rather than deleting hundreds of crypto-scam posts. ## The Hybrid Approach: Algorithms + AI We don’t rely on just one tool. We use a combination of upstream algorithmic detection and "call-outs" to Gemini for independent analysis. 1. **Algorithmic Upstream Action:** If we detect a clear trend—for example, a massive burst of posts linking to a specific spam website—we take action upstream. We prefer to handle these efficiently without needing to query an LLM for every single instance. 2. **Gemini Analysis:** For individual posts that require judgment, we send a custom prompt to Gemini 3. We try to err on the side of "no false positives," but when the AI detects clear indicators of spam or harmful content, it applies a label that triggers automated workflows. ## Under the Hood: The `ContentModerationLabeler` To give you a better picture of how this works technically, let's look at our `ContentModerationLabeler` service. This Ruby class is responsible for building the context and asking Gemini to categorize the post. We hone these custom prompts over time to ensure accuracy. Here is how we define the assessment criteria within the prompt. We tell Gemini exactly what we are looking for, distinguishing between "Safety," "Quality," and "Spam": ```ruby def build_prompt # ... (Context setup) <<~PROMPT Analyze the following article and assign it a content moderation label based on quality, relevance, and community standards. # ... **Assessment Criteria:** 1. **Safety First**: Is the content harmful, exploitative, or inciting violence/hostility? 2. **Content Quality**: Is the content well-written, informative, and valuable? 3. **Community Relevance**: Does the content align with the community's purpose and interests? 4. **Authenticity**: Does the content appear to be written by a real person with genuine insights? 5. **Spam Indicators**: Are there signs of promotional content, low-effort posts, or automated generation? 6. **Community Building**: Does the content foster discussion and community engagement? # ... PROMPT end ``` ### Context is King One key to our success is that we don't just send Gemini the text of the article. We also build a **User Context**. A post that looks "okay" might actually be spam if it comes from a brand-new account with zero history. Conversely, a trusted member with badges and years of history gets the benefit of the doubt. We feed these metrics into the prompt so Gemini has the full picture: ```ruby def build_user_context user = @article.user <<~USER_CONTEXT Author: #{user.name} (@#{user.username}) Member since: #{user.created_at.strftime('%B %Y')} Badge achievements: #{user.badge_achievements_count} Articles published: #{user.articles.published.count} Comments made: #{user.comments.count} Profile summary: #{user.profile&.summary || 'No summary provided'} USER_CONTEXT end ``` [**View the ContentModerationLabeler on GitHub**](https://github.com/forem/forem/blob/main/app/services/ai/content_moderation_labeler.rb) ## The "Spam Peak" Irony One interesting observation from our data is regarding the volume of spam. Ironically, the cumulative amount of labeled spam peaked right *before* we fully integrated these new systems. Spam peak was summer of 2025. ![spam peak](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf5rd4n93jnt8afwifjt.png) This happens because deterrence works. As soon as bad actors realize their automated scripts are hitting a wall and their posts are being nuked immediately by our automated systems, they stop wasting resources on our platform. The high wall of entry leads to fewer attempts over time. ## Moving Forward This system will continue to evolve. We are constantly tweaking our prompts and our upstream algorithms to adapt to new spam tactics. While there are several services that handle different types of spam across the platform, you can view the full source code for this specific approach in our open-source repository: {% github https://github.com/forem/forem %} Happy coding ❤️

    Tags

    aigeminidevtosecurity

    Comments

    More Blog

    View all
    How to prompt Gemini 3.1's new text to speech modelai

    How to prompt Gemini 3.1's new text to speech model

    Gemini 3.1 Flash text to speech (TTS) is a new model that you can direct to get the precise audio...

    F
    fofr
    Building Multimodal Real Time Agent with ADK, Azure AKS, Gemini CLI, and Gemini Flash Live 3.1googleadk

    Building Multimodal Real Time Agent with ADK, Azure AKS, Gemini CLI, and Gemini Flash Live 3.1

    Leveraging the Google Agent Development Kit (ADK) and the underlying Gemini LLM to build cross cloud...

    X
    xbill
    Building a Multimodal Agent with the ADK, Amazon ECS Express, and Gemini Flash Live 3.1googleadk

    Building a Multimodal Agent with the ADK, Amazon ECS Express, and Gemini Flash Live 3.1

    Leveraging the Google Agent Development Kit (ADK) and the underlying Gemini LLM to build Agentic apps...

    X
    xbill
    Building a Multimodal Agent with the ADK, Amazon Lightsail, and Gemini Flash Live 3.1python

    Building a Multimodal Agent with the ADK, Amazon Lightsail, and Gemini Flash Live 3.1

    Leveraging the Google Agent Development Kit (ADK) and the underlying Gemini LLM to build Agentic apps...

    X
    xbill
    Building a Multimodal Cross Cloud Live Agent with ADK, Amazon EKS, and Gemini CLIpython

    Building a Multimodal Cross Cloud Live Agent with ADK, Amazon EKS, and Gemini CLI

    Leveraging the Google Agent Development Kit (ADK) and the underlying Gemini LLM to build cross cloud...

    X
    xbill
    Building a Multimodal Agent with the ADK, Azure ACA, and Gemini Flash Live 3.1googleadk

    Building a Multimodal Agent with the ADK, Azure ACA, and Gemini Flash Live 3.1

    Leveraging the Google Agent Development Kit (ADK) and the underlying Gemini LLM to build Agentic apps...

    X
    xbill

    Stay up to date

    Get the latest Gemini prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Gemini and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.