Skip to content

Technical overview

PII redaction technical overview

How Maskflare detects personal data and secrets in AI traffic, what it can do with each match, how a request is processed, how it integrates, and where its limits are.

Reviewed 7 October 2026 · Maskflare product team

Evaluation boundary
  1. 01

    Identify sensitive values

  2. 02

    Replace with stable tokens

  3. 03

    Restore only inside your boundary

Coverage

What Maskflare detects

Data typeHow it's detectedCoverage
Email addressesValidated address formatBuilt in
Phone numbersNational formats with country contextBuilt in, 47 country packs
Payment cardsCard-number format with Luhn checksumBuilt in
IBANs and bank accountsIBAN mod-97 checksum and national account formatsBuilt in, 47 country packs
National, tax, and social security IDsCountry formats with official check digits47 country packs
Postal addressesStreet-address grammars in 29 languagesBuilt in
Person namesName lists and context evidence, plus a local named-entity layer for names in free textPerson names pack and named-entity layer
Dates of birthDate formats in 23 languages, next to birth-date contextBuilt in
Health identifiersNPI, DEA, Medicare MBI, NHS, KVNR, record and member numbersHealthcare pack
API keys and credentials232 secret formats, including every provider Maskflare proxiesCredentials pack
IP and MAC addresses, device IDs, crypto wallets, VINsValidated formats and checksumsBuilt in
Web URLs that identify someoneLinks carrying record IDs, emails, names or social profiles; every URL with the opt-in strict packBuilt in, strict pack optional
Your own identifiersCustom regex rules, term dictionaries, and Exact Data Match on your recordsConfigurable
Text inside documentsPDF, Word, Excel, PowerPoint, HTML, and e-mail attachmentsOptional document scanning
Text inside imagesClassic OCR on images attached to API requests; matched words blacked out (best effort)Optional image scanning

Synthetic examples

Input and transformed output

Three of the seven actions, applied to synthetic data. Tokens are shortened for readability.

AI prompt · mask

Input

Summarize the case for Alex Morgan (alex@example.com), IBAN DE89 3704 0044 0532 0130 00.

Transformed

Summarize the case for mf_mask_1d0c… (mf_mask_7a42…), IBAN mf_mask_c93e….

Application log · redact

Input

password_reset user=alex@example.com ip=203.0.113.42 status=sent

Transformed

password_reset user=[REDACTED] ip=[REDACTED] status=sent

Support transcript · partial

Input

Please call me at +1 202-555-0147 about order MF-10492.

Transformed

Please call me at +* ***-***-0147 about order MF-10492.

Policy actions

What each rule can do with a match

Mask

Replace the value with an mf_mask_ token that can be restored in the response or through the unmask API.

Reversible

Redact

Replace the value with [REDACTED].

Irreversible

Partial

Keep the first or last few characters and star the rest.

Recognition without exposure

Hash

Replace the value with a keyed hash that is stable within your organization.

Joins without the value

Format-preserving encryption

Encrypt letters and digits in place, keeping length and separators.

Reversible, same shape

Alert

Let the value through and count the match.

Monitoring and tuning

Block

Refuse the whole request with a 403 before it reaches the provider.

Prohibited data

Detection methodology

How a request is processed

  1. 01

    Normalize

    Decode JSON escapes, fold Unicode look-alikes and invisible characters, and decode base64, hex, and URL-encoded runs.

  2. 02

    Detect

    Run validated patterns, checksums, context keywords, dictionaries, and Exact Data Match on the normalized text.

  3. 03

    Resolve

    Drop allowlisted values and keep the strongest finding where matches overlap.

  4. 04

    Act

    Apply each rule's action. A block rule refuses the request before the provider sees it.

  5. 05

    Restore

    If restoration is on for the API key, swap tokens back in the response, streaming included. Record metadata-only counts.

How quality should be measured

Report precision and recall by data type, language, source, and format. Keep tuning samples separate from the final evaluation set, and review transformation quality as well as detection.

How false positives should be handled

Start new rules in alert mode, add allowlist entries for known safe values, and use the console playground to see which rule matched and why a near-miss was rejected. Counts are recorded without the values.

Integration architecture

Place enforcement before the destination

Source

Application, AI agent, employee browser, or data pipeline

Detection

574 built-in detectors, a named-entity layer, your rules, and Exact Data Match

Policy

Per-environment rules: mask, redact, hash, encrypt, alert, or block

Destination

OpenAI, Anthropic, Gemini, Mistral, and 5 more providers

Maskflare reaches traffic three ways: apps (the gateway with one base URL per provider, the Python and TypeScript SDKs, the LiteLLM guardrail), people (the Workforce desktop agent and browser protection for ChatGPT, Claude, Gemini, DeepSeek and Perplexity, or the forward proxy), and agents (MCP tool-call masking and hooks for Claude Code, Cursor and Codex CLI). If masking can't run, each organization chooses whether requests fail closed or go through and are flagged.

Known limitations

Known limits

Context can be ambiguous

Names, addresses, and internal references don't always have a unique format. Context keywords and checksums reduce false positives; allowlists handle known safe values.

Names have no checksum

Person names are found by word lists, context and the local named-entity layer. Test unusual names and spellings from your own documents.

Image text depends on quality

Image scanning uses classic OCR (no AI model) in English, German, French and Italian, for API requests and browser uploads. Handwriting is detected and refused. Very small, blurred or stylized text can still be missed. Files are also stripped of metadata and checked for malware.

Custom identifiers need configuration

Customer, employee, case, and transaction numbers need your own regex rules, dictionaries, or Exact Data Match.

Masking is not a full data-risk review

Confidential business information and sensitive inferences without a recognizable format need their own policy.

Explainable by design

Identifiers and secrets are found by patterns, checksums, word lists and exact matching; names and free-text details by a local named-entity layer that runs inside Maskflare. Every decision is explained in the playground.

Next step

See it on your own data

Bring the providers, data types, and languages your teams use, and we'll run them through Maskflare in a 30-minute demo.

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.