Skip to content

Repository files navigation

AstroGuard

A Chrome extension that detects Reddit bots and astroturfing using a tiered analysis pipeline — fast heuristics first, then optional deep analysis with a local LLM via Ollama.

Built for HooHacks 2026.

AstroGuard

Features

  • Automatic scanning on Reddit threads — badges appear next to usernames as comments are analyzed
  • Tiered detection
    • Tier 0 — Known bots, suspended/banned/deleted accounts
    • Tier 1 — Heuristic scoring from account metadata and comment patterns
    • Tier 2 — Local LLM analysis for bot behavior and AI-written content detection
  • Profile deep analysis — Run a full LLM pass on up to 50 recent comments from any user profile
  • Insights dashboard — Subreddit-level integrity stats and signal breakdowns
  • Bot comment actions — Show badges, auto-minimize suspicious comments, or disable the extension

Install in Chrome

  1. Clone or download this repository.

  2. Install Ollama (required for Tier 2 / deep analysis):

    • Download from ollama.com/download
    • Pull a model:
      ollama pull llama3.2
    • Make sure Ollama is running (it starts automatically after install).
  3. Load the extension:

    • Open chrome://extensions
    • Enable Developer mode (top right)
    • Click Load unpacked
    • Select this project folder (AstroGuard)
  4. Configure (optional but recommended):

    • Click the AstroGuard icon in your toolbar
    • Under Local LLM (Ollama), confirm the endpoint (http://127.0.0.1:11434) and model (llama3.2), then click Test
    • For higher Reddit rate limits, add a Reddit app Client ID and click Login (see below)
  5. Use it — Open any Reddit thread. AstroGuard scans comment authors automatically and shows colored badges next to usernames.

Reddit Login (Optional)

Authenticated requests give you a higher Reddit API rate limit.

  1. Go to reddit.com/prefs/apps
  2. Create an app — type: installed app
  3. Set the redirect URI to the value shown in the AstroGuard popup settings
  4. Paste the Client ID into the extension and click Login

How Detection Works

Reddit page → content script finds usernames
     ↓
Background worker fetches account + comment data
     ↓
Tier 1 heuristics (account age, karma, comment patterns)
     ↓
Score ≥ 40%? → Tier 2 local LLM via Ollama
     ↓
Badge + optional minimize + insights persistence

Heuristic signals include young accounts, karma imbalances, repetitive posting, and suspicious comment patterns. When the heuristic score crosses the threshold (or you trigger Deep Analysis manually), AstroGuard sends account metadata and recent comments to your local Ollama model, which returns a bot likelihood score and AI-content detection score.

Project Structure

File Purpose
manifest.json Extension configuration (Manifest V3)
background.js Reddit API, heuristics, Ollama LLM, caching, insights DB
content.js / content.css Injected UI on Reddit — badges, cards, profile panel
popup.html / popup.js Extension popup — scan results and settings
insights.html / insights.js Full-page analytics dashboard
logo.png / icon128.png Branding (sourced from AstroGuard Logo 1.png)

Privacy

  • Reddit OAuth tokens and scan data are stored locally in chrome.storage
  • Tier 2 analysis sends comment text to your local Ollama instance only — nothing is sent to a cloud API
  • No telemetry or external analytics

Limitations

  • Heuristic-only users (score below 40%) won't trigger LLM analysis unless you use Deep Analysis
  • Ollama must be running locally for Tier 2 features
  • Reddit rate limits apply without OAuth login
  • Not published on the Chrome Web Store — load unpacked for now

Development

No build step required. The extension is vanilla JavaScript.

npm install   # optional — chrome-types for IDE autocomplete only

After making changes, go to chrome://extensions and click the refresh icon on AstroGuard.

License

Personal portfolio project. Use and adapt as you like.

About

Chrome extension to detect astroturfing on Reddit, which is when coordinated bot accounts attempt to push an agenda

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages