Concepts

PII Removal

How DeepRead's AI-powered PII detection and redaction works under the hood

PII Removal

DeepRead's PII removal system uses LLM-powered analysis to detect and redact personally identifiable information from documents. Unlike regex-based tools that only catch predictable patterns, DeepRead understands context, so it catches names in sentences, addresses in paragraphs, and PII in complex layouts.

How detection works

The system processes each page of your document through vision AI to identify PII entities:

Document Pages -> Vision AI Analysis -> PII Entities with Locations

For each detected entity, the system captures:

  • Type: What kind of PII (EMAIL, PHONE, SSN, NAME, etc.)
  • Location: Exact position on the page (bounding box coordinates)
  • Confidence: How certain the AI is about the detection (0.0 - 1.0)
  • Page number: Which page the entity appears on

PII types detected

TypeDescriptionExamples
NAMEPersonal namesJohn Smith, Dr. Sarah Chen
EMAILEmail addressesjohn@example.com
PHONEPhone numbers(555) 123-4567, +1-555-123-4567
SSNSocial Security Numbers, national IDs123-45-6789
CREDIT_CARDCredit/debit card numbers, payment references4111-1111-1111-1111
ADDRESSPhysical addresses123 Main St, New York, NY 10001
DATE_OF_BIRTHDates of birth1990-01-15
PASSPORT_NUMBERPassport numbersAB1234567
DRIVER_LICENSEDriver's license, vehicle registration, chassis/engine numbersDL09-20230001234
BANK_ACCOUNTBank account numbers, routing numbers1234567890
IBANInternational Bank Account NumbersGB29NWBK60161331926819
IP_ADDRESSIP addresses (IPv4/IPv6)192.168.1.1
URLWeb addresseshttps://example.com/profile
MEDICAL_RECORDMedical record numbers, patient IDsMRN-12345678

The AI detects PII regardless of formatting. Phone numbers written as "5551234567", "(555) 123-4567", or "555.123.4567" are all caught.

The detector distinguishes between personal and institutional information. Company emails (support@company.com), institutional phone numbers in letterheads, and organization addresses are not flagged. Only PII belonging to specific individuals is detected.

Redaction style

DeepRead uses black bar redaction — opaque black rectangles drawn over PII, making it completely unreadable. This is the standard approach for legal documents and compliance.

Confidence scoring

Every detection includes a confidence score between 0.0 and 1.0:

  • 0.85 - 1.0: High confidence, almost certainly PII
  • 0.5 - 0.85: Medium confidence, likely PII but may need review
  • Below 0.5: Low confidence, flagged but may be a false positive

The system uses a default threshold of 0.85. Detections below this threshold are flagged in the report but still redacted by default for safety.

Job lifecycle

PII removal jobs follow the same lifecycle as all DeepRead processing jobs:

queued -> processing -> completed
                     -> failed

Job states

StateDescription
queuedJob created, waiting to start
processingAI is analyzing pages and applying redactions
completedDocument redacted, download URL available
failedUnrecoverable error occurred

Detection report

When a job completes, the response includes a detailed report:

FieldDescription
idJob identifier
page_countNumber of pages processed
processing_time_msTotal processing time
total_redactionsNumber of PII instances redacted
pii_detectedBreakdown by PII type with counts, pages, and confidence
redaction_policyWhich redaction style was used
confidence_threshold_usedThe threshold applied

Multi-language support

PII detection supports multiple languages:

LanguageCodeNotes
EnglishenDefault, best coverage
ChinesezhSimplified and Traditional
SpanishesIncluding Latin American variants
HindihiDevanagari script
ArabicarRight-to-left support

Security and compliance

DeepRead's PII removal is designed with compliance in mind:

  • No PII in logs: Raw PII values are never written to application logs
  • Audit trail: Every detection is recorded with type, confidence, and page number (but not the actual value)
  • Value hashing: Original values are stored only as SHA-256 hashes for verification
  • Signed URLs: Redacted documents are served via time-limited signed URLs
  • HTTPS only: Webhook URLs must use HTTPS

Webhooks

Configure a webhook_url when creating a job to receive completion notifications instead of polling. See the PII Removal API Reference for webhook payload structure.

Best practices

Redaction

All PII is redacted with black_bar style — no trace of the original value remains in the output document.

Handle multi-page documents

Large documents may take longer to process. Use webhooks instead of polling for documents over 10 pages.

Limitations

  • File size: Plan-dependent limits (see Pricing)
  • Handwritten PII: Detection accuracy is lower for handwritten text
  • Overlapping text: In rare cases, complex PDF layouts may affect redaction positioning