API / deployment

A redaction CLI for repeatable local runs

A practical guide to redaction cli: the boundary, the controls and the failure modes that matter before the first document.

Redaction CLI: Deployment and Limits

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.

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:

The redaction flow

  1. Put the files in a dedicated input directory.
  2. Run with a policy file and an explicit output directory.
  3. Read the manifest and the exit code.
  4. Review the report for uncertain spans.
  5. 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

Questions

Is an CLI safer than an API?

It can keep files local, but it also spreads copies across disks and history. The boundary depends on the machine and the cleanup.

Can we schedule it?

Yes, with a wrapper that records the operator, the time and the exit code. Do not schedule an interactive review.

What about secrets?

Use the environment or a file descriptor. An argument is visible in the process list and often in history.