VVektorIndex
🔒NewENTERPRISE BLOCKER REMOVED

Zero-Trust Edge PII Masking Middleware

Your legal team blocked OpenAI access because of PII leaks. This unblocks them — legally.

Next.jsTypeScriptVercel EdgeNode.js

The Problem

Enterprise legal and compliance teams are blocking developers from using OpenAI or Claude because employees accidentally paste sensitive customer data (emails, credit cards, NHS numbers, financial records) into prompts. The data leaves the company network unencrypted.

The Solution

A lightweight TypeScript middleware wrapper. It intercepts the prompt at the Edge before it leaves your network, uses optimized local regex + lightweight NER to identify and hash all sensitive data, sends the clean prompt to the AI API, and decodes hashes back into real values only inside the secure browser context.

Why You Have No Choice

Allows corporate developers to use public AI models without violating company data privacy policies, GDPR, POPIA, or HIPAA. The only alternative is building an on-premise LLM — which costs $500,000+.

Code Preview

This is what you'll drop into your codebase. The full package includes all configuration options and integrations.

// pii-masker.edge.ts — intercept before prompt leaves network
import { maskPII, unmaskPII } from './pii-masker.edge'

// In your Next.js API route:
export async function POST(req: Request) {
  const { prompt } = await req.json()
  
  // Mask PII before sending to OpenAI
  const { cleanPrompt, vault } = await maskPII(prompt)
  
  const response = await openai.chat.completions.create({
    messages: [{ role: 'user', content: cleanPrompt }]
  })
  
  // Restore real values only for the user's browser
  const safeResponse = unmaskPII(response.choices[0].message.content, vault)
  return Response.json({ content: safeResponse })
}

What's in the Package

TypeScript Edge middleware + client-side decoder. Works in Next.js API routes, Vercel Edge Functions, or standalone Node.js.

📄pii-masker.edge.ts
📄pii-decoder.client.ts
📄patterns/financial.ts
📄patterns/healthcare.ts
📄patterns/general.ts
📄README.md
📄LICENSE

Compliance Law This Addresses

🇪🇺
GDPR Article 22 — Automated Decision-Making
ACTIVE ENFORCEMENT — reinforced by EU AI Act 2026
Max fine: €20 million or 4% of global annual turnover

Errors This Package Fixes

One-time payment
$79
lifetime access, no subscription
Setup in 30 minutes
7 files included
Runs on your infrastructure
Your data never leaves your stack
Instant download via Lemon Squeezy
Get Package — $79

Instant download after payment. Secure checkout via Lemon Squeezy.

Cost vs. Benefit
Without
On-premise LLM to avoid PII leaks: $500,000+ setup cost
With this
Unblocks AI access for your entire development team — legally and securely.
Works For
GlobalEuropean UnionUnited KingdomUnited StatesSouth AfricaAustralia

⚖️ Developer Tool — Important Notice

VektorIndex developer tools are technical software packages provided to assist developers in implementing compliance-relevant technical controls. They do not constitute legal advice, legal services, or a guarantee of regulatory compliance. Each tool solves a specific technical problem — whether a tool satisfies your specific legal obligations depends on your use case, jurisdiction, and how the tool is configured and deployed. You must engage qualified legal counsel to confirm your compliance posture. VektorIndex does not represent that use of any tool will make your product compliant with any specific law or regulation.

Prices in USD. Billed monthly. Annual plans available at 20% discount. Taxes may apply depending on your jurisdiction. VektorIndex is a digital goods merchant — you are purchasing a software license, not a physical product. Subscription management: Lemon Squeezy customer portal.

Related Tools