Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Local redaction

The CLI reads ~/.halfspan/redaction.json before opening an upload destination. When enabled, its policy applies to span share, terminal sharing, installed agent and Git hooks, span import, and span hook ingest.
With no policy file, the existing content-selection defaults apply. Redaction does not turn on prompts, replies, or summaries. A configured policy that cannot load or complete blocks the affected batch. Earlier batches may already have receipts; replay from the first unconfirmed batch.
Model filtering can miss PII. The pinned model misses a synthetic name beside an email in the replay suite. Use the omission policy below for content that must stay on the machine.

Prepare Rampart

From the Halfspan checkout, install the pinned JavaScript dependencies and download the pinned model into an empty directory:
just install-deps just redaction-model "$HOME/.halfspan/models/rampart"
Preparation downloads a fixed Hugging Face revision and verifies each file's size and SHA-256 digest. The runtime verifies those files again, uses CPU inference, and disables remote model loading and fetch. The model files occupy about 15 MB; the JavaScript inference dependencies require substantially more disk space. The native span executable does not bundle them.
Create ~/.halfspan/redaction.json, substituting the absolute paths to Bun, your checkout, and the prepared model:
{ "version": 1, "command": [ "/absolute/path/to/bun", "/absolute/path/to/halfspan/packages/redaction/src/cli.ts", "--model", "/absolute/path/to/.halfspan/models/rampart" ], "omit": [], "timeout_ms": 30000 }
Use command -v bun to locate Bun. Keep these paths available to background agent hooks. The command runs directly with the supplied arguments, without a shell. One local worker loads the model for an upload operation and handles its batches sequentially. The worker's diagnostics are withheld from CLI errors because they could contain input text.
Command workers are supported on macOS and Linux. Windows supports omission-only policies. Configure a trusted local executable: it receives the selected text. Workers must keep children in their process group; detached descendants are outside the CLI's termination guarantee. This mechanism does not sandbox the configured executable.
To use a policy at another absolute path, set HALFSPAN_REDACTION_CONFIG. An explicitly selected missing file, invalid policy, failed worker, timeout, malformed response, or invalid sanitized batch blocks upload. To make a missing policy an error in automation, always set this variable.

Choose what may leave the machine

The filter processes session and swarm titles, selected prompt and reply text, summaries, message and log bodies, and artifact previews. It applies credential patterns before model inference. Detected sensitive values in identity metadata block the upload rather than changing event references. Code-attribution records are omitted whenever redaction is enabled because they can contain nested paths and arbitrary metadata. An application log with code privacy_omitted_code_attribution and capture omitted retains their event identifiers and records the omitted evidence.
Use omit to withhold whole content categories. Supported categories are title, text, body, preview, and code_attribution. Omitting text substitutes [omitted] while preserving the event. Omitting bodies removes them and marks capture as omitted. Omission happens before the worker receives the batch's text.
For a policy that withholds all supported content and does not start a worker:
{ "version": 1, "command": [], "omit": ["title", "text", "body", "preview", "code_attribution"] }
Metadata, including identifiers, tool names, model names, timestamps, and event relationships, still leaves the machine. Use non-sensitive identifiers. PII detection can miss private values, and confidential code or business information may contain no PII. Omit content that must never be exported.
This policy covers the CLI's event uploads. Direct SDK calls, OTLP exporters, artifact-content uploads, native harness telemetry, and requests to model providers need their own producer-side policy. It does not rewrite native transcripts or remove already uploaded traces.

Verify locally

just redaction-replay "$HOME/.halfspan/models/rampart" just cli-redaction --model "$HOME/.halfspan/models/rampart"
The replay uses synthetic values and captures HTTP payloads on a loopback receiver. It checks redaction, omission, persistent worker reuse, stable retry payloads, and blocking on worker failures. Add --baseline /absolute/path/to/prior/span to cli-redaction to compare upload latency with a prior CLI binary.

Use another local detector

The worker receives one JSON object per line on stdin and must write one response per line on stdout:
{"version":1,"texts":["Text to filter", "Another field"]}
Return the same version and number of strings in the same order. The CLI owns the event envelope; the worker cannot change event IDs or structure. Requests and responses are bounded to 1 MiB. Keep stdout exclusively for this protocol. timeout_ms is the per-request deadline, including model initialization for the first request; its default is 30,000 and maximum is 60,000.
The bundled adapter resets its placeholder table for each field. An unchanged field produces the same output when a batch grows or other content is selected. Numbered placeholders identify values within that field; they do not establish identity across separate fields. Pin the detector, model, and policy throughout an upload and its retries. Placeholder mappings never enter the protocol.
Rampart combines deterministic recognition with a classifier. The adapter uses an empty keep-set, so detected city, state, and ZIP entities are redacted too. Its documented limitations include missed entities and limited coverage for non-Latin names. See the model card.
Rampart model weights and runtime are by National Design Studio and licensed under CC BY 4.0. The pinned artifact manifest and license are retained with the local model. See the upstream project.