CLI that strips prompt-injection triggers from academic papers
Project description
🧼 Paper-Sanitizer
Strip prompt-injection tricks from academic papers before they hit your LLM pipeline.
Researchers keep showing how easy it is to hide
Ignore all previous instructions
inside a PDF or LaTeX file and fool automated summarizers. Paper-Sanitizer is a tiny command-line tool that removes those hidden instructions, flags stealthy white-on-white text, and rates the overall risk. Use it as a pre-flight check in RAG systems, peer-review helpers, or your own reading workflow.
Key features
| Stage | What it does |
|---|---|
| Stage 1 | Regex firewall – removes obvious prompt-injection phrases |
| Stage 2 | Detects invisible text (white or ≤ 1 pt) and suspicious PDF metadata |
| Stage 3 | Emits detailed event log, word-level diff (--diff), and a risk class (low / medium / high) |
Supported inputs: PDF, .tex, .txt (more coming).
Quick start
1 · Install
# Requires Python ≥ 3.9
pipx install git+https://github.com/mctar/paper-sanitizer.git
# – or –
pip install git+https://github.com/mctar/paper-sanitizer.git
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paper_sanitizer-1.0.0.tar.gz.
File metadata
- Download URL: paper_sanitizer-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2ec0ceee224e97a1670cedad88e7fd9f35d38cd3a0b247dbb08b6e1be93a3c
|
|
| MD5 |
237a249c85a77db4575104e99a3ad181
|
|
| BLAKE2b-256 |
6c440dedd9385abfe517d599d84d8c658f7c3814f93e0919a5e1d023e79dfd00
|
File details
Details for the file paper_sanitizer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: paper_sanitizer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb3a6b8533a0adf57a45d207a9b04684fc64a30a56c745a5e36be145901adb5a
|
|
| MD5 |
7268a9d8695cd99bdefd7a47b5ddc868
|
|
| BLAKE2b-256 |
12b62978dc388924ecddd4b260d40b0fea011d2fc044aae4bf8c13d3bfea8190
|