Appearance
Anti-Exfiltration
GhostAI detects and blocks attempts to obfuscate and exfiltrate sensitive data through encoding, ciphers, visual tricks, and other evasion techniques.
Overview
Malicious actors — or well-meaning users — may try to bypass PII detection by encoding or obfuscating data before it leaves a conversation. GhostAI's anti-exfiltration layer automatically detects these attempts, decodes the underlying content, and applies the same PII protection policies as plaintext.
This protection operates transparently across chat messages, uploaded files, RAG-retrieved content, and agentic tool workflows.
What Is Detected
GhostAI recognizes a broad range of obfuscation categories:
| Category | Description |
|---|---|
| Encoding | Standard encodings used to disguise text (e.g., Base64, hex, URL encoding, HTML entities, Unicode escapes) |
| Ciphers | Simple substitution and transposition ciphers commonly used to evade text scanners |
| Unicode tricks | Homoglyph substitution, zero-width characters, invisible separators, and combining character abuse |
| Text manipulation | Character substitution schemes, reversal, interleaving, and word-level transformations |
| Structural evasion | Splitting PII across line breaks, whitespace padding, word boundaries, and combining multiple methods |
When obfuscation is detected, GhostAI normalizes the content, identifies the underlying PII, and enforces the configured protection action (block, tokenize, or redact) — the same way it would handle plaintext PII.
Multi-Layer Analysis
Content passes through multiple normalization and detection stages. Each stage targets a different class of evasion technique, and the stages build on each other so that layered or combined obfuscation methods are still caught.
This multi-pass approach means that even novel combinations of encoding, ciphers, and visual tricks are unlikely to evade detection.
Prompt Injection Detection
Uploaded files and RAG-retrieved documents can contain text designed to manipulate the AI model — instructing it to ignore safety rules, change behavior, or leak data. GhostAI scans all file and document content for prompt injection patterns before it reaches the LLM.
Key protections include:
- Pattern-based detection — known injection techniques are identified and neutralized automatically.
- Automatic sanitization — detected patterns are escaped so they cannot influence model behavior.
- Instruction hierarchy enforcement — file content is clearly demarcated as untrusted data, instructing the model to treat it as content rather than instructions.
RAG Poisoning Defense
Documents indexed for retrieval-augmented generation are scanned at retrieval time. Individual chunks are checked for injection patterns before they are assembled into a prompt. Chunks containing detected patterns are sanitized rather than dropped, preserving content while neutralizing threats. All detections are logged for security review.
Agentic Workflow Protection
When GhostAI uses tools — code execution, web search, data queries, or MCP integrations — additional protections guard against misuse:
- Sandboxed execution — code runs in isolated environments with strict resource and access controls.
- Tool invocation limits — configurable caps prevent runaway tool loops.
- Argument validation — tool inputs are checked for injection attacks and dangerous patterns.
- Output scanning — LLM-generated output is scanned for PII before any post-processing occurs.
- Path and resource validation — file system and network access are restricted to prevent traversal and exfiltration.
These protections apply automatically whenever agentic features are enabled.
Audit Trail
All exfiltration attempts are logged with full context for security review:
| Field | Description |
|---|---|
| Timestamp | When the attempt was detected |
| Method category | Class of obfuscation used |
| Entity type | Type of PII found after decoding |
| User | Who initiated the request |
| Action taken | Whether content was blocked, tokenized, or allowed |
Audit logs integrate with GhostAI's compliance reporting and can be exported for external SIEM systems.
Security Alerts
Administrators can configure alerts to trigger on exfiltration activity, including:
- Multiple attempts from the same user within a time window
- High-risk data types (SSNs, credit cards, financial accounts)
- Unusual or repeated obfuscation techniques
- Repeated blocked attempts
Alert thresholds and notification channels are configurable through the admin dashboard.
Public Figure and Public Knowledge Reconciliation
Anti-exfiltration scanning executes before public figure reconciliation and public knowledge reconciliation. If an entity is obfuscated, exfiltration detection fires first regardless of whether the underlying value is a known public figure, location, or organization.
Even after anti-exfiltration checks pass, content must still clear all reconciliation safety filters before any bypass decision is made. This defense-in-depth approach ensures that obfuscation cannot be used to circumvent any layer of protection.
API Endpoints
| Endpoint | Description |
|---|---|
POST /api/detect/exfiltration | Check text for obfuscation and hidden PII |
Configuration
Administrators can adjust anti-exfiltration behavior at a high level:
- Enable or disable protection — anti-exfiltration can be toggled globally or per workspace.
- Method selection — individual categories of detection can be enabled or disabled based on your threat model.
- Sensitivity tuning — thresholds for minimum content length and decode depth can be adjusted to balance security with false-positive rates.
- Alert configuration — thresholds, time windows, and notification channels are configurable.
Configuration is available through the admin dashboard and the management API.
False Positive Handling
Some legitimate content (code examples, URLs with parameters, technical documentation containing encoded values) may trigger detection. To manage this:
- Context-aware detection reduces false positives by considering surrounding content.
- Allowlisting lets administrators mark known-safe patterns.
- Per-content-type sensitivity allows different thresholds for different use cases.
- Feedback loops continuously improve detection accuracy.
Best Practices
- Enable broad detection — attackers frequently combine techniques, so comprehensive coverage is more effective than selective enablement.
- Monitor audit logs — review exfiltration attempt logs regularly to identify patterns and emerging threats.
- Configure alerts — set up notifications for high-risk activity so your security team can respond promptly.
- Tune for your environment — adjust sensitivity settings based on your content types and acceptable false-positive rates.
Compliance Benefits
Anti-exfiltration protection supports compliance with data protection regulations by ensuring that PII cannot be smuggled past detection through encoding or obfuscation. This strengthens your posture for HIPAA, PCI-DSS, GDPR, CCPA, and other frameworks that require technical safeguards against data leakage.
Next Steps
- PII Detection — Core detection capabilities
- Code Protection — Code-level obfuscation defense
- Audit Reports — Security and compliance logging