Skip to main content

An interactive terminal tool that scans your files for secrets with TruffleHog and helps you redact them.

Python 3.8+ License: MIT

Features

  • One-command scanning — runs TruffleHog for you, no piping required
  • Interactive TUI — curses-based selector to pick which secrets to redact
  • Diff preview — review a unified diff of all changes before applying
  • Safe by default — shows what will change and asks for confirmation
  • Zero dependencies — only uses the Python standard library
  • Custom placeholders — replace secrets with [REDACTED], asterisks, or any string

Installation

Note: Works on macOS and Linux. Windows is not currently supported (the interactive TUI depends on curses and Unix terminal features).

Requires TruffleHog to be installed and available on your PATH.

Install from PyPI:

pip install trufflehog-redactor

Or run directly without installing:

uvx trufflehog-redactor ./my-project

Or install via pipx:

pipx install trufflehog-redactor

Usage

Point trufflehog-redactor at the directory you want to scan:

trufflehog-redactor ./my-project

This will:

  1. Run TruffleHog to detect secrets in the target directory
  2. Open an interactive TUI to select which secrets to redact
  3. Show a diff preview of the proposed changes
  4. Apply the redactions after confirmation

Examples

Scan the current directory interactively:

trufflehog-redactor .

Redact all secrets without prompting:

trufflehog-redactor . --no-confirm

Preview changes without modifying files:

trufflehog-redactor . --dry-run

Use a custom placeholder:

trufflehog-redactor . --placeholder "[REDACTED]"

Pipe mode

You can also pipe TruffleHog JSON output directly if you need more control over TruffleHog flags:

trufflehog filesystem ./my-project --no-fail --no-update --json 2>/dev/null | trufflehog-redactor

This can be useful to run trufflehog via Docker, without installing it locally.

TUI Controls

Key Action
↑ / k Move up
↓ / j Move down
Space Toggle selection
a Toggle all
t Toggle by detector category
r Reveal / hide secrets
Enter Confirm selection
q Quit without redacting

Testing with example secrets

The test_keys repo from TruffleSecurity contains real-looking example secrets you can use to try out the tool end-to-end:

# Clone the test repo
git clone https://github.com/trufflesecurity/test_keys /tmp/test_keys

trufflehog-redactor /tmp/test_keys

Tip: Start with --dry-run to preview changes safely before applying any redactions.

License

MIT

Metadata

Release files for trufflehog-redactor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trufflehog-redactor 0.1.0
File Size Uploaded
trufflehog_redactor-0.1.0.tar.gz 24.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trufflehog-redactor 0.1.0
File Interpreter ABI Platform
trufflehog_redactor-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / trufflehog_redactor-0.1.0.tar.gz

Download URL trufflehog_redactor-0.1.0.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
816719b45adf5026dc542e813527c7bcab5ca497c003a24c97f8544a2e46d494
BLAKE2b-256 checksum
How to use checksums
86592bae3bb66903e76130202a16fa5766de9716052d21285371ba5eca53b076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

Release files / trufflehog_redactor-0.1.0-py3-none-any.whl

Download URL trufflehog_redactor-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d281c48f2cb9479e20e40cecf4cd756dc914db8141c24b9eb625eec28b652683
BLAKE2b-256 checksum
How to use checksums
df271997edaf3619abe1c65d5afd2d2afa97365319ff49a056bd8eb9420687ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page