Metadata-Version: 2.4
Name: pasteval
Version: 0.0.1
Summary: Redact sensitive information from text before you paste it into AI tools.
License-Expression: MIT
Project-URL: Homepage, https://pasteval.com
Keywords: redaction,privacy,secrets,cli,sanitize
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Text Processing :: Filters
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# Pasteval

Pasteval is a small command-line tool that redacts sensitive information from
text before you paste it into an AI tool or any other external service.

It runs entirely on your computer. No account, no API key, no network access,
and no dependencies beyond Python itself.

## Why use it

When you paste a log, an email, or a config snippet into a chatbot, it is easy
to include something you did not mean to share. Pasteval replaces what it
recognizes with a placeholder, so the text stays useful and the value stays
private.

## Install

Pasteval needs Python 3.11 or newer. Install it from source:

```bash
git clone <this repository>
cd pasteval
pip install -e .
```

## Usage

Paste text interactively, then press Ctrl+D on a new line to finish
(Ctrl+Z then Enter on Windows):

```bash
pasteval
```

Pipe text in:

```bash
cat notes.txt | pasteval
```

Read a file:

```bash
pasteval --file notes.txt
```

Other options:

```bash
pasteval --help
pasteval --version
```

The redacted text is written to standard output. A short summary (types and
counts only, never the values) is written to standard error, so you can pipe
the output safely, for example `pasteval --file notes.txt | pbcopy` on macOS.

## Example

Input:

```text
Hi, I'm Alex.
My email is alex@example.com.
Please copy sam@example.com, and reply to alex@example.com.
```

Output:

```text
Hi, I'm Alex.
My email is [EMAIL_1].
Please copy [EMAIL_2], and reply to [EMAIL_1].
```

The same value always gets the same placeholder, so the text still makes sense.

## What is redacted

| Type | Placeholder |
|---|---|
| Email addresses | `[EMAIL_1]`, `[EMAIL_2]`, ... |

## Security limitations

Pasteval reduces the risk of accidental sharing. It does not guarantee it.

- It can miss things (false negatives). Anything not listed above is left as
  it is, including names, postal addresses, passwords, and API keys.
- Email addresses containing non-English characters are not detected.
- It can occasionally redact something harmless (false positives).
- Text you paste into a terminal may remain in the terminal's scrollback.
- Always read the output before you share it.

Pasteval never sends your text anywhere, never saves it, and never prints the
original values in its messages. If something goes wrong it prints an error
and no text at all.

## Development

```bash
pip install -e ".[dev]"
pytest
```

Detection rules live in `src/pasteval/rules.py`. To add one, add a `Rule` to
the `RULES` list and write tests for it.

## License

MIT. See [LICENSE](LICENSE).
