Home

/

Keep PII Out of Your LLM

/

Tooling at a Glance

Tooling at a Glance

Appendix B
Appendix
3
min read

Detection accuracy, cross-domain

From an independent benchmark across four datasets in two languages, six shared entity types, June 2026.

DetectorAvg F1Best datasetWorst datasetDegradationMedian latency (CPU)
Piiranha (86M DeBERTa-v3)0.5420.7800.169−78%118.5 ms
GLiNER v1 (209M)0.5350.6070.4550%161.3 ms
Presidio0.4810.7800.298−17%15.1 ms
GLiNER v2 (205M)0.4780.5580.373−20%197.7 ms
Regex only0.1710.2970.000n/a0.1 ms

A paired t-test found no statistically significant difference between the top three (p well above 0.10). Do not choose by decimal places.

From PIIBench, 82 entity types across ten source datasets, May 2026: a directly fine-tuned DeBERTa reached F1 0.6476; the strongest previously published comparator on that benchmark reached 0.1723.

Per-entity spread

Aggregate F1 hides this, which is why Chapter 7 insists on per-entity scoring.

EntityBest observedWorst observedComment
Email0.9960.553Pattern-friendly; Presidio strongest
Phone0.8740.606GLiNER v1 most consistent
Person name0.7870.139The hardest category by a distance
IBAN, cardHigh with validationLow withoutAppendix A applies

Choosing a route from .NET

Presidio sidecarAzure AI LanguageNative C# rules
.NET accessREST via HttpClientOfficial SDK (Azure.AI.TextAnalytics)In-process
Text crosses your perimeterNoYesNo
Entity coverageBroad, extensibleBroad, fixedChecksummed identifiers only
Custom recognisersYesNoYes
Reversible pipelineBuilt inRedaction policiesBuild it yourself
Latency~15 ms plus local hopNetwork round trip~0.1 ms
You operateA containerA subscriptionNothing
Failure modeContainer downAPI error, quotaNone

Presidio, in detail

Components: Analyzer (detection), Anonymizer (de-identification operators), Image Redactor (OCR), Structured (tabular and semi-structured data).

Detection method: spaCy or HuggingFace NER, plus regex recognisers, checksum validation, and contextual scoring.

Deployment: Python packages, Docker images, Kubernetes, direct Python and PySpark integration, Azure App Service, Databricks, Spark.

Governance, as of September 2026: no longer a Microsoft project. Transitioning to community ownership under the Data Privacy Stack organisation. Documentation at presidio.dataprivacystack.org; the old Microsoft URL redirects twice. Much published material still calls it "Microsoft Presidio" and links to the retired address.

.NET client: none official. REST is the route.

Unofficial client: Presidio.SDK by StefH. Version 0.0.2, June 2025, ~5.6K downloads, 14 commits, targets .NET 6.0 and .NET Standard 2.1. Analyzer demonstrated, anonymizer not evidenced. Companion Presidio.SDK.Extensions adds a handful of locale-specific pattern recognisers (~970 downloads). Useful to know about, too thin to build on.

Known issue: 64% reversibility pass rate in the benchmark, from character offset misalignment. Fixable in post-processing, and a reason to assert the round-trip invariant (Chapter 9).

the-leak-you-cant-see
blast-radius
what-counts-as-pii
the-five-doors
the-accuracy-reckoning
the-hybrid-that-does-not-work
deterministic-detection
npi-in-c
the-three-way-choice
calling-the-analyzer-from-c
measuring-your-own-demo-gap
choosing-the-operating-point
the-ladder-of-safeguards
pseudonymisation
the-round-trip
restoring-safely
when-masking-breaks-the-task
plausibility-hazard
the-architecture-that-holds
the-reference-architecture
dont-send-it-at-all
structure-beats-prose
the-gateway
failure-is-a-policy-decision
the-sidecar-you-can-trust
egress-deny-it-at-the-network
rag-and-agents
de-identify-before-you-embed
dual-model-separation
the-boring-controls
evidence-and-the-first-thirty-days
week-two-the-chokepoint-and-the-fast-layer
entity-catalogue-and-c-validators
mbi-positional-rules
tooling-at-a-glance
azure-ai-language-pii-in-detail
container-trust-checklist
sources
azure-ai-language
provider-retention

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.