Developer SDK: In-Process Consumer Privacy Defense & Pre-Emptive Interception
In-Process Consumer Privacy Defense: Pre-Emptive Interception at the Application Boundary
npm i @privacyscrubber/sdk
AI Summary / Key Takeaways
"Air-gapped Developer SDK for Node.js and WASM. Intercept PII in local RAM before LLM ingestion. HIPAA Safe Harbor and SOC 2 Type II compliant."
In-Process Fiduciary Defense
Pre-emptively intercept PII at the boundary with <0.4ms in-memory RAM execution.
In-Process Consumer Fiduciary & Pre-Emptive Interception
Pre-emptively intercept sensitive consumer data and infrastructure secrets at your application boundary. Zero data loss, zero third-party subprocessors, and sub-millisecond in-memory execution across all 30 specialized industry profiles.
Interactive Developer REPL & Latency Benchmark
Execute sub-millisecond in-memory sanitization live in your browser. Verify zero network egress, test bidirectional token detokenization, and inspect the volatile token map in real time across the 4 core cases.
npm i @privacyscrubber/sdkThe 4 Core Implementation Scenarios: Zero Data Loss Across Modern AI Stacks
From real-time streaming LLM prompts to complex JSON data lakes, tabular CSV files, and multimodal vision payloads.
Real-Time LLM Prompt & Streaming
Transparently wrap any standard LLM client in 1 line. Outbound prompts are intercepted and sanitized before cloud egress. The StreamingDetokenizer buffers token boundaries across chunk fragments, restoring original identities in volatile RAM without latency penalties.
import { wrapOpenAI, wrapAiStream } from'@privacyscrubber/sdk';
const ai = wrapOpenAI(new OpenAI(), { profile: 'legal' });
const res = await ai.chat.completions.create({ model: 'gpt-4o', messages });
Deep JSON & Vector Lake Ingestion
Recursively sanitize arbitrary nested JSON objects, metadata dictionaries, and arrays with sanitizeObject(). Preserves boolean and numeric field types while tokenizing sensitive strings. Eliminates irreversible vector poisoning under GDPR Art. 17 with O(1) constant-time erasure.
import { sanitizeObject, restoreObject } from'@privacyscrubber/sdk';
const { sanitized, tokenMap } = sanitizeObject(patientRecord, { profile: 'medical' });
await vectorIndex.upsert([{ id: docId, values: embedding, metadata: sanitized }]);
Document Pipelines & CSV / Tabular Batch
Sanitize high-throughput batch files, customer support ticket dumps, and accounting balance sheets without column misalignment or memory spikes. Linear-time ReDoS-hardened state machines process 50MB+ datasets preserving table headers, commas, and formatting boundaries.
import { sanitize } from'@privacyscrubber/sdk';
const { scrubbedText, tokenMap } = sanitize(csvContent, {
profile: 'finance', preserveStructure: true
});
Multimodal Vision & OCR Pre-Prompt Defense
Redact personal identifiers, national IDs (Israel Teudat Zehut, UK NHS, EU IBAN, US SSN), and credentials from OCR text streams before passing image context to vision LLMs. Guarantees zero sensitive identities leak into multimodal training sets or audit caches.
const ocrText = await extractOcrText(scannedDocumentBuffer);
const { scrubbedText, tokenMap } = sanitize(ocrText, { profile: 'general' });
const visionRes = await callVisionModel({ prompt: scrubbedText, image });
Client-Side Website Form & CRM Interceptor
Intercept user submissions in the browser DOM before network transmission. Sanitizes customer credit cards, emails, phone numbers, and national IDs in local RAM (<0.4ms) with zero cloud egress. Dual-Envelope architecture dispatches clean tokens to public ticketing systems and LLM triage bots while preserving encrypted session maps in your isolated private vault.
import { sanitize } from'@privacyscrubber/sdk/browser';
form.addEventListener('submit', async (e) => {
e.preventDefault();
const { scrubbedText, tokenMap } = sanitize(textarea.value, { profile: 'support' });
// 1. Public envelope (safe for Zendesk / Claude triage):
await fetch('/api/tickets', { method: 'POST', body: JSON.stringify({ message: scrubbedText }) });
// 2. Private vault envelope (encrypted map for staff resolution):
await secureVault.store(ticketId, tokenMap);
});
Interactive Website Form Sandbox: Live In-Browser Interception
Test how PrivacyScrubber intercepts customer inquiries, support tickets, and contact form submissions inside the browser DOM before network transmission. Zero PII hits your public CRM or AI models.
<!-- 1-Line Browser Form Interceptor -->
<script type="module">
import { sanitize } from 'https://cdn.jsdelivr.net/npm/@privacyscrubber/sdk@2.3.7/browser.js';
document.querySelector('#support-form').addEventListener('submit', async (e) => {
e.preventDefault();
const textarea = e.target.querySelector('textarea');
// 1. Sanitize in local browser RAM (<0.4ms)
const { scrubbedText, tokenMap } = sanitize(textarea.value, { profile: 'support' });
// 2. Transmit sanitized prompt to public CRM / AI
await fetch('/api/tickets', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: scrubbedText, tokenMap })
});
});
</script> 1. Zero Data Loss (Dual-Envelope)
Public CRM receives tokenized message ([EMAIL_1], [PHONE_1]), while your private vault holds the encrypted tokenMap. Authorized agents click "Reveal" to view real contact info.
2. Defense-in-Depth (No Bypass)
Never rely solely on browser JS. The same @privacyscrubber/sdk runs as a 1-line middleware on your Node.js or Next.js backend. If an adversary bypasses the form via cURL, the backend enforces sanitization.
3. Zero Client-Side Secret Leaks
The browser package requires zero private API keys on the frontend. Production quotas and commercial validation are handled at your private backend API gateway ($299/mo Developer SDK license).
Enterprise Implementation Roadmap: 5 Sprints to Zero-Trust Compliance
Designed for engineering leads, DevSecOps architects, and CISOs deploying generative AI across regulated workflows. A deterministic 5-stage sprint structure that eliminates vendor subprocessor friction, satisfies statutory compliance mandates, and ensures sub-millisecond execution.
Problem Solved: Prevents accidental leaks of customer names, email addresses, phone numbers, and employee credentials into ChatGPT, Claude, or internal copilot prompts.
Implementation: Drop wrapOpenAI() into backend API gateways or deploy @privacyscrubber/sdk/browser into Next.js App Router client components. Inbound prompts are tokenized before cloud transit; incoming assistant replies are restored deterministically in RAM.
Problem Solved: Eliminates irreversible vector poisoning. Embedding raw customer PII bakes personal data permanently into high-dimensional vector graphs, making individual deletion mathematically impossible without expensive full re-indexing.
Implementation: Embed sanitizeObject() into document chunking pipelines before feeding embedding models (Pinecone, Qdrant, Chroma). Store tokenMap in local customer-controlled KMS. Right-to-be-forgotten deletion triggers in O(1) constant time with $0 re-indexing cost.
Problem Solved: Protects tabular financial balance sheets, CSV rosters, and Zendesk/Jira support dumps from exposing credit card PANs, IBANs, and employee salaries to cloud analytics.
Implementation: Run chunked async stream transforms across 30 specialized industry profiles. Structural boundaries (commas, newlines, markdown table cells) remain 100% intact, enabling downstream LLM SQL generators and data analysts to operate without data corruption.
Problem Solved: Prevents visual leaks in document image processing. Uploading scanned identity cards, passports, and medical forms to multimodal models (GPT-4o Vision, Claude 3.5 Sonnet) bypasses standard text-only DLP filters.
Implementation: Pre-extract text using local Tesseract WASM; scrub national identifiers (Teudat Zehut, NHS, SIN, TFN) using mathematical checksum validation (Luhn, Mod97, Mod11); forward only sanitized bounding box tokens to vision reasoning engines.
Problem Solved: Eliminates developer credential drift, uncommitted secrets in Git, and provides verifiable compliance proofs for enterprise security audits without third-party vendor subprocessors.
Implementation: Deploy ps-guard in pre-commit hooks to block raw secrets. Use formatAuditReceipt() to export cryptographic receipts mapping every masked entity to statutory regulations with zero telemetry phone-home calls.
The 4 Strategic Pillars of In-Process Consumer Privacy
Modern SaaS engineering and AI applications bear strict legal and fiduciary responsibility for end-user data under GDPR, CCPA/CPRA, and global privacy statutes. Routing raw customer records through cloud DLP proxies only transfers liability to another third party while introducing latency and fragile network dependencies. The PrivacyScrubber Developer SDK operates as an autonomous consumer data fiduciary directly inside your runtime boundary:
Active Consumer Privacy Defense
Systematically enforces privacy rights on behalf of end-users at the application boundary. Sensitive identifiers are protected by default without relying on end-user configuration or manual user opt-ins.
Pre-Emptive Interception
Intercepts and quashes customer PII and infrastructure secrets before ingestion into vector databases, logging pipelines, or LLM inference engines—preventing irreversible compliance debt at the perimeter.
Zero Data Loss
Reversible, syntax-preserving deterministic tokens ([NAME_1], [FINANCIAL_1]) preserve 100% LLM reasoning fidelity. Real values are restored exclusively in local RAM with zero loss of downstream analytical utility.
Zero Third Parties
100% in-process execution inside your Node.js or browser memory. Completely eliminates third-party cloud DLP proxies (Skyflow, Lakera, AWS Comprehend, Nightfall), extra vendor DPAs, network hops, and egress fees.
Zero-Trust SDK Architecture: In-Memory Lifecycle
<0.4ms In-Memory ExecutionThe SDK intercepts raw payloads at your application boundary, tokenizes all PII and infrastructure secrets in volatile RAM, and forwards safe tokens to external LLMs or vector databases. Responses are deterministically restored before reaching the user.
Empirical Performance Benchmarks
Node.js 22 LTS • Apple M-SeriesArchitecture Comparison: In-Process SDK vs. Cloud DLP Proxies
Why modern engineering organizations choose in-process ZTDS execution over network-bound cloud middleware.
| Evaluation Factor | Legacy Cloud Proxy DLP (Skyflow, Nightfall) | PrivacyScrubber Developer SDK |
|---|---|---|
| Execution Location | External SaaS cloud proxy (Untrusted network hop) | 100% In-Process Node.js / Browser RAM (0 egress) |
| Per-Prompt Latency | +250ms to +1,200ms network round-trip | <0.4ms linear in-memory execution |
| GDPR Art. 17 Erasure | Requires full vector re-indexing ($14,200+ compute) | O(1) constant-time KMS session key purge ($0) |
| Subprocessor Liability | Adds vendor to compliance perimeter (6-8 wk review) | Zero Subprocessor: No third-party data processor formed |
| Commercial Pricing | $15–$45 / user / mo seat tax + volume egress | $299/mo flat for unlimited backend nodes & RAG lakes |
Calculate Your Monthly Savings & Latency Eliminated
Estimate savings from replacing cloud proxy DLP with local in-memory execution.
Production Integration Snippets: OpenAI, Anthropic, LangChain & LlamaIndex
Drop-in client wrappers and middleware interceptors. Sub-millisecond in-memory execution (<0.4ms) with zero third-party subprocessors.
// 1. Install zero-dependency SDK: npm i @privacyscrubber/sdk openai
import OpenAI from 'openai';
import { wrapOpenAI } from '@privacyscrubber/sdk';
// 2. Wrap client: In-process consumer data fiduciary (<0.4ms RAM execution)
// Flat $299/mo SDK license: Unlimited production microservices & 0 bytes cloud egress
const openai = wrapOpenAI(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }), {
profile: 'legal', // 30 industry profiles (dev, medical, finance, etc.)
detectSecrets: true, // Intercepts AWS keys, Bearer JWTs, and database URIs
licenseKey: process.env.PRIVACYSCRUBBER_KEY // Air-gapped Ed25519 (0 phone-home pings)
});
// 3. Standard OpenAI syntax: prompts are intercepted & tokenized in local memory before egress.
// Responses are automatically detokenized in RAM before returning to your caller.
const stream = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{
role: 'user',
content: 'Review contract for Johnathan Vance (SSN: 219-44-8891, email: jvance@acme.corp).'
}],
stream: true // StreamingDetokenizer buffers token boundaries across chunk fragments
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
} Ready for Immediate CISO & DPO Approval
Because the SDK executes 100% inside your local application runtime and transmits 0 bytes to PrivacyScrubber or third parties, no Data Processing Agreement (DPA) or Business Associate Agreement (BAA) with us is legally required. Review our pre-filled 40-Question Vendor Security Assessment (SIG Lite / CAIQ) and statutory DPA Subprocessor Exemption Certificate. Your security team can verify zero network sockets using Wireshark or DevTools in under 60 seconds.
Client-Side Reliability & Audit Verification
Powered by the Zero-Trust Sanitization Engine (ZTDS). All detection, tokenization, and regex evaluation execute 100% inside your local client process boundary — eliminating cloud proxies, intermediate servers, and third-party data retention risks.
The Hidden Liability of Cloud DLP Proxies & Vector Data Debt
SaaS providers and AI developers bear strict legal fiduciary liability for end-user data. Routing raw customer records through cloud DLP proxies (Skyflow, Nightfall, AWS Comprehend) merely introduces another untrusted subprocessor, adds 250ms+ network lag, and exposes unmasked PII in vector data lakes, creating irreversible GDPR Article 17 debt and regulatory exposure.
In-Process Zero-Trust Execution Pipeline
Install via npm
Add @privacyscrubber/sdk to your project using npm, yarn, or pnpm. Operates with zero runtime dependencies across Node.js 18+ and modern browser ESM contexts.
Wrap LLM or Sanitize Direct
Use wrapOpenAI(client) for 1-line transparent prompt sanitization, or call sanitize(text, { profile: 'dev' }) to strip PII and infrastructure secrets before vector DB ingestion.
Deterministic Restore & Audit Receipts
Re-hydrate tokens in AI responses with restore(response, tokenMap) and output signed Markdown/JSON CISO audit receipts mapped to GDPR, HIPAA, and SOC 2.
What Teams Achieve with Local PII Masking
Swipe to read verified reviews
Supported Formats & Limitations
Supported Formats
System Limitations
- Licensed for internal backend infrastructure, microservices, and RAG pipelines (OEM required for commercial SaaS embedding)
- License keys are non-transferable; store securely in environment secret managers (Vault, AWS Secrets Manager, Doppler)
- Emergency key revocation available via SHA-256 Key Revocation List (KRL) by contacting support
- Requires modern JavaScript engine (Node.js 18+, Bun, or modern ES2020+ browser runtime)
Step-by-Step Guide
How to use this feature
Install Package
Run 'npm install @privacyscrubber/sdk' in your terminal.
Import SDK
import { sanitize, restore, wrapOpenAI } from '@privacyscrubber/sdk';
Transparent OpenAI Wrapper
const openai = wrapOpenAI(new OpenAI(), { profile: 'legal' });
Call LLM Safely
const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: rawPrompt }] });
Frequently Asked Questions
Technical Details & Privacy Architecture
Can I embed the SDK directly into my website's HTML contact or support form?
What environments and runtimes does @privacyscrubber/sdk support?
How does the 1-line wrapOpenAI helper work?
How does the SDK protect Vector Databases (Pinecone, Chroma, Qdrant, Milvus, pgvector)?
How does the SDK handle multi-turn AI agents and state consistency?
Does the SDK detect infrastructure secrets and DevOps tokens?
What compliance frameworks and audit telemetry are generated?
Does the SDK require an outbound internet connection to validate licenses?
How does the SDK compare to MS Presidio and Google Cloud DLP?
Is the SDK fully typed with TypeScript?
How does pricing and quota management work for the Developer SDK, and is it free to try?
Git Pre-Commit Leak Shield & 7-Day Evaluation Trial
Block leaked cloud credentials, API keys, database connection strings, and consumer PII before git commits leave developer workstations. Plus instant offline cryptographic evaluation trials.
Install the zero-dependency hook into .git/hooks/pre-commit. Scans staged diffs in <5ms and aborts commits if unmasked secrets are detected:
npx ps-git-guard uninstall Zero ConfigEvaluating in enterprise staging, ETL test environments, or PoC benchmarks? Generate a standalone cryptographic evaluation trial key directly from your terminal:
Deploy Zero-Trust PII Sanitization in Under 30 Seconds
Free with built-in quota for local dev & prototyping. Zero credit card. Zero account sign-up. Commercial license covers unlimited internal production nodes and RAG lakes.
npm i @privacyscrubber/sdkUnlock your features
Your features are unlocked.
PrivacyScrubber PRO
Zero Accounts · Offline Cryptographic Key · Local RAM
- In-Page Chrome Shield — Hotkey Alt+Shift+X inside ChatGPT, Claude & Gemini
- IDE MCP Server (stdio) — Air-gapped secret & PII stripping for Cursor & Claude Code
- Offline PDF OCR & Bulk Files — Scanned records & 50+ batch documents in RAM
- 30 Profiles & PDF Receipts — HIPAA, Legal, Banking & SHA-256 compliance proofs
Trusted by teams at
Law firms · Hospitals · DevOps teams · AI researchers
PrivacyScrubber PRO
Card Gateway Temporarily Unavailable
We have switched to PayPal, where you can pay securely using any Debit or Credit Card without creating an account.
Evaluating for your organization?
Start an instant 7-day corporate pilot with unlimited seats across your company domain. Zero credit card required.
Instant Key On Screen • Pay with PayPal or Any Debit/Credit Card
$110 Lifetime • Zero Recurring Debt • Instant Key on Screen
Unlimited Company Seats • $99/mo Flat • Instant Team Blueprint
Unlimited Backend Nodes • <1ms Local RAM • Instant SDK Token
Official Invoice has been saved to your downloads and dispatched to .
Payment gateways blocked by browser privacy shield or ad-blocker. Request an instant corporate invoice (Net 30, SWIFT/ACH, or direct card checkout link).
Zero-Server · Zero-Trust · 100% Local
Turn off your Wi-Fi right now and try pasting text into the tool below. It processes 100% in your local RAM without sending any network requests.
CISO Compliance Receipt
Verified PROCryptographic proof of zero-server local RAM data sanitization
