r/Python • • 23m ago

Resource whiff-python 0.2.0: whiff 1.1.0 in Python, with an opt-in prompt-injection check

0.2.0 wraps the Rust whiff crate at 1.1.0. import whiff still returns one whiff/1 dict for a path or for bytes: format, hashes, rights, risk signals, and a compact content view.

New in this release:

  • investigate=True runs the crate's prompt-injection check and adds an investigation section (status, coverage, findings). Leave it off and the section is absent. llm() does not include it. A no_findings status still has to be read with coverage.
  • Secret redaction is its own switch. redaction="on" is the default. privacy="off" keeps personal data and still redacts secrets. redaction="off" leaves secrets in the text; they are still counted.
import whiff

report = whiff.extract("invoice.pdf", investigate=True)
report["investigation"]["status"]

pip install whiff-python==0.2.0. Python 3.11+, wheels for Linux, macOS, and Windows. Published wheels are the common collection.

https://github.com/SinAnima/whiff-python

0 Upvotes

0 comments sorted by