Skip to main content

chatsee-redact

Redact PII in your own JSON / JSONL / CSV log files locally — fully offline.

Nothing ever leaves your machine, and the tool never contacts ChatSee (or any network host) at runtime. The redaction rules ship inside the package as a frozen snapshot, the redaction engine is vendored, and there are no runtime dependencies — not even the ChatSee SDK. Input is read from, and output written to, local files only. No telemetry, no uploads, no network calls. Air-gap safe.

The masking engine is a byte-for-byte copy of the ChatSee pipeline's engine, so the redaction you get here is identical to what the pipeline would apply.

Install

pip install chatsee-redact

Zero dependencies. Works with no internet access after install (and the install itself pulls nothing beyond the package).

Usage

# Redact one file; writes ./redacted/app.json
chatsee-redact app.json --out ./redacted/

# Default output is alongside the input: app.redacted.json
chatsee-redact app.json

# Multiple files into one folder
chatsee-redact logs/*.jsonl --out ./redacted/

Input → output:

app.json          -->  ./redacted/app.json      (all string values masked)

What gets redacted

By default every string value in the document is scanned and masked (recursively, through nested objects and arrays). Non-string values (numbers, booleans, null) are left untouched.

To restrict redaction to specific top-level keys (or CSV columns):

chatsee-redact app.json --fields user_message,bot_message,email

Formats

Input Handling
.json Whole-document: JSON array, object, or scalar.
.jsonl / .ndjson JSON Lines — streamed one record per line (safe for large logs).
.csv Per-row, streamed; header preserved. --fields selects columns.
other extension Treated as JSONL. Override with --format.

Force a format with --format {auto,json,jsonl,csv}.

Inspecting the rules (dump-rules)

Print the bundled classifier documents (the exact regexes that will run) so you can audit them before trusting the tool — offline:

chatsee-redact dump-rules              # prints the bundled rules JSON to stdout
chatsee-redact dump-rules -o rules.json

The rules

The classifier rules (credit card, Aadhaar, PAN, US Social Security number, IP address, phone, email — with Luhn / Verhoeff / phone / IP validators) are frozen into the package. They update only when a new version of this package is released — there is no runtime fetch.

They come from two bundled files:

  • chatsee_redact/data/classifiers.json — the ChatSee pipeline snapshot.
  • chatsee_redact/data/overlay_classifiers.json — rules this tool adds on top: US SSN (123-45-6789, 123 45 6789), IPv4/IPv6 addresses, and a phone rule that masks every digit and also accepts dotted numbers (555.123.4567). An overlay rule replaces the snapshot rule of the same type.

To run with your own/alternate rule set (still fully offline), pass a local classifiers JSON file:

chatsee-redact app.json --rules my_rules.json --out ./redacted/
chatsee-redact dump-rules --rules my_rules.json

(Maintainers: refresh the bundled snapshot with python tools/regenerate_rules.py --env qa, then bump the version and publish with powershell -ExecutionPolicy Bypass -File tools\publish.ps1 (add -TestPyPI for a dry run). The overlay file is not touched by a refresh. tools/ is the only code that ever contacts ChatSee and is not shipped in the package.)

Options

Flag Default Description
-o, --out DIR alongside input Output directory (created if missing).
--out-file PATH — Explicit output path (single input only).
--rules PATH bundled Use a local classifiers JSON instead of the bundled snapshot (offline).
--fields A,B,C all strings Restrict redaction to these top-level keys / CSV columns.
--format auto auto | json | jsonl | csv.
--indent N 2 JSON output indent (-1 = compact).
-q, --quiet off Only log warnings/errors.

Behaviour

The original file is never modified and is never overwritten. If no rules can be loaded (e.g. a corrupt --rules file), the tool refuses to write an unredacted copy and exits non-zero, rather than silently passing data through.

Exit codes

Code Meaning
0 Success.
1 One or more files failed to redact (I/O or parse error).
2 Bad invocation (missing input, refused source overwrite, --out-file with multiple inputs).
3 No redaction rules available (bundled snapshot missing/corrupt, or empty --rules).

Metadata

Release files for chatsee-redact 0.4.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 chatsee-redact 0.4.0
File Size Uploaded Provenance Actions
chatsee_redact-0.4.0.tar.gz 17.2 kB Without provenance Details for chatsee_redact-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chatsee-redact 0.4.0
File Interpreter ABI Platform Actions
chatsee_redact-0.4.0-py3-none-any.whl Python 3 none any Details for chatsee_redact-0.4.0-py3-none-any.whl

Total release size: 33.0 kB

Release files / chatsee_redact-0.4.0.tar.gz

Download URL chatsee_redact-0.4.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
daa67ca499d614bc6aa85b7460c51d02b2a7bcdccf4aed9430d4171a61893080
BLAKE2b-256 checksum
How to use checksums
7ce2172531844bc0db421debef2864d230ec621875bce80e7ced3b67903b5367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / chatsee_redact-0.4.0-py3-none-any.whl

Download URL chatsee_redact-0.4.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e7289123a25081970e8bafe0eebb9959f0a6a05f85a5b92ec13e0e392b5b1ef
BLAKE2b-256 checksum
How to use checksums
46287c9de44dbe516d5a8a1c95e49d180b73c8d4b689eb4e40536839d3e7f728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for chatsee-redact 0.4.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.

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