Documentation Index
Fetch the complete documentation index at: https://docs.neuraltrust.ai/llms.txt
Use this file to discover all available pages before exploring further.
The Document Analyzer plugin scans uploaded files (PDF, DOCX, images, etc.) for Personally Identifiable Information (PII), jailbreak attempts, and other sensitive content before they are processed by your AI application.
Features
- Multi-format support: PDF, DOCX, XLSX, PPTX, images (PNG, JPEG, TIFF)
- PII detection: Email, credit cards, phone numbers, national IDs, and more
- Jailbreak detection: Detect prompt injection and jailbreak attempts in document content
- OCR support: Extract text from images and scanned documents
- Configurable blocking: Choose which PII entities trigger blocking and set jailbreak thresholds
Configuration
{
"name": "doc_analyzer",
"enabled": true,
"stage": "pre_request",
"settings": {
"mode": "enforce",
"max_file_size": 52428800,
"pii": {
"entities": [
"email",
"credit_card",
"iban",
"phone_number",
"spanish_dni",
"spanish_nie"
]
},
"firewall": {
"enabled": true,
"threshold": 0.7,
"credentials": {
"base_url": "https://api.neuraltrust.ai",
"token": "your-api-token"
}
},
"ocr": {
"enabled": true,
"languages": ["en", "es"]
}
}
}
Settings
| Parameter | Type | Description | Default |
|---|
mode | string | enforce (block) or observe (log only) | enforce |
max_file_size | integer | Maximum file size in bytes | 52428800 (50MB) |
PII Configuration
| Parameter | Type | Description | Default |
|---|
pii.entities | array | List of PII entity types to detect and block | [] |
Firewall Configuration (Jailbreak Detection)
| Parameter | Type | Description | Default |
|---|
firewall.enabled | boolean | Enable jailbreak detection | false |
firewall.threshold | float | Jailbreak score threshold (0.0-1.0) | 0.7 |
firewall.credentials.base_url | string | NeuralTrust API base URL | - |
firewall.credentials.token | string | NeuralTrust API token | - |
OCR Configuration
| Parameter | Type | Description | Default |
|---|
ocr.enabled | boolean | Enable OCR for images | false |
ocr.languages | array | OCR language codes | ["en"] |
Supported PII Entities
| Entity | Description |
|---|
email | Email addresses |
credit_card | Credit card numbers |
iban | International Bank Account Numbers |
phone_number | Phone numbers |
spanish_dni | Spanish National ID |
spanish_nie | Spanish Foreigner ID |
ssn | Social Security Numbers |
passport | Passport numbers |
Modes
Enforce Mode
When mode is set to enforce, the plugin will:
- Block requests containing files with detected PII (if PII entities are configured)
- Block requests with jailbreak scores above the threshold (if firewall is enabled)
- Return a
403 Forbidden response with details about detected threats
Observe Mode
When mode is set to observe, the plugin will:
- Log detected PII and jailbreak attempts without blocking the request
- Allow the request to proceed
- Record findings in observability data
Example Responses
PII Detected (Blocked)
{
"error": "PII detected in document",
"status": 403,
"details": {
"mode": "enforce",
"action": "blocked",
"pii_detected": true,
"pii_entities": [
{
"type": "email",
"value": "[email protected]",
"file": "document.pdf"
}
]
}
}
Jailbreak Detected (Blocked)
{
"error": "Jailbreak attempt detected in document",
"status": 403,
"details": {
"mode": "enforce",
"action": "blocked",
"jailbreak_detected": true,
"jailbreak_score": 0.92,
"threshold": 0.7
}
}
Combined Detection (Blocked)
{
"error": "Security threats detected in document",
"status": 403,
"details": {
"mode": "enforce",
"action": "blocked",
"pii_detected": true,
"pii_entities": [
{
"type": "credit_card",
"value": "4111-XXXX-XXXX-1111",
"file": "invoice.pdf"
}
],
"jailbreak_detected": true,
"jailbreak_score": 0.85,
"threshold": 0.7
}
}
Use Cases
- Data Loss Prevention: Prevent sensitive data from being sent to AI models
- Jailbreak Protection: Block prompt injection attempts hidden in documents
- Compliance: Ensure GDPR, CCPA, and other regulatory compliance
- Audit Trail: Log all PII and jailbreak detection events for security audits
- Multi-layer Security: Combine PII and jailbreak detection for comprehensive protection