Disclosure control · Agents · Libraries · Self-hosted
Redacta replaces patient identifiers with labelled tokens, keeps the map that reverses them outside the model's context, and checks the text on the way out. Clinical meaning intact; the patient doesn't travel with it.
01The idea
There is no single correct amount of redaction. The same clinical letter needs different treatment depending on its destination — and that, not detection, is the hard part.
Care requires the patient's name and number. Inside a trusted setting, identifiers in the text aren't a leak — they're the point. Redaction here would only destroy the record.
Text leaving for analysis or publication crosses out of the care relationship. Now every date, every specific age and the long tail of HIPAA identifiers have to go.
An agent needs the clinical meaning to do its work and nothing else. It should hold tokens, never the key that reverses them — and be checked on the way out.
A detector that only reads the text can't make any of these calls — it sees identifiers and removes them, everywhere, always. Redacta treats redaction as a decision about a boundary rather than a property of a document, which is why the sections below are about enforcement and verification as much as detection.
02The boundary
Redacting text is only half the job in an agent workflow — the token map that reverses it is the key to the whole record. The Redacta MCP server keeps that map inside the server process, so the agent you're protecting the data from can never see it.
protect redacts the text and returns the safe version plus an opaque session ID. The reversal map stays in server memory — never in the tool result, never in the model's context. The agent then summarises, drafts or analyses on tokens alone.
check_output reads what the model produced and looks for identifiers that found their way back in verbatim, re-tokenising them without ever echoing the raw values. Most tools guard the way in. This is the one that asks whether the boundary actually held.
release_to_file writes the re-identified result to a folder you configured. The agent receives a receipt, not the identifiers. Sessions expire automatically.
Proven, not promised
The test suite runs a real MCP client against the server and asserts the invariant directly: no original identifier and no token map ever appears in a protect or release response. Those acceptance tests gate every release, alongside engine and Python-mirror tests in repo-wide CI. Read the design →
The clinical meaning stays. The patient behind it doesn't travel with the text.
03Detection
Patterns catch the structured identifiers. Reasoning catches the ones that don't follow a pattern — the names, addresses and ages that regex alone reliably misses.
Fixed-format identifiers are matched exactly, every time — including a Modulus 11 checksum to confirm real NHS numbers.
For everything a pattern can't pin down, Redacta reads context — and tells a patient apart from the clinician treating them.
Identifiers become labelled tokens
04Careful by design
Redaction is full of decisions a blunt tool gets wrong. Redacta makes the ones that matter — protecting the person behind the text without gutting the clinical record.
A patient's date of birth is removed; the date of their next appointment stays. Stripping every date would erase the timeline a clinician actually needs — unless you ask for Safe Harbor mode, which removes them all.
Redacta protects the person being treated — it redacts the patient and keeps the GP, consultant and hospital named in the letter, so the text still reads sensibly. Need a fuller scrub? It can remove those too.
Faced with something that might identify a patient, Redacta errs toward removing it — and lists every change in a report, so nothing happens silently.
Benchmark · vs Microsoft Presidio
100% recall, zero false positives across 300 synthetic clinical notes — and stable over 10 random seeds.
On the same text, a general-purpose detector over-redacts 1,643 times — every clinician name and appointment date.
False positives · lower is better
The engine is also regression-gated by OpenGATE, our open-source evaluation framework — whose first run surfaced two name-capture bugs that this benchmark's cases didn't cover. Both were fixed and verified the same day, and shipped in v1.2.1 across every surface. That's the point of continuous evaluation: finding the failure before a patient's name does.
05Safe Harbor mode
The second destination from section 01, in concrete terms. Ask for HIPAA Safe Harbor — or "US de-identification" — and Redacta switches to its strictest pass, aligned with the §164.514 Safe Harbor method.
On top of everything above, it removes every date tied to the individual — not just the date of birth, but appointment, admission and discharge dates too — along with all specific ages, and the remaining HIPAA identifiers a clinical letter rarely shows but sometimes does: fax and certificate/licence numbers, device serial numbers, vehicle VINs, and health-plan beneficiary numbers. It errs on the safe side, removing a little more than the letter of the standard requires.
Added in Safe Harbor mode
06Who it's for
The same engine serves a developer wiring up an agent and a clinician with a letter to summarise. Only the surface changes.
Put an enforced boundary around any agent that touches clinical text — identifiers and their reversal map stay out of the model's context end to end, and outbound text is checked before it lands.
Work with real case text in AI tools while keeping identifiers out of the prompt — or run a Safe Harbor pass over material bound for analysis or publication.
Summarise or rewrite a letter with AI without exposing the patient behind it. On iPhone it runs entirely on-device.
07Get started
Redacta is free and open source under the MIT-0 license. Eight surfaces, one detection engine: an iPhone app, an agent skill, an MCP server, Python and TypeScript libraries, a CLI, a self-hosted Kubernetes service, and a FigJam plugin.
Add Redacta from ClawHub with a single command.
A letter, note, discharge summary or report — paste it in.
A pseudonymised document plus a report of every identifier replaced.
Redact on-device, straight from the share sheet — nothing leaves your phone.
Deterministic patterns plus agent reasoning, inside Claude Code and other agents.
$openclaw skills install redacta
v2 adds protect / release — the reversal map never enters the agent's context. One-click install from Anthropic's MCP Directory, or via npx. Read the docs →
$npx -y redacta-mcp
The same engine and PrivacyGateway loop, mirrored for Python — standard library only.
$pip install redacta
The dependency-free engine every surface ships, with PrivacyGateway — protect / release in-process, expiring sessions, output guard. Read GATEWAY.md →
$npm install @pharmatools/redacta
An HTTP service that runs inside your own cluster — plain YAML, two deployment profiles, health probes, no-PHI logging. Deployment guide →
$kubectl apply -f gateway-service/k8s/
Redact a file or a pipe from the terminal — useful in scripts, batch jobs and CI, with no install step.
$npx redacta-cli
Redact sticky notes and text right on the board, before a screenshot travels.
An honest note on limits. Redacta is a strong first line of defence, not a guarantee. It won't catch every possible identifier and isn't a substitute for formal data-protection processes. Always review the redaction report before sharing text.
08For teams in production
Everything above is free and stays free. If you're shipping AI agents on clinical or patient data and want the boundary in your own environment with hands-on integration support, Redacta offers a small number of fixed-price design-partner integrations.
We map your sensitive-data → AI flow, deploy Redacta inside your environment, integrate one real agent or LLM workflow, and test the privacy boundary against representative or synthetic examples — your text never needs to reach us.
A short architecture and data-flow document written for your DPO — deployment model, session lifecycle, what is and isn't logged — ready to drop into a DPIA or security review, plus a clear picture of what production would need.
Scoped to one workflow and a capped number of working sessions, with a decision date agreed up front. If you continue to an annual production subscription — supported builds, updates, and the enterprise features your deployment needs — the integration fee is credited against year one.
Three design-partner places, for teams building AI features on clinical or patient data in the UK or EU. Email to book a 20-minute architecture fit call →
Sending this to your DPO first? Read the one-page security & data-protection summary →
The whole gateway runs as a self-hosted HTTP service with a plain-YAML Kubernetes deployment — so the point where identifiable text becomes tokens sits inside your cluster, not someone else's. Everything on this page is MIT-0 and free to use; the code, the design notes and the acceptance tests are all in the open.
View the source