Skip to content

About

Integration examples for Blindfold — protect PII in AI applications

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Blindfold Cookbook

Example code and guides for Blindfold — the privacy API that protects PII in AI applications.

Each example is a self-contained project you can clone and run. They show how to integrate Blindfold with popular LLM providers and frameworks.

Resources: Documentation | Python SDK | Node.js SDK | Java SDK | Go SDK | .NET SDK | CLI | MCP Server

Prerequisites

  1. Copy .env.example to .env in the example directory
  2. Add your OPENAI_API_KEY (required for LLM calls)
  3. Optionally add BLINDFOLD_API_KEY from app.blindfold.dev

Offline mode: All examples work without a BLINDFOLD_API_KEY. When omitted, PII detection runs locally using built-in regex patterns. NLP-only entities (Person, Organization) require an API key.

LLM Providers

Examples showing how to protect PII when calling LLM APIs.

Provider Description Python TypeScript Java Go .NET
OpenAI Tokenize user messages before GPT, detokenize responses openai-python openai-node openai-java openai-go openai-dotnet
Anthropic Claude Tokenize user messages before Claude, detokenize responses anthropic-python anthropic-node — — —
Google Gemini Tokenize user messages before Gemini, detokenize responses gemini-python gemini-node — — —
LangChain PII-safe chains with RunnableLambda langchain-python langchain-node — — —

Compliance

End-to-end examples for building regulation-compliant AI applications.

Regulation Description Region Python TypeScript
GDPR EU-compliant OpenAI integration with gdpr_eu policy, batch processing EU gdpr-openai-python gdpr-openai-node
HIPAA Healthcare chatbot protecting PHI with hipaa_us policy, multi-turn chat US hipaa-healthcare-chatbot hipaa-healthcare-chatbot-node

Framework Integrations

Middleware that automatically protects PII in web applications.

Framework Description Python TypeScript
Express.js Middleware that tokenizes request bodies, detokenizes responses — express-middleware
FastAPI Middleware that tokenizes request bodies, stores mapping on request.state fastapi-middleware —

AI Agents

Examples showing how to safely give AI agents access to sensitive data.

Platform Description Python TypeScript
E2B AI data analyst — OpenAI writes code from tokenized CSV, E2B executes on real data e2b-data-analyst e2b-data-analyst-node

RAG Pipelines

PII-safe Retrieval-Augmented Generation with two-layer protection: redact at ingestion, tokenize at query time.

Framework Description Python TypeScript
OpenAI + ChromaDB Plain OpenAI RAG with ingestion-time redaction and query-time tokenization rag-openai-python rag-openai-node
LangChain + FAISS BlindfoldPIITransformer for documents, blindfold_protect() for chains rag-langchain-python rag-langchain-node
LlamaIndex Custom BlindfoldNodePostprocessor tokenizes retrieved nodes before the LLM rag-llamaindex-python rag-llamaindex-node
GDPR Customer Support Multi-turn EU support chatbot with gdpr_eu policy, multilingual PII rag-customer-support-python rag-customer-support-node

How Blindfold works

User message                    Tokenized message               AI response
"Email [email protected]"  →  "Email <Email Address_1>"  →  "I'll email <Email Address_1>"
                                                              ↓
                                                         "I'll email [email protected]"
  1. Tokenize — PII is replaced with safe tokens before data leaves your system
  2. Process — The AI model only sees anonymized text
  3. Detokenize — Original values are restored in the response

Contributing

Contributions are welcome! If you have an integration example to share, open a pull request.

License

MIT

About

Integration examples for Blindfold — protect PII in AI applications

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors