🧼 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
Metadata
Release files for paper-sanitizer 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| paper_sanitizer-1.0.0.tar.gz | 4.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paper_sanitizer-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / paper_sanitizer-1.0.0.tar.gz
| Download URL | paper_sanitizer-1.0.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2ec0ceee224e97a1670cedad88e7fd9f35d38cd3a0b247dbb08b6e1be93a3c
|
|
BLAKE2b-256 checksum How to use checksums |
6c440dedd9385abfe517d599d84d8c658f7c3814f93e0919a5e1d023e79dfd00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / paper_sanitizer-1.0.0-py3-none-any.whl
| Download URL | paper_sanitizer-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb3a6b8533a0adf57a45d207a9b04684fc64a30a56c745a5e36be145901adb5a
|
|
BLAKE2b-256 checksum How to use checksums |
12b62978dc388924ecddd4b260d40b0fea011d2fc044aae4bf8c13d3bfea8190
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for paper-sanitizer 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.