Skip to main content

Sanitize sensitive content from any text before sharing with AI assistants

Project description

🧹 scrub-ai

Sanitize sensitive content from any text before sharing with AI assistants.

PyPI version Python 3.10+ License: MIT Platform CI


The Problem

Every day, developers copy sensitive content into AI assistants without thinking:

❌ Stack trace with internal hostnames    → pasted into ChatGPT
❌ Application logs with session tokens   → pasted into Copilot
❌ Config files with database passwords   → pasted into Claude
❌ kubectl output with cluster names      → pasted into AI
❌ AWS CLI output with account IDs        → pasted into ChatGPT

Once that data leaves your machine, you have no control over it.

scrub-ai fixes this — it detects and masks sensitive content before you share it with any AI tool.


Features

  • 🔑 Secrets detection — API keys, tokens, passwords, private keys
  • ☁️ Cloud detection — AWS account IDs, ARNs, GCP project IDs, Azure subscriptions
  • 🌐 Network detection — IP addresses, internal hostnames, internal URLs
  • ⌨️ Windows hotkey — press Ctrl+Alt+S to sanitize clipboard instantly
  • 🖥️ System tray — runs quietly in the background
  • 📋 CLI — pipe any text through it from the terminal
  • 📦 PyPI — install with a single pip install scrub-ai

Quick Start

Install

pip install scrub-ai

CLI Usage

# Pipe any text through it
cat error.log | scrub-ai

# Sanitize a file
scrub-ai --file crash.log

# See what would be detected without changing anything
scrub-ai --dry-run --file logs.txt

# Sanitize and copy result to clipboard
scrub-ai --file logs.txt --copy

Hotkey Usage (Windows only)

# Start scrub-ai in the background
scrub-ai --start

# Icon appears in system tray (bottom right)
# Copy any text with Ctrl+C as normal
# Press Ctrl+Alt+S to sanitize clipboard
# Paste clean text with Ctrl+V

Example

Input:

ERROR 2024-01-15 14:32:01 - Connection failed
  host: db01.prod.internal
  password: myS3cretP@ss123
  aws_access_key_id: AKIAIOSFODNN7EXAMPLE
  aws_account_id: 123456789012
  ip: 10.0.1.45

Output:

ERROR 2024-01-15 14:32:01 - Connection failed
  host: [INTERNAL_HOST]
  password: [REDACTED]
  aws_access_key_id: [AWS_ACCESS_KEY]
  aws_account_id: [AWS_ACCOUNT_ID]
  ip: [IP_ADDRESS]

Detection summary (stderr):

Detected 5 sensitive value(s): aws_access_key=1, aws_account_id=1, internal_host=1, ipv4=1, password=1

What Gets Detected

Category Examples
AWS credentials Access keys, secret keys, session tokens
AWS infrastructure Account IDs, ARNs, S3 URLs
GCP credentials Service account keys, project IDs
Azure credentials Subscription IDs, connection strings
Generic secrets API keys, bearer tokens, JWTs, private keys, hex tokens
Passwords password=, passwd=, pwd= key-value patterns
Network IPv4, IPv6, internal hostnames, internal URLs

Roadmap

  • Project setup
  • v1.0 — CLI + secrets + cloud + network detection + Windows hotkey + system tray
  • v1.1 — PII detection (emails, phones) via Presidio
  • v1.2 — Watch mode (automatic clipboard monitoring)
  • v2.0 — VS Code extension
  • v2.1 — Browser extension (warns before pasting into ChatGPT)
  • v3.0 — Team policies + audit log

Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

# Clone
git clone https://github.com/rajwindermarwaha/scrub-ai
cd scrub-ai

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

License

MIT — see LICENSE


Author

Built by @rajwindermarwaha

Built this because I had to put in the extra effort of copying everything into Notepad first and manually scrubbing it before sharing with AI tools. Figured others do the same.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrub_ai-1.0.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrub_ai-1.0.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file scrub_ai-1.0.0.tar.gz.

File metadata

  • Download URL: scrub_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scrub_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 063e0c458bd87d2ca84295c41974fdd713a445d7ddbe5f4e2e203152fb61e700
MD5 6d8b62c8cb802cb2688855a23273c838
BLAKE2b-256 f83f36288816a3b5884df924c16408e25ee56b2f439afebcaeaa359a469f49d6

See more details on using hashes here.

File details

Details for the file scrub_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: scrub_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scrub_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94d4b06788c0cdfcb701f7ed5945484784e24e2cf4441a0dfea45507d272e6cc
MD5 93a0eca7a53f53ba964b77a9322730ab
BLAKE2b-256 4920494d58db2abcd9b8a8ce314b0628d72a3b06c3d163ff625b70b727ae0781

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page