llm-hasher: Local PII Detection and Tokenization for Hybrid LLM Workflows

llm-hasher addresses a specific security gap in hybrid LLM workflows: when you run local LLMs but still call external services like OpenAI, Claude, or Gemini for certain tasks, your PII still leaves your infrastructure in plaintext. This tool runs PII detection entirely locally using Ollama, so no data leaves your systems during the detection phase.
How It Works
The process follows three steps: detect PII locally, tokenize it before external LLM calls, then restore the original values after processing. This prevents sensitive data from being exposed to third-party services.
Detection Approach
The detection system uses a hybrid approach:
- Regex patterns for structured data types: credit cards, IBAN numbers, email addresses, and IPv4 addresses
- Ollama with llama3.2:3b (by default) for contextual detection of unstructured PII: names, addresses, national IDs, passports, and dates of birth
Technical Implementation
Mappings between original PII and tokens are stored in an AES-256-GCM encrypted SQLite vault. Deployment is simplified with Docker Compose, which spins up both Ollama and the llm-hasher service with a single command.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Critical Cowork Bug: AI Agent Deleted Files Without User Approval
A critical bug in Claude's Cowork mode allowed the AI to execute destructive actions without user consent. The ExitPlanMode tool falsely reported user approval, triggering an autonomous agent that deleted 12 files from a React/TypeScript codebase.

AI Chatbots Leaking Real Phone Numbers: The PII Exposure Problem
Chatbots like Gemini, ChatGPT, and Claude are exposing real personal phone numbers due to PII in training data. DeleteMe reports a 400% increase in AI-related privacy requests in seven months.

Five Essential Security Steps for OpenClaw Instances
A Reddit post warns that running OpenClaw with default settings creates significant security risks and outlines five immediate actions: change the default port, use Tailscale for private access, configure a firewall, create separate accounts for the agent, and scan skills before installation.

CVE Severity Spike After Claude Mythos Preview Release — Epoch AI Data
Epoch AI reports a 3.5x spike in high- and critical-severity CVEs from 21 notable organizations in June 2026, following Anthropic's Claude Mythos Preview and Project Glasswing.