Skip to content

Clean up your online footprint without blowing away everything, analyze the content of comments to identify anything that might be likely to reveal PII that you may not want correlated with your anonymous username and perform sentiment analysis on the content of those posts.

License

Notifications You must be signed in to change notification settings

taylorwilsdon/reddacted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

reddacted: AI-Powered Reddit Privacy Suite

Privacy Shield AI Analysis GitHub License GitHub commit activity PyPI - Version

image image

What is reddacted?

Local LLM powered, highly performant privacy analysis leveraging AI, sentiment analysis & PII detection to provide insights into your true privacy with bulk remediation

Β· For aging engineers who want to protect their future political careers πŸ›οΈ

πŸ›‘οΈ PII Detection - Analyze the content of comments to identify anything that might be likely to reveal PII that you may not want correlated with your anonymous username and perform sentiment analysis on the content of those posts

🀫 Sentiment Analysis - Understand the emotional tone of your Reddit history, combined with upvote/downvote counts & privacy risks you can choose which posts to reddact based on a complete picture of their public perception

πŸ”’ Zero-Trust Architecture - Client-side execution only, no data leaves your machine unless you choose to use a hosted API. Fully compatible with all OpenAI compatible endpoints

⚑ Self-Host Ready - Easy, lazy, completely local: You can use any model via Ollama, llama.cpp, vLLM or other platform capable of exposing an OpenAI-compatible endpoint. LiteLLM works just dandy. β€’ Cloud: OpenAI-compatible endpoints

πŸ“Š Smart Cleanup - Preserve valuable contributions while removing risky content - clean up your online footprint without blowing away everything

Table of Contents

πŸ” Can I trust this with my data?

# you don't have to - read the code for yourself, only reddit is called
reddacted user yourusername \
  --local-llm "localhost:11434"
  • Client-side execution only, no tracking or external calls
  • Session-based authentication if you choose - it is optional unless you want to delete
  • Keep your nonsense comments with lots of upvotes and good vibes without unintentionally doxing yourself someday off in the future when you run for mayor.
reddacted user taylorwilsdon --limit 3
reddacted_interactive_update_demo.mov

Installation

# Install from PyPI (recommended)
pip install reddacted

# Or install from source
git clone https://github.com/taylorwilsdon/reddacted.git
cd reddacted
pip install -e ".[dev]"  # Installs with development dependencies

Quick Start

# Analyze a user's comments
reddacted user spez --limit 5 --local-llm "localhost:11434"

# Analyze a specific post
reddacted listing r/privacy abc123 --limit 10 --local-llm "localhost:11434"

Note: The examples above use a local LLM. For cloud-based analysis, omit the --local-llm flag and configure your OpenAI API key:

export OPENAI_API_KEY="your-api-key"

Support & Community

Join our subreddit: r/reddacted

❓ How accurate is the PII detection, really?

Surprisingly good. Good enough that I run it against my own stuff in delete mode. It's basically a defense-in-depth approach combining these, and I'll probably add upvotes/downvotes into the logic at some point:

  • AI Detection: Doesn't need a crazy smart model, don't waste your money on r1 or o1.
    • Cheap & light models like gpt-4o-mini, gpt-3.5-turbo, qwen2.5:3b or 7b and Mistral are all plenty.
    • Don't use something too dumb or it will be inconsistent, a 0.5b model will produce unreliable results.
    • It works well with cheap models like qwen2.5:3b (potato can run this) and gpt-4o-mini, which is like 15 cents per million tokens
  • Pattern Matching: 50+ regex rules for common PII formats does a first past sweep for the obvious stuff
  • Context Analysis: Are you coming off as a dick? Perhaps that factors into your decision to clean up. Who could say, mine are all smiley faces.

πŸ’‘ FAQ

Q: How does the AI handle false positives?

A: Adjust confidence threshold (default 0.7) per risk tolerance. You're building a repo from source off some random dude's github - don't run this and just delete a bunch of shit blindly, you're a smart person. Review your results, and if it is doing something crazy, please tell me.

Q: What LLMs are supported?

A: Local: any model via Ollama, vLLM or other platform capable of exposing an openai-compatible endpoint. β€’ Cloud: OpenAI-compatible endpoints

Q: Is my data sent externally?

A: If you choose to use a hosted provider, yes - in cloud mode - local analysis stays fully private.

Troubleshooting

If you get "command not found" after installation:

  1. Check Python scripts directory is in your PATH:
# Typical Linux/Mac location
export PATH="$HOME/.local/bin:$PATH"

# Typical Windows location
set PATH=%APPDATA%\Python\Python311\Scripts;%PATH%
  1. Verify installation location:
pip show reddacted

Authentication

Before running any commands that require authentication, you'll need to set up your Reddit API credentials. Here's how:

  1. Create a Reddit Account: If you don't have one, sign up at https://www.reddit.com/account/register/

  2. Create a Reddit App:

  3. Get Your Credentials:

    • After creating the app, note down:
      • Client ID: The string under "personal use script"
      • Client Secret: The string labeled "secret"
  4. Set Environment Variables:

$ export REDDIT_USERNAME=your-reddit-username
$ export REDDIT_PASSWORD=your-reddit-password
$ export REDDIT_CLIENT_ID=your-client-id
$ export REDDIT_CLIENT_SECRET=your-client-secret

Now when running the CLI with --enable-auth, all requests will be properly authenticated. These credentials are also automatically used if all environment variables are present, even without the --enable-auth flag.

Advanced Usage

Text Filtering

You can filter comments using these arguments:

  • --text-match "search phrase" - Only analyze comments containing specific text (requires authentication)
  • --skip-text "skip phrase" - Skip comments containing specific text pattern

For example:

# Only analyze comments containing "python"
reddacted user spez --text-match "python"

# Skip comments containing "deleted"
reddacted user spez --skip-text "deleted"

# Combine both filters
reddacted user spez --text-match "python" --skip-text "deleted"

Development

  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install in development mode with test dependencies:
pip install -e ".[dev]"

That's it! The package handles all other dependencies automatically, including NLTK data.

Testing

Run the test suite:

pytest tests

Want to contribute? Great! Feel free to:

  • Open an Issue
  • Submit a Pull Request

Common Exceptions

too many requests

If you're unauthenticated, reddit has relatively low rate limits for it's API. Either authenticate against your account, or just wait a sec and try again.

the page you requested does not exist

Simply a 404, which means that the provided username does not point to a valid page.

Pro Tip: Always review changes before executing deletions!

About

Clean up your online footprint without blowing away everything, analyze the content of comments to identify anything that might be likely to reveal PII that you may not want correlated with your anonymous username and perform sentiment analysis on the content of those posts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published