Skip to main content

FastPII

Protect sensitive information before it reaches AI.

FastPII is an open-source privacy engine that detects, validates, and transforms PII. Deterministic, local, and fast.

PyPI Python License Docs

Documentation · PyPI · Discussions · Contributing


Install

pip install fastpii

Quick Start

from fastpii import FastPII, DEFAULT_PRIORITY
from fastpii.countries.cz import CzechPack

engine = FastPII(priority=DEFAULT_PRIORITY)
engine.register(CzechPack())

result = engine.detect("Jan Novák, RČ: 800101/1238, IČO: 25596641")
for f in result.findings:
    print(f"{f.type}: {f.value} ({f.confidence:.0%})")

CLI:

fastpii detect "Jan Novák, RČ: 800101/1238" -r cz

Why FastPII

  • Built for AI designed for LLM prompts, RAG pipelines, and AI agents
  • Deterministic no LLM calls, no cloud dependency, <1ms per detection
  • Country-aware checksum validation for official identifiers (Rodné číslo, PESEL, Steuer-ID, SIREN)
  • Self-hosted zero external dependencies, runs locally
  • Open Source Apache 2.0, fully auditable

Features

  • Detect find PII in text with context-aware detection
  • Validate verify identifiers with checksum algorithms
  • Anonymize replace PII with [REDACTED]
  • Redact replace PII with type labels like [EMAIL]
  • Mask replace PII with asterisks
  • Remove delete PII entirely
  • FastAPI drop-in REST API
  • LangChain anonymizer and filter for LLM chains
  • MCP Model Context Protocol for AI agents
  • CLI command-line detection and validation

Country Support

Production

🇨🇿 Czech Republic 15 detectors with checksum validation

Beta

🇵🇱 Poland PESEL, NIP, REGON, phone, postal code, address

🇩🇪 Germany Steuer-ID, USt-IdNr, Handelsregister, phone, postal code, address

🇫🇷 France SIREN, SIRET, INSEE/NIR, phone, postal code, address

Country documentation →


Integrations

from fastpii.integrations.fastapi import create_app
from fastpii.integrations.langchain import PIIAnonymizer
from fastpii.integrations.mcp import MCPServer

Architecture

Your Application
       ↓
    FastPII
       ↓
   Your AI

You configure. It executes. Explicit registration, no hidden defaults.


Documentation


Ecosystem

  • FastPII Core this repository, Apache 2.0
  • Country Intelligence Packs extended data and detection for more countries
  • FastPII Secure Chat hosted privacy-first AI chat
  • FastPII Enterprise governance, audit trails, compliance

https://fastpii.com


Community

Contributing

Contributions welcome. Country packs, validators, benchmarks, and documentation.

See CONTRIBUTING.md for setup and guidelines.

License

Apache 2.0. See LICENSE.


Privacy should be a default, not an afterthought.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastpii-0.5.0.tar.gz (375.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastpii-0.5.0-py3-none-any.whl (378.9 kB view details)

Uploaded Python 3

File details

Details for the file fastpii-0.5.0.tar.gz.

File metadata

  • Download URL: fastpii-0.5.0.tar.gz
  • Upload date:
  • Size: 375.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for fastpii-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ffc7b0dbbe806a189f9a2ab16ebf0df6bf39d7c7660a3c285b9ce7daed1048a1
MD5 4bb5919ecad55a0565aa2f6b8a1f1075
BLAKE2b-256 ccc2afe189b83b6a79182e14658c51fc52405511bb94fe6afd412a91f9b889cf

See more details on using hashes here.

File details

Details for the file fastpii-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: fastpii-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 378.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for fastpii-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b19447968186591dbba4cc746c9713d0ce52e3789d4e0f41d39291bfacfd37d3
MD5 718b0b37b05d5313dcaad6fa8b93b6e2
BLAKE2b-256 b1f14d3694d0920d9b700c16e61409be94db85f75143fa062047fc1c218aecd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page