FastPII Docs
Getting Started

Introduction

Technical overview of FastPII, its multi-region detection model, and current scope.

Introduction

FastPII is an AI Data Security Platform that detects and protects sensitive information before it reaches AI systems, enabling organisations to use AI securely while meeting privacy and governance requirements.

The platform provides two complementary tools:

  • Connect SDK (fastpii-connect) — the SaaS client for detection, protection, validation, and the AI Gateway. It sends requests to the FastPII cloud API where the Intelligence Engine handles country detection, overlap resolution, and checksum validation.
  • Explicit Engine (fastpii) — the open-source SDK for full control over overlap priority, confidence scoring, and detector registration. Run it locally when you need deterministic, auditable detection without network calls.

Generic detection systems are usually trained for broad international coverage and rely heavily on pattern matching. On European identifiers, that leads to poor performance: generic tools such as Presidio, AWS Macie, and Google DLP reach 22.7% on Czech identifier benchmarks, while FastPII exceeds 95% on the same problem class.

The difference is validation. FastPII does not stop at regex matches. It combines checksum validation and semantic rules to reject structurally invalid matches and reduce false positives.

What problem it solves

European identifiers such as rodné číslo, PESEL, Steuer-ID, and SIREN are not reliably handled by generic PII tooling. These identifiers use country-specific rules:

  • rodné číslo requires date parsing and checksum validation
  • PESEL uses a weighted Mod 10 checksum
  • Steuer-ID uses ISO 7064 MOD 11,10
  • SIREN/SIRET use Luhn checksums
  • INSEE/NIR uses Mod-97 with Corsica department handling

If detection is based on regex alone, invalid values can still be classified as PII, and valid values may be missed when formatting varies.

How FastPII works

FastPII combines:

  • regex pattern matching for candidate extraction
  • checksum validation such as Mod 11, Mod 10, Luhn, and ISO 7064
  • semantic rules for context-sensitive entities
  • overlap resolution to keep the strongest result when spans collide
  • configurable confidence scoring with context-aware boosting

This is why the SDK can distinguish between a string that looks like a national identifier and one that is actually valid.

Explicit Engine

The FastPII class gives you full control over overlap priority, confidence scoring, and detector registration. No implicit behavior, no hidden defaults.

from fastpii import FastPII, DEFAULT_PRIORITY, DEFAULT_CONFIDENCE_SCORES, DEFAULT_CONTEXT_BOOST
from fastpii.core.confidence import ConfidenceScorer
from fastpii.countries.cz import CzechPack
from fastpii.countries.pl import PolishPack

engine = FastPII(
    priority=DEFAULT_PRIORITY,
    confidence_scorer=ConfidenceScorer(
        base_scores=DEFAULT_CONFIDENCE_SCORES,
        context_boost=DEFAULT_CONTEXT_BOOST,
    ),
)
engine.register(CzechPack())
engine.register(PolishPack())

result = engine.detect("Jan Novák, RČ: 8001011238")

Current feature set

FastPII registers 33 detectors across 4 regions:

Czech Republic (CZ) - 15 detectors

  • rodne_cislo - Birth number (Mod 11 checksum, date/gender extraction)
  • ico - Company ID (weighted Mod 11)
  • dic - VAT number (multi-format)
  • bank_account - Bank account (two-part Mod 11)
  • credit_card - Credit card number (Luhn)
  • iban - IBAN (ISO 13616)
  • identity_card - Czech identity card
  • postal_code - Postal code (PSČ)
  • phone - Phone number
  • email - Email address
  • name - Personal name (Czech dictionary + gender)
  • address - Street address
  • date_of_birth - Date of birth
  • vehicle_plate - Vehicle plate
  • health_insurance - Health insurance code

Poland (PL) - 6 detectors

  • pesel - National ID (Mod 10 checksum, date/gender)
  • nip - Tax ID (weighted Mod 11)
  • regon - Business registry (weighted Mod 11, 9/14-digit)
  • postal_code - Postal code (DD-DDD)
  • phone - Phone number (+48)
  • address - Street address

Germany (DE) - 6 detectors

  • steuer_id - Tax ID (ISO 7064 MOD 11,10)
  • ust_id - VAT number (MOD 11,10)
  • handelsregister - Commercial register
  • postal_code - Postal code (PLZ)
  • phone - Phone number (+49)
  • address - Street address

France (FR) - 6 detectors

  • siren - Business ID (Luhn)
  • siret - Establishment ID (Luhn, embeds SIREN)
  • insee - National ID INSEE/NIR (Mod-97, Corsica 2A/2B)
  • postal_code - Postal code (code postal)
  • phone - Phone number (+33)
  • address - Street address

Core package characteristics:

  • zero core dependencies
  • Python package: fastpii
  • Connect SDK package: fastpii-connect (Python) and fastpii-connect (TypeScript/Node.js)
  • CLI included (requires --regions flag)
  • FastAPI integration available through optional extras
  • LangChain integration available through optional extras
  • MCP integration in the SDK source
  • AI Gateway for OpenAI-compatible chat completions with automatic PII protection

Multi-region support

All four regions are available immediately:

from fastpii import FastPII, DEFAULT_PRIORITY
from fastpii.countries.cz import CzechPack
from fastpii.countries.pl import PolishPack
from fastpii.countries.de import GermanPack
from fastpii.countries.fr import FrenchPack

engine = FastPII(priority=DEFAULT_PRIORITY)
engine.register_many([CzechPack(), PolishPack(), GermanPack(), FrenchPack()])
result = engine.detect("PESEL: 44051401458, Steuer-ID: 86095742719")

The SDK is extensible through the Country Pack SDK. New regions can be added by implementing CountryPack and registering with the engine.

Transformation modes

FastPII provides four transformation strategies through the TransformationEngine:

ModeMethodStrategyOutput
Anonymizeengine.anonymize(text)AnonymizeStrategy()[REDACTED]
Redactengine.redact(text)RedactStrategy()[EMAIL], [RODNE_CISLO]
Maskengine.mask(text)MaskStrategy()**********
Removeengine.remove(text)RemoveStrategy()(deletes PII)

You can also create custom strategies by implementing the TransformationStrategy protocol.

GDPR note on rodné číslo

Rodné číslo is not just an identifier. Its structure reveals date of birth, and for standard post-1954 forms it also reveals biological sex through the encoded month offset. That makes it sensitive in GDPR contexts, including Article 9 considerations where sex-related information can be inferred from the value itself.

Comparison

IdentifierFastPIIMicrosoft PresidioAWS MacieGoogle DLP
rodné čísloYes, Czech-specific detection with checksum and metadata extractionNo native Czech supportNo native Czech supportNo native Czech support
IČOYes, weighted checksum validationNo native Czech supportNo native Czech supportNo native Czech support
DIČYes, Czech format and validation rulesNo native Czech supportNo native Czech supportNo native Czech support
PESELYes, Mod 10 checksum with date/gender extractionNo supportNo supportNo support
Steuer-IDYes, ISO 7064 MOD 11,10 validationNo supportNo supportNo support
SIRENYes, Luhn checksum validationNo supportNo supportNo support

Use FastPII when you need deterministic handling of European identifiers instead of broad but low-accuracy generic PII coverage.

On this page