Redact: On-device PII Redaction for iOS, Android, and Web
On-device PII redaction that detects and masks personal data in text across all 24 official EU languages, without the text ever leaving the device.
Redact finds and masks personal data in text: names, addresses, emails, phone numbers, credit cards, IBANs, national IDs, VAT numbers, and more. Everything runs on device, so the raw text never touches a network or a server, yours or a third party's. Redact covers the same PII lane as Microsoft Presidio, AWS Comprehend, and Google Cloud DLP, but stays on device and is reversible for LLM round-trips.
The differentiator is reversible redaction for LLM round-trips. Mask the text before sending it to an external model, then restore the originals in the response. Keep the placeholder map and the result is pseudonymized; drop it and the masked copy is anonymized. Under the hood a small 6-layer token classifier handles contextual PII, and a deterministic layer validates structured fields with real checksums.
Demo
Performance
Catches 88.8% of personal data across all 24 EU languages, with checksum validation for cards, IBANs, VAT numbers, and national IDs, all from a single 23M-parameter model.
Internal evaluation on external WikiANN and MultiNERD plus a format-valid structured-PII set. About 23M parameters.
Use cases
Safe LLM round-trips
Mask PII before a prompt leaves for an external model, then restore the real values in the answer. Unique numbered placeholders like [GIVEN_NAME_1] and [EMAIL_1] make the round-trip lossless.
Scrub logs and support records
Strip names, emails, cards, and IBANs from support transcripts and application logs so raw personal data never reaches your servers.
GDPR-aligned de-identification
Pseudonymization and anonymization run locally, so the compliance-sensitive step happens before any data leaves the device.
Multilingual by default
One model covers all 24 EU languages across Latin, Greek, and Cyrillic scripts, instead of standing up a separate pipeline per language.
What it does
- 20 detection categories: names, addresses, emails, phone numbers, credit cards, IBANs, national IDs, VAT numbers, and more.
- Deterministic validation layer: Luhn card checks, ISO-13616 IBANs, checksummed national IDs for all 24 EU countries, all 27 EU VAT formats, IMEI, and per-country driving licences.
- Reversible redaction with unique numbered placeholders for LLM round-trips.
- Filter by category and inspect every detection with its exact character span.
Platforms and install
// Swift Package Manager
.package(url: "https://github.com/Desert-Ant-Labs/redact", from: "0.5.0")
import Redact
let redact = Redact()
let r = try await redact.redaction(of: text)
// r.redactedText: "Email [GIVEN_NAME_1] at [EMAIL_1]"
// build.gradle.kts (Maven Central)
implementation("ai.desertant:redact:0.5.0")
import ai.desertant.redact.Redact
val r = Redact.redaction(text)
// r.redactedText: "Email [GIVEN_NAME_1] at [EMAIL_1]"
npm i @desert-ant-labs/redact @litertjs/core
import { Redact } from "@desert-ant-labs/redact";
const redact = await Redact.load();
const r = await redact.redaction(text);
// r.redactedText: "Email [GIVEN_NAME_1] at [EMAIL_1]"
Add Redact from Desert Ant Labs to this project.
On-device PII redaction that detects and masks personal data in text across all 24 official EU languages, without the text ever leaving the device.
SDKs (use the one that matches this project's platform):
Swift (iOS, macOS)
Repo: https://github.com/Desert-Ant-Labs/redact
// Swift Package Manager
.package(url: "https://github.com/Desert-Ant-Labs/redact", from: "0.5.0")
Kotlin (Android)
Repo: https://github.com/Desert-Ant-Labs/redact
// build.gradle.kts (Maven Central)
implementation("ai.desertant:redact:0.5.0")
JavaScript / TypeScript (Web, Node.js)
Repo: https://github.com/Desert-Ant-Labs/redact
npm i @desert-ant-labs/redact @litertjs/core
Reference:
- Model page: https://desertant.com/models/redact/
- Full catalog and other models: https://desertant.com/llms.txt
Add the SDK that matches this project's platform, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
Specs
- Languages
- All 24 official EU languages (Latin, Greek, Cyrillic)
- On-device size
- 12-14 MB Core ML (Apple, 4-bit); ~24 MB LiteRT (Android, Web, int8)
- Model
- 6-layer BIOES token classifier, Multilingual-MiniLM lineage, ~23M params
- Privacy
- Runs fully on device; text never leaves the device
FAQ
What is Redact?
On-device PII redaction that detects and masks personal data in text across all 24 official EU languages, without the text ever leaving the device.
Does Redact run on device?
Yes. Redact runs entirely on device: inference happens locally with no server call, so data never leaves the device.
Which platforms does Redact support?
Redact ships as native on-device SDKs for Swift, Kotlin, JavaScript / TypeScript.
How much does Redact cost?
Every model is free up to 100k monthly active devices per SDK. Unlimited inference per user. Contact us for custom licenses.
How accurate or fast is Redact?
Catches 88.8% of personal data across all 24 EU languages, with checksum validation for cards, IBANs, VAT numbers, and national IDs, all from a single 23M-parameter model.