Open source · AI & LLM

Model Response Redactor

Remove secrets and personal data from model inputs and outputs in saved traces.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

An offline, dependency-free reporter that applies an explicit local policy to a saved JSON model trace. It produces a structurally preserved, redacted copy and non-sensitive counts. It never sends the trace to a model, service, or database, and never edits the original.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+.

Run the checked-in example

node bin/model-response-redactor.mjs --trace examples/clean-trace.json --policy examples/policy.json
node bin/model-response-redactor.mjs --trace examples/trace.json --policy examples/policy.json
npm run check

Read the result

The first command exits 0; the second exits 1 because it found and replaced a synthetic token and address in nested tool output. Both emit one JSON report with redactedTrace, summary, counts, and findings. To save a redacted copy, provide --root DIR --out NEWFILE with both trace and policy inside that root. The output must not exist. The root confines reads and writes after resolving symlinks; a symlink at the output, a parent symlink escaping the root, an existing file and a hard link to either input are refused. No source is overwritten.

Scope

No live interception, account action, irreversible deletion, broad personal-data discovery, arbitrary regex execution, or certification that undetected secrets are safe. Review the policy and downstream handling of the redacted copy before sharing it.