Metadata-Version: 2.4
Name: prompt-scrub-pad
Version: 0.1.0
Summary: Local CLI and desktop pad for redacting sensitive text before sharing prompts.
Author: Haider Sattar
License-Expression: MIT
Project-URL: Homepage, https://github.com/iwaheedsattar/prompt-scrub-pad
Project-URL: Repository, https://github.com/iwaheedsattar/prompt-scrub-pad
Project-URL: Issues, https://github.com/iwaheedsattar/prompt-scrub-pad/issues
Keywords: ai,prompt,redaction,privacy,cli,tkinter
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Classifier: Topic :: Text Processing :: Filters
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Prompt Scrub Pad

Prompt Scrub Pad is a local CLI and small desktop pad for redacting sensitive text before pasting prompts, tickets, logs, or snippets into AI tools.

It is intentionally offline-first. Text stays on your machine, and the default rule set catches common accidental disclosures: API keys, environment variable secrets, AWS access keys, private keys, email addresses, IP addresses, phone numbers, and credit-card-like numbers.

## Install

```bash
python3 -m pip install prompt-scrub-pad
```

For local development:

```bash
python3 -m pip install -e .
```

## CLI Usage

Scrub a file:

```bash
prompt-scrub-pad examples/support-ticket.txt
```

Read from stdin:

```bash
pbpaste | prompt-scrub-pad | pbcopy
```

Show a diff:

```bash
prompt-scrub-pad examples/support-ticket.txt --diff
```

Emit JSON for a preflight check:

```bash
prompt-scrub-pad prompt.txt --json --fail-on-change
```

Useful switches:

```bash
prompt-scrub-pad prompt.txt --redact-urls
prompt-scrub-pad prompt.txt --keep-emails
prompt-scrub-pad prompt.txt --keep-ips
prompt-scrub-pad prompt.txt --output scrubbed.txt
```

## Desktop Pad

Launch the Tkinter pad:

```bash
prompt-scrub-gui
```

or:

```bash
prompt-scrub-pad --gui
```

Paste text into the top area, choose which rules are active, scrub, and copy the cleaned result from the bottom area.

## Python API

```python
from prompt_scrub_pad import ScrubProfile, scrub_text

result = scrub_text(
    "Send to jane@example.com with OPENAI_API_KEY=sk-abc123456789012345678901234",
    ScrubProfile(redact_urls=True),
)

print(result.text)
print(result.findings)
```

## Configuration

Prompt Scrub Pad currently uses command flags and the `ScrubProfile` Python object for configuration. The defaults favor prompt-sharing safety while leaving URLs visible unless `--redact-urls` is set.

## Development

```bash
python3 -m pip install -e .
python3 -m pytest
python3 -m build --no-isolation
python3 -m twine check dist/*
```

## Contributing

Issues and pull requests are welcome. Keep rules explainable, deterministic, and local. New detectors should include tests covering both redaction and an opt-out path where appropriate.

