
A redaction CLI for repeatable local runs. The command line is for repeatable local work: a folder of files, a policy, an output directory and a log. It is fast and scriptable, but the shell also leaves traces in history, arguments and temporary files.
Part of redaction API and SDKs. For the adjacent case, read redaction api and redaction sdk.
What changes in this environment
A command that takes an input path, an output path and a policy file, writes a manifest and returns a distinct exit code for success, partial success and failure. Secrets come from the environment or a file descriptor, never from an argument that lands in history.
Where the data hides
The visible page is only one layer. In this environment, check:
- Shell history and process arguments
- Temporary files and crash dumps
- Output file names that repeat the original
- Logs that include extracted text
- The policy file itself, if it contains sample values
The redaction flow
- Put the files in a dedicated input directory.
- Run with a policy file and an explicit output directory.
- Read the manifest and the exit code.
- Review the report for uncertain spans.
- Delete the temp directory and the shell history entry.
Controls to verify
- A non-zero exit code for partial failure.
- A manifest with input hash, output hash and report path.
- No secrets in arguments or logs.
- A clean temp directory per run.
- A wrapper that records the operator and the time.
Retention and evidence
A local run can leave copies in the input directory, the output directory, the temp folder and the backup. A retention policy that only covers the application database is incomplete. Write down what the script deletes and test it.
Limits
There is no interactive review in a bare CLI; pair it with a report and a reviewer. OCR, language coverage and large files are the same limits as the API. A local run is not automatically more private if the machine is shared.
The contract of a scriptable tool
A CLI earns its place in pipelines through boring properties: stable exit codes, machine-readable output options, and flags that fail loudly on unknown input. The exit code is the interface — zero, clean; a documented non-zero per failure class; and nothing that depends on parsing stderr. Output goes to stdout or a named path; logs go to stderr, so redirection does what operators expect. Manifest in, manifest out: the CLI should read the job list and write the job results in formats a script can diff.
Where CLIs earn their keep
Three homes: the scheduled folder job that processes overnight drops, the CI pipeline that sanitises fixtures before they enter the test data set, and the incident response kit where a GUI is one dependency too many. In each, the CLI's virtue is the same — it composes with the surrounding tools and its behavior is reviewable in a script. Keep the wrapper scripts in version control next to the policy files they invoke; the pair is the reproducible job.
Exit codes, concretely
Document the exit codes next to the script: zero for success, one for a processing failure with the file listed, two for a usage or configuration error that should page the pipeline owner, three for an environment problem — missing policy, unreachable storage. Operators debug at 2 a.m. from the code alone. A CLI whose failures all exit one teaches its users to guess, and guessing at 2 a.m. is how masked folders ship half-empty.
How Veilbrook fits
Veilbrook can be driven from a command line for local or scheduled jobs, with a policy and a report. The wrapper, the manifest and the cleanup are yours to own.
Before you release
Open the output in the same tool the recipient will use. Select each masked area and paste it into a text editor. Search for every value you removed, including the header, the attachment, the comment and the OCR layer. Compare the report with the file and keep both. If a value survives, the job is not done.
What to ask before you build
- What are the exit codes?
- Can the policy be a file rather than a flag?
- Where does the tool write temp files?
- Does it log extracted text?
- Can it run without network access?