Datafog Python — AI skill for Claude Code
Offline PII firewall for AI agents and LLM apps: fast local detection and redaction, Claude Code hook, LiteLLM guardrail.
How to install Datafog Python
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open DataFog/datafog-python and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Datafog Python does
Offline PII firewall for AI agents and LLM apps: fast local detection and redaction, Claude Code hook, LiteLLM guardrail. Zero network calls, one dependency.
Alternatives in AI
- Cc Mirror — Create multiple isolated Claude Code variants with custom providers (Z.ai, MiniMax, OpenRouter, LiteLLM) 2.1k ★
- DontFeedTheAI — Transparent anonymization proxy for AI-assisted pentesting 654 ★
- Semble Rs — Fast, AI-agent-native code search in Rust — hybrid BM25 + semantic, Tree-sitter AST chunking, dependency & imp 210 ★
README
# DataFog Python
DataFog is a Python library for detecting and redacting personally identifiable information (PII).
It provides:
- Fast structured PII detection via regex
- An offline PII firewall for AI agents: a Claude Code hook and a LiteLLM gateway guardrail (introduced in 4.6)
- Optional NER support via spaCy and GLiNER
- A simple agent-oriented API for LLM applications
- Backward-compatible
DataFogandTextServiceclasses
Agent & Gateway Firewall
DataFog includes two ready-made enforcement points that catch PII at the moment it would leave your machine — offline, in microseconds, with matched values never echoed into logs or transcripts:
**Claude Code hook** (`datafog-hook`): gates agent tool calls (shell commands, web requests, file writes, MCP tools) and warns the model when prompts or tool results carry PII. ~70–90ms per invocation including process startup. Easiest install is the [Claude Code plugin](https://github.com/DataFog/datafog-claude-plugin):
/plugin marketplace add DataFog/datafog-claude-plugin /plugin install datafog@datafogManual hook setup and limitations: [examples/claude_code_hook/](examples/claude_code_hook/).
**LiteLLM guardrail** (`DataFogGuardrail`): redacts or blocks PII in requests and responses at the gateway, for any LiteLLM-proxied provider. In-process (~40µs per message scanned; a request clears the guardrail in well under a millisecond), no sidecar service. Setup: [examples/litellm_guardrail/](examples/litellm_guardrail/).
Both default to the high-precision entity set (`EMAIL`, `PHONE`, `CREDIT_CARD`, `SSN`); noisier types are opt-in. Known-safe values can be exempted with an allowlist: `scan(text, allowlist=[...])` for exact values, `allowlist_patterns=[...]` for full-match regexes (e.g. `^\d{10}$` to stop unix timestamps matching as phone numbers) — available in both adapters and the API. Presidio-style entity names (`EMAIL_ADDRESS`, `PHONE_NUMBER`, `US_SSN`) are accepted
Related Skills
Pristine
PR Scope & Intent Guardrail for Fast-Moving Teams & AI Agents. A tiny, zero-dependency, read-only Rust CLI (<
Shush
Remove PII & secrets from any file before you paste it into ChatGPT or Claude — a 100% local PII redaction CLI
Token Trace Kit
Tap-to-token tracing for hybrid on-device + Claude AI features in Swift 6: W3C propagation, device-side tail s
AI Hook
Ultra-fast AI-agent hook dispatcher & autonomous rule engine (Rust + embedded QuickJS). Write guardrail rules
Soup Wall
Soup Wall: a local firewall for what an AI agent does - tool calls, tool results, MCP handshakes, subagents. D
Apohara Agentguard
Anti-bypass command-safety hook, local seccomp+Landlock sandbox, and deterministic prompt-injection firewall f
Related Agents
Verina Pdpa Counsel
Senior legal counsel (Singapore data protection) for Verina. Use to ensure every data flow complies with the P
Network Analyst
Deep network analysis agent — packet inspection, protocol dissection, traffic anomaly detection, IDS/IPS rule
Homelab Architect
Homelab network designer. Invoke when someone describes their hardware and goals and wants a complete network