Veil
a compact model for masking personal data in text
2 min readupdated
Veil is an ultra-lightweight model (just 1.2 MB) built to detect and mask personal information in text, including names, addresses, phone numbers, and email addresses. It runs entirely locally in the browser or Node.js without external servers or network requests. Under the hood, it uses a two-layer bidirectional LSTM (a recurrent neural network for processing sequences) with int8-quantized weights and hashed character n-grams (word fragments). It is a practical fit for developers who need to protect user privacy before saving logs or sending text to external APIs.
Key features
- Tiny footprint: the model file is only about 1.2 MB and runs without heavy dependencies.
- Client-side execution: text never leaves the user's device, keeping data completely private.
- Broad entity coverage: detects names, addresses, birth dates, IDs, financial data, phone numbers, and email addresses.
- Drop-in integrations: comes with official packages for TypeScript, Node.js, Vite, and React.
What you can do
- Embed it into a web app to automatically redact personal data in chats before sending messages to a server.
- Scrub sensitive information from local logs and text databases.
- Use the included React hooks for instant redaction previews inside text editors.
- Deploy it in serverless functions for fast pre-filtering of incoming text.
Example
import { createVeil } from "@tars-technologies/veil"
import { loadModel } from "@tars-technologies/veil/model"
const veil = createVeil({ model: loadModel() })
await veil.mask({
text: "I'm Laura Bianchi, call me on +33 6 39 98 12 34",
types: ["PERSON", "PHONE"]
})
// "I'm [NAME], call me on [PHONE]"Read more
DetailsArchitecture: bidirectional LSTM (96 units) with character n-grams
Supported languages: Latin script (English, German, French, Spanish, and others)
License: Apache-2.0
Limitations: supports Latin script only; may miss uncommon names or trigger false positives on brand names










Comments