Appearance
GhostClaw: Enterprise Privacy for Agentic AI
Abstract
As agentic AI systems move from experimentation to production, the gap between capability and compliance widens. OpenClaw — with 307K GitHub stars and 3M+ monthly active users — represents the largest open-source AI agent platform. Yet enterprises face a fundamental tension: agents need access to sensitive data to be useful, but every interaction is a potential data leak. GhostClaw bridges this gap with reversible PII tokenization that protects sensitive data before it reaches any LLM, without changing how agents or users work. This paper presents the architecture, threat model, and compliance framework for privacy-preserving agentic AI.
1. The Agentic AI Privacy Problem
1.1 Scale of the Threat
The enterprise adoption of AI agents has outpaced the security infrastructure meant to govern them. The numbers paint a stark picture:
- 22% of enterprise employees run AI agents without IT approval — a phenomenon known as shadow AI that mirrors the shadow IT wave of the 2010s, but with far greater data exposure risk.
- 67% of enterprises are deploying AI agents in production or have concrete plans to do so within the next 12 months.
- 4 security incidents in 60 days in the OpenClaw ecosystem alone: the ClawJacked supply-chain attack, CVE-2026-25253 (remote code execution via malformed skill manifests), 341 malicious skills discovered on ClawHub, and 40K+ exposed OpenClaw instances reachable from the public internet.
- $740K/year — the average enterprise AI spend for mid-size organizations (500–5,000 employees), a number that has tripled since 2024.
- $1.3 trillion in projected agentic AI spending by 2029, representing the fastest-growing segment of enterprise software.
These numbers reveal a structural problem: the tools are deployed, the budgets are allocated, but the privacy and compliance infrastructure lags behind by 12–18 months. Every day this gap persists, enterprises accumulate compliance debt that compounds with each agent interaction.
1.2 Five Data Leak Points in Agent Architecture
The OpenClaw community documents five distinct points where sensitive data can leak. Understanding these is essential because each requires a different mitigation strategy, and most existing tools address only one or two.
1. Context assembly. The agent assembles conversation history, file content, tool outputs, and memory into a context window before each LLM call. PII accumulated across multiple turns — a name in message 1, an address in message 3, a diagnosis in message 7 — is concatenated and sent to the LLM as a single payload. The attack surface grows with conversation length.
2. Provider-bound input. User messages are forwarded to the configured LLM provider (OpenAI, Anthropic, Google, NVIDIA, or a self-hosted model). Any PII in the message reaches the provider's servers. Even providers with data processing agreements (DPAs) represent a compliance surface that must be managed.
3. Model responses. LLMs can hallucinate or echo PII from training data or the current context. A model asked to "draft a referral letter for this patient" may generate a plausible SSN or date of birth that happens to be real. Responses may contain PII not present in the original query.
4. Tool outputs. Agent tools — database queries, file reads, API calls, web searches — return data that may contain PII. A CRM lookup returns a customer's email and phone number. A database query surfaces credit card numbers. This data enters the context window for subsequent LLM calls, amplifying the exposure.
5. File and media attachments. Users upload documents, images, and audio files. These may contain PII in text (a scanned contract), metadata (EXIF GPS coordinates on a photo), embedded images (a photo of a driver's license), or audio transcripts (a patient dictating their medical history).
1.3 Why Existing Solutions Fall Short
The current OpenClaw privacy ecosystem is inadequate for enterprise use. Three projects represent the state of the art, and all three have critical limitations:
openclaw-shield (Knostic): Detects approximately 4 PII types (email, SSN, credit card, phone number) using regular expressions only. Performs one-way redaction — masked data stays masked, replacing "John Smith" with "[REDACTED]" permanently. This breaks conversational coherence: when the user asks "What was John's diagnosis?", the agent sees "What was [REDACTED]'s diagnosis?" and cannot connect the reference. The plugin breaks with every major OpenClaw update because it patches internal APIs rather than using stable hooks.
Native privacy.redactPII: OpenClaw's built-in privacy setting strips phone numbers and hashes user IDs in telemetry. It does nothing for the actual conversation content sent to LLM providers. It was designed for analytics privacy, not conversational privacy.
TIAMAT Privacy Proxy: A community project that detects 9 PII types, with no reversibility, no file or image support, and no compliance tagging. It is maintained by a single developer as a side project and has not been updated since January 2026.
None of these solutions offer reversible tokenization, file scanning, image intelligence, vertical compliance tagging, or audit trails. None address the five leak points comprehensively. None are viable for a regulated enterprise.
2. GhostClaw Architecture
2.1 Design Principles
GhostClaw is built on five principles derived from real enterprise deployments and compliance requirements:
Invisible by default. Protection is always on. Users do not need to remember to activate privacy mode, select entity types, or configure detection rules. The system operates transparently, protecting data without requiring user action or awareness.
Reversible tokenization. PII is replaced with session-scoped tokens, not destroyed. The LLM sees consistent pseudonymous identifiers — [EMAIL_a7f2c3] instead of alice@company.com — preserving the structure and meaning of the conversation. When the response returns to the user, tokens are replaced with the original values. The user never sees a token.
Provider-agnostic. GhostClaw works with any LLM provider: OpenAI, Anthropic, Google Gemini, Meta Llama (via Ollama or vLLM), NVIDIA NIM, Azure OpenAI, AWS Bedrock, and any OpenAI-compatible endpoint. Privacy protection is not coupled to a specific model or provider.
Progressive depth. Four integration tiers allow organizations to start with zero-code configuration and progressively deepen integration as their requirements grow. Each tier adds capabilities without requiring the previous tier to be reconfigured.
Graceful degradation. If the GhostAI backend is unreachable, a configurable failMode determines behavior: block prevents the message from being sent (safest), warn sends the message but alerts the user (balanced), or pass sends the message unprotected (highest availability). The user is never stuck waiting for an unresponsive service.
2.2 Four Integration Tiers
Tier 0 — Zero-Code Config. GhostAI can be configured as a custom LLM provider or MCP server via openclaw.json. No plugin code is needed. All chat completions route through GhostAI's inference proxy, which performs transparent PII tokenization on input and detokenization on output. Streaming is fully supported — tokens are detokenized as they arrive. Available today on all GhostAI plans.
json
{
"mcpServers": {
"ghostai": {
"url": "https://mcp.ghostai.dev/sse",
"headers": { "Authorization": "Bearer ${GHOSTAI_API_KEY}" }
}
}
}Tier 1 — Plugin. A TypeScript plugin distributed via ClawHub and npm. The plugin registers a GhostAI provider with a dynamic model catalog (all models from all providers, accessed through a single GhostAI endpoint), three agent tools (ghostai_scan_text, ghostai_scan_file, ghostai_compliance_check), 14 slash commands for manual control, and a first-run onboarding wizard. Privacy receipts — inline summaries of what was protected — give users visibility into the protection applied.
Tier 2 — Universal Hooks. before_llm_call and after_llm_call lifecycle hooks intercept every LLM call regardless of the configured provider. The user selects any provider — OpenAI, Anthropic, Ollama — and GhostClaw tokenizes the input before the provider call and detokenizes the response after. This tier includes a ContextEngine wrapper that tokenizes full context assemblies (conversation history + tool outputs + file content) and a media understanding provider that scans images, audio, and video for PII.
Tier 3 — NemoClaw Sandbox. For NVIDIA NemoClaw deployments, GhostAI serves as the mandatory inference gateway. The sandbox network policy blocks all direct LLM access. Every inference request passes through GhostAI. PII protection is mandatory, not optional — enforced by network topology rather than configuration.
2.3 Tokenization Protocol
The tokenize/detokenize round-trip is the core primitive of GhostClaw. Everything else — hooks, plugins, tools — exists to ensure this round-trip happens at the right points in the agent lifecycle.
POST /v1/tokenize
Request: { "text": "My SSN is 123-45-6789", "vertical": "healthcare" }
Response: {
"tokenized_text": "My SSN is [SSN_b2c1e7]",
"session_id": "sess_abc123",
"entities": [{
"entity_type": "US_SSN",
"original_text": "123-45-6789",
"token": "[SSN_b2c1e7]",
"confidence": 0.99,
"compliance_tags": ["HIPAA §164.514", "PCI-DSS Req 3"]
}]
}Key properties of the tokenization protocol:
- Session-scoped tokens. The same PII value within the same session always produces the same token. If
alice@company.comappears in message 1 and message 5, both instances become[EMAIL_a7f2c3]. The LLM perceives a consistent identifier and maintains conversational coherence — it can refer back to "the person at [EMAIL_a7f2c3]" across turns. - Cryptographic suffixes. Token suffixes are derived from a cryptographic hash, producing values (e.g.,
b2c1e7) that are statistically unlikely to appear in natural language or user input. This prevents injection attacks where a user crafts input that mimics a token to extract the vault contents. - 24-hour expiry. Token vault entries expire after 24 hours of inactivity, bounding the exposure window. A breach of the vault after expiry yields no usable data.
- Fuzzy matching on restore. LLMs occasionally modify tokens — adding punctuation, changing case, or truncating. The detokenize endpoint performs fuzzy matching (Levenshtein distance ≤ 2) to recover the correct mapping, with a confidence threshold to prevent false matches.
2.4 Detection Pipeline
GhostAI's detection pipeline is the product of 18 months of development across regulated verticals. It operates at significantly greater depth and breadth than any alternative in the OpenClaw ecosystem.
64+ entity types with vertical specialization. Healthcare deployments detect PHI (protected health information) including MRN, diagnosis codes, and provider NPIs. Financial deployments detect PCI data including PANs, CVVs, and routing numbers. Government deployments detect CUI (controlled unclassified information) including FOUO markings and classification banners.
Multi-layer detection combines three approaches for high recall and precision:
- Presidio (pattern matching): Fast, deterministic detection of structured PII (SSNs, credit cards, phone numbers, emails).
- NER (named entity recognition): ML-based detection of unstructured PII (person names, addresses, medical conditions).
- AI verification (LLM-based referee): A lightweight model verifies ambiguous detections, reducing false positives. "Dr. Smith prescribed lisinopril" — is "Smith" a person name (yes) and is "lisinopril" sensitive (context-dependent)?
Anti-exfiltration. Detection of 19+ obfuscation methods used to bypass PII filters: base64 encoding, hexadecimal encoding, ROT13, Unicode homoglyphs, leetspeak substitution, NATO phonetic alphabet, Morse code, reversed strings, whitespace encoding, HTML entities, URL encoding, octal encoding, binary encoding, pig latin, character-by-character spelling, phonetic spelling, zero-width character injection, mathematical Unicode symbols, and regional indicator symbols.
100+ file formats. PDF, Microsoft Office (Word, Excel, PowerPoint), OpenDocument, archives (ZIP, TAR, 7z), email archives (PST, MBOX, EML), medical formats (DICOM, HL7 FHIR, CDA), database exports (CSV, Parquet, SQLite), code files (34 programming languages), and plain text in 12 character encodings.
Image intelligence. ID card detection with templates for all 50 US states plus federal IDs (passport, military, Global Entry). Passport MRZ (machine-readable zone) parsing. Credit card number extraction via OCR. Bank check MICR line reading. Face de-identification (blur/pixelate). NSFW content detection. Steganography detection (LSB analysis). QR code and barcode scanning for embedded PII. EXIF metadata stripping (GPS coordinates, camera serial numbers, timestamps).
Audio and video PII. Audio files are transcribed via Whisper, and the transcript is scanned for PII. Video files undergo frame sampling (configurable rate, default 1 fps), OCR on extracted frames, and audio track extraction + transcription. Detected PII is reported with timestamps for targeted redaction.
Public figure reconciliation. A 3-tier resolution system prevents masking well-known names while protecting private individuals. Tier 1: a curated list of 50K+ public figures (heads of state, Fortune 500 executives, major public figures). Tier 2: Wikidata lookup for names not in the curated list. Tier 3: LLM fallback for ambiguous cases. The system correctly leaves "Einstein" and "Elon Musk" unmasked while protecting "John Smith, SSN 123-45-6789."
3. Threat Model
3.1 Threats Addressed
| Threat | GhostClaw Mitigation |
|---|---|
| PII in user messages reaches LLM | Tokenized before provider call |
| PII in context window (multi-turn) | ContextEngine wrapper tokenizes full context |
| PII in file attachments | File scan tool + media understanding provider |
| PII in images (ID cards, documents) | Image intelligence with 50-state template matching |
| Obfuscated PII (base64, hex, Unicode) | 19+ anti-exfiltration method detection |
| LLM hallucinates PII in response | Response scanning + re-tokenization |
| Token injection by user | Cryptographic token suffixes + vault-only matching |
| GhostAI service outage | Configurable failMode (block/warn/pass) |
| API key compromise | Keys stored in OpenClaw's encrypted credential store |
| Man-in-the-middle | TLS enforced in production; HTTP refused at high sensitivity |
3.2 Threats Not Addressed
Intellectual honesty requires acknowledging the boundaries of any security system. GhostClaw does not claim to address the following:
Training data memorization. If the LLM has memorized PII from its training corpus, GhostClaw cannot prevent it from appearing in responses unprompted. Response scanning catches many instances, but a model that generates a real person's phone number from memory — without that number appearing in the conversation — presents a detection challenge that no input-side protection can fully solve.
Side-channel leaks. Timing analysis of token patterns could theoretically reveal entity types. A token replacing a 16-digit number is likely a credit card; a token replacing a pattern like XXX-XX-XXXX is likely an SSN. Mitigated by using a consistent token format ([TYPE_hash]) regardless of entity type, but sophisticated statistical analysis of token distributions remains a theoretical risk.
Compromised GhostAI instance. If the GhostAI backend itself is compromised, the attacker has access to the token vault and can reverse all active tokens. Mitigations include: on-premise deployment (the vault never leaves your infrastructure), 24-hour token expiry (limiting the window of exposure), DSAR erasure endpoints (enabling rapid purge), and standard infrastructure security practices (network segmentation, least-privilege access, monitoring).
Inference from tokenized data. An LLM receiving [PERSON_a7f2c3] was diagnosed with [CONDITION_d4e5f6] can infer that someone has a medical condition, even though the specific person and condition are masked. GhostClaw protects the identity and the specific data value, not the structural relationship between entities.
4. Compliance Framework
4.1 Vertical Compliance Tagging
Every detected entity is tagged with applicable regulation sections, enabling compliance teams to generate reports scoped to their specific regulatory obligations. This is not a generic "compliant/not compliant" flag — it is a precise mapping from detected data to the regulation paragraph that governs its handling.
- HIPAA: §164.514 (de-identification standard), §164.502 (minimum necessary standard), §164.528 (accounting of disclosures)
- PCI-DSS: Req 3 (protect stored cardholder data), Req 4 (encrypt transmission of cardholder data across open networks), Req 10 (track and monitor access)
- GDPR: Art. 5 (data minimization), Art. 25 (data protection by design and by default), Art. 30 (records of processing activities), Art. 35 (data protection impact assessment)
- SOX: §302 (corporate responsibility for financial reports), §404 (management assessment of internal controls)
- GLBA: §501 (protection of nonpublic personal information — the safeguards rule)
- FERPA: §99.31 (conditions under which prior consent is not required for disclosure)
- ITAR: §120.17 (technical data definition), §120.10 (defense article definition)
- NIST 800-171: 3.1.22 (control CUI in accordance with applicable laws)
- CCPA/CPRA: §1798.100 (right to know), §1798.105 (right to delete)
- State privacy laws: Colorado Privacy Act, Virginia CDPA, Connecticut DPA, and 40+ additional US and international regulations
4.2 Audit Trail
Every PII detection event produces an immutable audit record containing:
- Timestamp (ISO 8601, microsecond precision)
- Entity type (e.g.,
US_SSN,PERSON_NAME,MEDICAL_CONDITION) - Detection confidence (0.0–1.0, with detector source attribution)
- Detector source (Presidio, NER, AI referee, or combination)
- Conversation ID (linking the detection to the specific agent session)
- Action taken (tokenized, blocked, warned, or passed)
- Compliance tags (applicable regulation sections)
- Vertical context (healthcare, financial, government, etc.)
Audit records are delivered to enterprise SIEM systems via two mechanisms: webhook push (real-time, configurable batching) and pull API (polling endpoint with cursor-based pagination). GhostAI includes 16 pre-built SIEM integration presets: Splunk, Microsoft Sentinel, Datadog, IBM QRadar, Elastic SIEM, Sumo Logic, LogRhythm, Exabeam, Securonix, CrowdStrike Falcon, Palo Alto Cortex, Google Chronicle, AWS Security Hub, Azure Monitor, Grafana Loki, and generic syslog.
4.3 DSAR Compliance
GDPR Article 15 (right of access) and Article 17 (right to erasure), along with CCPA §1798.105 (right to delete), require organizations to locate and act on all personal data held for a given data subject. GhostAI provides purpose-built endpoints:
POST /api/pii/dsar/export— Export all PII detected for a data subject across all sessions, returned as a structured JSON document suitable for delivery to the data subject or their representative.POST /api/pii/dsar/erasure— Permanently delete all stored PII for a data subject from the token vault and audit records. Returns a cryptographic proof of erasure (hash of deleted records + timestamp) for compliance documentation.
5. NemoClaw Integration
5.1 Architecture
NemoClaw (NVIDIA, launched March 16, 2026) runs OpenClaw agents inside OpenShell sandboxes with strict network policies, resource limits, and execution monitoring. GhostAI fits naturally as the inference gateway — the single egress point for all LLM traffic:
Agent (in sandbox) → OpenShell Gateway → GhostAI (tokenize) → NVIDIA NIM → response → GhostAI (detokenize) → AgentThe sandbox network policy allows egress only to the GhostAI instance. Direct LLM access — to NVIDIA NIM, OpenAI, or any other provider — is blocked at the network level. This means PII protection is enforced by network topology, not by agent configuration. An agent cannot bypass GhostClaw even if it is explicitly instructed to do so.
5.2 Defense in Depth
NemoClaw and GhostClaw protect different layers of the agent security stack:
- NemoClaw: Execution environment security. Sandbox isolation prevents filesystem escape, network policy controls egress, resource limits prevent denial-of-service, and execution monitoring detects anomalous behavior.
- GhostClaw: Data security. PII tokenization prevents data leakage, compliance tagging enables regulatory reporting, audit trails provide forensic evidence, and DSAR endpoints enable data subject rights.
Together, they provide defense in depth: the sandbox prevents the agent from escaping its execution environment, and GhostClaw prevents sensitive data from escaping the organization's control. Neither is sufficient alone — a sandbox without data protection still leaks PII to the LLM provider, and data protection without a sandbox still allows agent escape.
5.3 NeMo Guardrails Complementarity
NeMo Guardrails (NVIDIA's Colang-based safety framework, with Presidio-based PII masking, jailbreak prevention, and topic control) and GhostAI address orthogonal concerns:
- NeMo Guardrails: Output quality and safety. Prevents jailbreaks, enforces topic boundaries, blocks harmful content, and applies content safety policies.
- GhostAI: Input privacy and compliance. Ensures PII never reaches the LLM, tags detections with compliance metadata, generates audit trails, and enables DSAR compliance.
They stack cleanly in the inference pipeline:
User → GhostClaw (tokenize PII) → NeMo Guardrails (input safety) → LLM → NeMo Guardrails (output safety) → GhostClaw (restore PII) → UserGhostClaw operates on the outermost layer — closest to the user — ensuring that PII is removed before any other processing and restored after all processing is complete.
6. Performance
6.1 Latency Budget
Production deployments require that privacy protection adds minimal latency to the user experience. GhostClaw is designed to fit within a strict latency budget:
| Operation | Target | Measured (p95) |
|---|---|---|
| PII scan (<4K tokens) | <50ms | 12–30ms |
| Streaming first-token overhead | <100ms | ~50ms |
| Plugin cold start | <2s | ~800ms |
| Model catalog fetch | <500ms | ~200ms |
| File scan (<50MB) | <30s | 2–15s (size dependent) |
| Image intelligence (single image) | <10s | 1–5s (complexity dependent) |
| Audio transcription + scan (1 min) | <60s | 15–30s |
For streaming responses — the dominant interaction pattern — users experience approximately 50ms of additional latency on the first token. Subsequent tokens stream at wire speed because detokenization is a local lookup operation.
6.2 Scalability
- Session scoping: Token vaults are scoped per-conversation, not per-user, preventing cross-conversation collision and bounding vault size.
- Context window support: Messages up to 128K tokens (the full context window of current frontier models) are supported without degradation.
- ContextEngine overhead: The ContextEngine wrapper adds less than 2x overhead for conversations under 100 messages. For longer conversations, incremental tokenization (scanning only new content) keeps overhead constant.
- Token expiry: Vault entries expire after 24 hours of inactivity, ensuring memory usage is bounded regardless of deployment duration.
- Horizontal scaling: The GhostAI backend is stateless except for the token vault, which can be backed by Redis, PostgreSQL, or an in-memory store depending on deployment requirements.
7. Deployment Options
| Option | Description | Best For |
|---|---|---|
| Self-hosted | Run GhostAI on your own infrastructure (Docker, Kubernetes, bare metal) | Air-gapped environments, maximum data control, government/defense |
| Cloud | GhostAI managed cloud instance with automatic updates and monitoring | Quick start, teams without dedicated infrastructure |
| NemoClaw sandbox | GhostAI inside NVIDIA NemoClaw with network-enforced privacy | Enterprise secure agent deployments, mandatory compliance |
| Hybrid | Cloud GhostAI control plane with on-premise token vault | Compliance requirements + operational convenience |
All deployment options support the same API surface, the same integration tiers, and the same compliance features. The choice is driven by infrastructure requirements and data residency constraints, not feature availability.
8. Conclusion
Agentic AI is moving to production. The privacy gap — between what agents can do and what compliance allows — is the primary barrier to enterprise adoption. Enterprises will not deploy agents that handle customer PII, patient records, financial data, or classified information without a principled privacy architecture.
GhostClaw closes this gap with three properties that distinguish it from existing approaches:
Reversible tokenization that preserves conversational coherence — the LLM sees consistent pseudonymous identifiers, not destructive redactions, enabling it to reason about entities across conversation turns.
Four integration tiers from zero-code configuration to mandatory network-enforced privacy, meeting organizations where they are and growing with their requirements.
Compliance-grade audit trails with vertical-specific regulation tagging, SIEM integration, and DSAR endpoints — the infrastructure that compliance teams need to approve agent deployments.
The window for establishing the privacy standard in the OpenClaw ecosystem is measured in weeks, not months. NemoClaw launched March 16, 2026. The ecosystem is still forming. The difference between an agent that is "banned by IT" and one that is "approved for production" is a privacy layer that enterprises can trust.
GhostClaw is that layer.
GhostAI, Inc. — ghostai.devMarch 2026