Skip to main content

Local-first secret scanner that redacts sensitive values before AI handoff.

Project description

BlackTent

An AI-safe firewall for your codebase. Detects secrets, redacts them deterministically, and produces a sanitized bundle you can hand to any AI tool without fear.

blacktent scan-file path/to/file.txt

Install

pip install blacktent

Requires Python 3.9+.


Usage

Scan a single file

blacktent scan-file path/to/file.txt
blacktent scan-file path/to/file.txt --out redacted.txt

Scan a directory

blacktent scan-dir .
blacktent scan-dir ./src --out-dir ./safe

Bundle for AI handoff

blacktent bundle .
blacktent bundle . --bundle-root ./ai-bundle

Creates a folder with redacted copies of every file that had findings, plus a manifest.json describing every redaction.

Patch (reapply redactions from manifest)

blacktent patch original.txt --out patched.txt

Replays the redactions from .blacktent/manifest.json onto the original file using SHA-256 validation. Safe and deterministic — no re-scanning.

Env diagnostics

blacktent env-check .

Reports which .env* files exist, which keys from .env.example are present or missing in the environment. Outputs safe JSON to .blacktent/env_report.json.


What it detects

Rule Pattern
OPENAI_KEY sk- followed by 20+ alphanumeric characters
GITHUB_TOKEN ghp_ followed by 20+ alphanumeric characters
GENERIC_API_KEY api_key = or token = assignments with 16+ char values
PASSWORD password = assignments with quoted values

Redacted values use stable placeholders that encode the rule and an 8-character hash:

[REDACTED:OPENAI_KEY:88c422f1]

Output structure

Reports are written to .blacktent/ in your working directory:

.blacktent/
├── manifest.json      # all findings: file, span offsets, SHA-256, replacement
└── env_report.json    # env-check output

Bundles are written to blacktent.bundle/ (or --bundle-root):

blacktent.bundle/
├── files/             # redacted copies of files with findings
├── manifest.json      # same manifest, copied into bundle
└── README_AI.txt      # handoff note for the AI

What BlackTent will NOT do

  • Read actual secret values
  • Upload anything
  • Modify your source files
  • Guess env values
  • Phone home

BlackTent is local, explicit, and reversible.


Status

MVP — stable core pipeline.

Planned next:

  • blacktent doctor (full repo health check)
  • .blacktentignore support
  • CI-friendly exit codes and JSON output mode
  • Pre-AI hooks

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blacktent-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blacktent-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file blacktent-0.1.0.tar.gz.

File metadata

  • Download URL: blacktent-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for blacktent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b6ec8a32dd02aca3b14801e32ba868e8acc63ce649a27f35e50039b9759a2abe
MD5 7c722ba80d2bb91684a924cdf2760100
BLAKE2b-256 58bedf8a1ea09df91f79d461a90a2770a420695048898e60ac6b45fb32448485

See more details on using hashes here.

File details

Details for the file blacktent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: blacktent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for blacktent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81c7172e5929797d8f19e07d819a32abc8b8816a9bc0a67abd3274c815f39449
MD5 f8ca6a3f42edfe6a239a8ac291bf834d
BLAKE2b-256 7d268361534d030ce0dc2c2e512d2805f92c4975a1593524b730c6f38f3bed49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page