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). Numbers are checked too: a
phone number stored as a JSON number such as 5551234567 is masked and written
back as the string "XXXXXXXXXX"; numbers that match no rule keep their type.
Booleans and 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 sametype.
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.1
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 | Actions |
|---|---|---|---|---|
| chatsee_redact-0.4.1.tar.gz | 17.7 kB | Without provenance | Details for chatsee_redact-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chatsee_redact-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for chatsee_redact-0.4.1-py3-none-any.whl |
Total release size: 33.8 kB
Release files / chatsee_redact-0.4.1.tar.gz
| Download URL | chatsee_redact-0.4.1.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7f74cd60bbb832623dcf141249ad12cb240e56dcbc8afc10d33f51b562a2c7f
|
|
BLAKE2b-256 checksum How to use checksums |
fc5e669fa5653c8a718cb2b9a6717ca8004162c435d07cbd63eaa6e0b5fa849a
|
| 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.1-py3-none-any.whl
| Download URL | chatsee_redact-0.4.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
075231832915653fbb60245334796ab451cefb51a70dbd3eba31dc5e271ddf40
|
|
BLAKE2b-256 checksum How to use checksums |
467ead3faa7c5c18a7c727633218bd63267156c36d18552745323b55f5b91a19
|
| 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.1
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.