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
| Type | Description | Examples |
|---|---|---|
NAME | Personal names | John Smith, Dr. Sarah Chen |
EMAIL | Email addresses | john@example.com |
PHONE | Phone numbers | (555) 123-4567, +1-555-123-4567 |
SSN | Social Security Numbers, national IDs | 123-45-6789 |
CREDIT_CARD | Credit/debit card numbers, payment references | 4111-1111-1111-1111 |
ADDRESS | Physical addresses | 123 Main St, New York, NY 10001 |
DATE_OF_BIRTH | Dates of birth | 1990-01-15 |
PASSPORT_NUMBER | Passport numbers | AB1234567 |
DRIVER_LICENSE | Driver's license, vehicle registration, chassis/engine numbers | DL09-20230001234 |
BANK_ACCOUNT | Bank account numbers, routing numbers | 1234567890 |
IBAN | International Bank Account Numbers | GB29NWBK60161331926819 |
IP_ADDRESS | IP addresses (IPv4/IPv6) | 192.168.1.1 |
URL | Web addresses | https://example.com/profile |
MEDICAL_RECORD | Medical record numbers, patient IDs | MRN-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
| State | Description |
|---|---|
queued | Job created, waiting to start |
processing | AI is analyzing pages and applying redactions |
completed | Document redacted, download URL available |
failed | Unrecoverable error occurred |
Detection report
When a job completes, the response includes a detailed report:
| Field | Description |
|---|---|
id | Job identifier |
page_count | Number of pages processed |
processing_time_ms | Total processing time |
total_redactions | Number of PII instances redacted |
pii_detected | Breakdown by PII type with counts, pages, and confidence |
redaction_policy | Which redaction style was used |
confidence_threshold_used | The threshold applied |
Multi-language support
PII detection supports multiple languages:
| Language | Code | Notes |
|---|---|---|
| English | en | Default, best coverage |
| Chinese | zh | Simplified and Traditional |
| Spanish | es | Including Latin American variants |
| Hindi | hi | Devanagari script |
| Arabic | ar | Right-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