Use Cases by Industry
Real-world examples of adding 1–2 lines to existing apps.
💰 Finance & Banking
Scenario: Customer enters account number in an AI chat interface
// ✅ Just add fw.mask() — one line
const { masked } = fw.mask(userMessage);
const response = await openai.chat.completions.create({
messages: [{ role: "user", content: masked }]
});
const answer = fw.restoreAll(response.choices[0].message.content);Result: Account numbers, credit cards, and SSNs never reach AI logs. Strengthens CCPA / GDPR compliance.
⚖️ Legal & LegalTech
Scenario: Attorney asks AI to summarize a contract (MCP pattern)
server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { document_text } = request.params.arguments;
const { masked, detections } = fw.mask(document_text); // ← add this line
console.log(`PII masked: ${detections.length} items`);
const summary = await claude.messages.create({
messages: [{ role: "user", content: `Summarize this contract:\n${masked}` }]
});
return { content: [{ type: "text", text: fw.restoreAll(summary.content[0].text) }] };
});Result: Client PII never sent to external AI. Reduces attorney-client privilege risk.
🏥 Healthcare
Scenario: Patient consults AI about symptoms (name + date of birth included)
app.post("/ai-consultation", async (req, res) => {
const { message } = req.body;
const threats = fw.detectInjection(message);
if (threats.length > 0) return res.status(403).json({ error: "Invalid request" });
const { masked } = fw.mask(message);
const aiAnswer = await callMedicalAI(masked);
res.json({ answer: fw.restoreAll(aiAnswer) });
});Result: Name, DOB, phone never reach the AI vendor. Supports HIPAA compliance posture.
🏭 Manufacturing — Secure RAG for Internal Documents
Scenario: Engineers want to search design specs, customer contracts, and internal manuals using AI — but the documents contain personal data that cannot leave the premises.
const rag = require("@pii-firewall/rag");
// STEP 1: Ingest internal document (PII auto-tokenized)
const { chunks, detectionCount } = rag.ingest(internalDocument);
// → Emails, company names, phone numbers → [SRAG:cat=PII,...]
// → Technical specs (±0.01mm, temperatures) pass through untouched
// STEP 2: Store anonymized chunks in vector DB
await vectorDB.store(chunks);
// STEP 3: Query LLM — only anonymized text reaches the cloud
const answer = await llm.query(userQuestion, chunks);
// STEP 4: Restore PII tokens in the answer
const { restored } = rag.resolveContext(answer, { allowAll: true });
// → yamada@example.com / ABC Manufacturing / 03-1234-5678 restoredResult:
- Only anonymized text is sent to cloud LLM — no PII, no trade secrets
- Technical specs remain searchable
- Supports CCPA, GDPR, and internal security policy compliance
🏢 Enterprise — Zero-Effort PII Protection for All Employees (Claude MCP Deployment Pattern)
Scenario: A company wants to allow employees to use Claude MCP / RAG internally, while ensuring all AI usage is automatically PII-compliant — without requiring employees to think about it.
Pattern A: Developers — Enforce via CLAUDE.md
Place a CLAUDE.md in the company's Git repository root. Every developer who clones the repo automatically gets the policy applied.
# CLAUDE.md (place at repository root)
## Security Policy (Required)
- Always run `mask_pii` before sending any text to an AI
- Always run `detect_all_injections` on user input before passing to LLM
- Use `rag_ingest` / `rag_resolve` for all RAG pipelines
- Never paste API keys into chat (auto-detection and masking is active)IT administrators can deploy ~/.claude/CLAUDE.md (global config) via Intune / Jamf / MDM to all company PCs, enforcing the policy across every project and every developer automatically.
Pattern B: General Employees — Enforce via Claude Desktop Projects
In Claude for Teams / Enterprise, admins can set a system prompt in the Projects feature. One configuration applies to every employee's every conversation.
Claude Desktop → Projects → System Prompt (admin-configured)
[Example]
Before sending any text containing internal or customer information to AI,
always use the pii-firewall mask_pii tool to mask PII.
Also run detect_all_injections on any external input before processing.Deployment Flow
IT Admin → Deploy pii-firewall MCP server to all company PCs
→ Push claude_desktop_config.json to all company PCs
→ Add policy to CLAUDE.md or Projects system prompt
↓
Employees → PII protection and composite attack detection run automatically
No awareness required from employeesResult:
- Employees don't need to think about PII compliance — zero operational overhead
- Every employee's AI usage automatically conforms to privacy law and company policy
- No changes to existing Claude workflows required
Summary
| Before | After | |
|---|---|---|
| Lines of code added | — | 2–3 lines |
| Changes to existing code | — | Minimal |
| PII sent to AI | Yes | No |
| Privacy law risk | High | Low |
| CCPA / GDPR / HIPAA | Requires separate effort | Strengthened |