Microsoft Presidio is an open-source framework that detects and anonymizes personally identifiable information (PII) in text, images and structured data. It began at Microsoft, is now community-governed under Data Privacy Stack, and runs as a Python library or a self-hosted REST service, so detection stays inside your own infrastructure.
AI guardrails now screen agent tool calls as well as prompts, so a PII guardrail has to reach Model Context Protocol traffic. One change catches teams following older Microsoft Presidio guides: the repository, documentation and container images have left Microsoft's namespaces, while the MIT license and APIs stayed the same.
Bifrost, the open-source AI gateway, sits on that path: Bifrost Enterprise calls a self-hosted Presidio Analyzer on model traffic and MCP tool calls, then detects, blocks or redacts what it finds.
How does Microsoft Presidio work?
Microsoft Presidio works in two steps: the Analyzer finds PII and scores each finding, then the Anonymizer rewrites the text with the operator you choose. The two run as separate services, so a gateway can use Presidio for detection alone and apply its own redaction. The project has four components.

Figure 1: The threshold sits between detection and rewriting, so a finding it drops is never redacted.
| Component | Job | Input | Runs as |
|---|---|---|---|
| Presidio Analyzer | Detects and scores PII | Text | Python package or REST service |
| Presidio Anonymizer | Rewrites detected spans | Text plus Analyzer results | Python package or REST service |
| Presidio Image Redactor | Finds PII through OCR and redacts it | Images | Python package or REST service |
| Presidio Structured | Finds PII in tabular and semi-structured data | Datasets | Python package |
Presidio Analyzer
The Presidio Analyzer runs recognizers over text. A recognizer detects one or more entity types through regular expressions, named entity recognition (NER), checksums or custom logic, and context words near a match raise its score. The default NLP engine is spaCy with the en_core_web_lg model.
POST /analyze returns entity_type, start, end and score for each finding. The supported entities list is long, but it is a catalog: the default English configuration of version 2.2.366 loaded 20 entity types when we tested it.
Presidio Anonymizer
The Presidio Anonymizer applies an operator to each span: replace (the default), redact, hash, mask, encrypt, custom or keep. Only encrypt is reversible with a built-in operator, decrypt. Since version 2.2.361, hash draws a random salt per entity, so one value hashes differently on each call unless you supply a salt.
Who maintains Microsoft Presidio now?
Microsoft Presidio is now maintained by Data Privacy Stack, an independent community organization, and a Technical Steering Committee oversees governance. Microsoft supported the move, which reached release 2.2.363 in June 2026. The Presidio FAQ says the project is "not an official product of any company and comes with no warranty or SLA."
| Item | Older references | Current |
|---|---|---|
| Repository | microsoft/presidio (redirects) | data-privacy-stack/presidio |
| Documentation | microsoft.github.io/presidio (redirects) | presidio.dataprivacystack.org |
| Container images | mcr.microsoft.com/presidio-* | ghcr.io/data-privacy-stack/presidio-* |
| PyPI packages | presidio-analyzer, presidio-anonymizer | Unchanged |
| License | MIT | MIT |
Microsoft Container Registry images stay available for older tags but receive no updates, so a deployment pinned to them misses fixes such as the image hardening in 2.2.366.
How do Presidio confidence scores affect PII detection?
Presidio confidence scores decide whether a finding survives, and several common identifiers score below 0.5 without context. Presidio's own default threshold is 0, which keeps everything. At 0.5, any match without strong evidence is removed, even real PII.
We ran Presidio 2.2.366 with en_core_web_lg on synthetic values and compared each score against 0.5, the Bifrost default:
| Input | Entity | Score | At 0.5 |
|---|---|---|---|
| Email address | EMAIL_ADDRESS | 1.0 | Kept |
| Test card number | CREDIT_CARD | 1.0 | Kept |
| Full name in a sentence | PERSON | 0.85 | Kept |
| Phone number beside "phone" | PHONE_NUMBER | 0.75 | Kept |
| IPv4 address | IP_ADDRESS | 0.6 | Kept |
| Dashed SSN, no context word | US_SSN | 0.5 | Kept |
| Phone number with no other text | PHONE_NUMBER | 0.4 | Dropped |
| Passport number beside "passport" | US_PASSPORT | 0.4 | Dropped |
| License number, no context word | US_DRIVER_LICENSE | 0.3 | Dropped |
| Nine-digit SSN, no dashes | US_SSN | 0.05 | Dropped |
| OpenAI-style and AWS keys | None | None | Not detected |
The phone result follows from the recognizer: it starts at 0.4, and a context word adds 0.35. Lowering the threshold recovers them and adds noise: at 0.05 one nine-digit number matched US_BANK_NUMBER, US_PASSPORT and US_SSN together. Without an entity filter, the word "US" also came back as LOCATION at 0.85, so name the entities you want before tuning the threshold.
How does Presidio handle PII in MCP tool calls?
Presidio handles no MCP traffic by itself, because the Analyzer has no protocol logic and only scores the text it receives. An MCP client, proxy or gateway has to extract tool arguments and tool results, send them to the Analyzer, and act on the findings before the call continues.

Figure 2: Each direction needs its own check, because arguments leave your boundary and results enter the model context.
MCP tools move PII in both directions. The MCP specification (revision 2026-07-28) tells clients to show tool inputs to the user to avoid "malicious or accidental data exfiltration" and to validate tool results before passing them to a model. A result can also carry the same record twice, in content text and in structuredContent, so coverage has to reach both fields. Base64 image and audio content stays outside the Analyzer.
Text shape changes NER results. Across six synthetic full names, PERSON matched 6 of 6 in prose and spaced JSON, 5 of 6 in CSV, and 0 of 6 in compact JSON with no spaces after separators. Emails, which rely on patterns, matched in our prose, JSON, SQL and shell samples.
Spans can also overshoot, which is an MCP security concern as well as a data one. In a SQL argument the PERSON match included the closing quote, and in CSV it absorbed the preceding ID, so redacting that span changes the statement.
PII detection: Presidio vs regex and managed services
PII detection tools follow three designs: regex patterns, a self-hosted framework such as Presidio, and managed cloud services. Regex is fast and predictable, Presidio adds NER and custom recognizers under your control, and managed services such as Azure AI Language "often have better entity coverage or accuracy," as the Presidio FAQ says.
| Dimension | Regex patterns | Presidio | Managed PII services |
|---|---|---|---|
| Names and locations | No | Yes, through NER | Yes |
| Custom entities | New pattern | Custom recognizer | Limited customization |
| Where text goes | Stays in process | Your Analyzer | The provider's API |
| Added latency | Lowest | Analyzer round trip | Provider round trip |
| Support | Your team | Community, no SLA | The vendor |
These designs combine well, and gateway guardrails can chain them on one rule.
Platform guardrails cover other layers: AWS Bedrock Guardrails filter sensitive information at the model boundary, Google Model Armor runs Sensitive Data Protection inspection, and CrowdStrike AIDR applies a central security policy.
Where Presidio deployments fail
Presidio deployments usually fail when a team treats detection as complete. The project states that "there is no guarantee that Presidio will find all sensitive information." A 2026 evaluation by Zafar and Nowaczyk measured overall recall of 0.893 on 100 clean examples and 0.780 on 560 messy ones, with LOCATION recall falling from 0.725 to 0.457.
- Languages. The default configuration covers English. A request for another language returns HTTP 500 from the default Analyzer service, and Spanish text sent as
enlost its phone number in our test. - Secrets. The default recognizers do not cover API keys, so credentials need a separate scanner.
- Open endpoints. The FAQ says Presidio endpoints "do not include built-in authentication by design," so the Analyzer belongs behind a gateway or reverse proxy on a private network.
- Non-text payloads. The Analyzer reads text only, so images need the Image Redactor.
- Domain identifiers. A medical record number scored 0.05 under the wrong entity types in our test, so internal IDs need custom recognizers.
How to roll out Presidio for PII redaction
A Presidio rollout for PII redaction starts with a private Analyzer, then moves from observation to enforcement once findings are understood. Thresholds mean little until you have seen real payloads. Self-hosted deployment keeps detection inside your network for each step.
- Deploy the current image. Pull from
ghcr.io/data-privacy-stackand keep the service private. - Name your entities. Replace the full catalog with the types your data contains.
- Add custom recognizers. Load them through
RECOGNIZER_REGISTRY_CONF_FILEfor IDs Presidio cannot know. - Observe first. Log findings without changing traffic, and review misses as well as false positives.
- Test real payloads. Sample actual prompts, JSON arguments, SQL and shell commands, since text shape changes results.
- Set the threshold from that data.
- Decide the outage behavior. Agree what happens when the Analyzer times out, and add a local control if PII must never pass.
Microsoft Presidio with Bifrost
Bifrost, the open-source AI gateway built by Maxim AI, runs Microsoft Presidio as a guardrail provider in Bifrost Enterprise. Bifrost sends selected text to your Analyzer's /analyze endpoint, receives scored spans, and applies the action itself, so the Presidio Anonymizer stays out of the path.

Figure 3: Detection stays on your own Analyzer, and Bifrost applies one action to model and tool traffic.
A profile sets the Analyzer and the action. The threshold below keeps a 0.4 phone match that the default 0.5 drops:
{
"name": "presidio-pii-redaction",
"enabled": true,
"config": {
"analyzer_url": "https://presidio.company.com",
"api_key": "env.PRESIDIO_API_KEY",
"language": "en",
"score_threshold": 0.4,
"entities": ["EMAIL_ADDRESS", "PHONE_NUMBER", "PERSON"],
"action": "redact",
"redaction_strategy": "replace",
"redaction_mode": "runtime_reversible"
}
}
Guardrail rules link the profile through a Common Expression Language (CEL) condition. An mcp rule checks tool arguments before execution and text results after. An llm rule covers prompts, responses and model-generated tool-call arguments. Redaction modes decide who sees what:
| Mode | Model and caller see | Bifrost logs and trace exports | Reveal |
|---|---|---|---|
runtime | replace, mask or hash output | The same redacted text | No |
logs_only | Raw text | Numbered placeholders | Bifrost logs only |
runtime_reversible | Numbered placeholders such as [EMAIL-1] | Numbered placeholders | Bifrost logs only, with Logs:Reveal |
- Defaults.
actiondefaults todetect_only, so nothing is enforced until you setblockorredact. - Failure. An Analyzer error or timeout fails open, and Custom Regex can run first as a local check.
- Credentials. Pair the profile with Secrets Detection.
- Tool commands. Runtime redaction can change what a command does, and Bifrost does not repair it, so
logs_onlysuits shell and query tools. - Streaming. Runtime redaction releases text in checked segments, and a rule that can block holds the full stream.
- Latency. Bifrost adds about 11 microseconds at 5,000 RPS. The Analyzer took about 18 ms on a 410-character text in our in-process test, before any network time.
With AI Gateway + Bifrost Edge, the same profiles cover AI apps on employee machines. To review PII enforcement on your traffic, book a demo; the base gateway starts with the gateway quickstart.
Frequently asked questions
Is Microsoft Presidio free and open source?
Yes. Microsoft Presidio is open source under the MIT license, and the transition to Data Privacy Stack did not change that. There is no fee to use it, but you run the service yourself, and the project offers no warranty or SLA. Your costs are the infrastructure for the Analyzer and the engineering time to tune recognizers.
Does Presidio send data to Microsoft?
No. Presidio is a library or self-hosted service, so analysis runs on infrastructure you control, and the default spaCy model runs locally. Text leaves that boundary only if you add a recognizer that calls an external service, such as a cloud PII API. The surrounding system still matters: a gateway must act on the findings before text reaches a model provider.
Can Presidio detect API keys and secrets?
Not with its default recognizers. In our test of version 2.2.366, an OpenAI-style key and an AWS access key returned no findings. A custom pattern recognizer can add specific formats, but a dedicated scanner is the better fit. In Bifrost, Secrets Detection runs in process and can sit on the same guardrail rule as a Presidio profile.
Can Presidio redact PII in MCP tool calls?
Yes, when something on the path sends it the text. Presidio has no MCP logic of its own. A Bifrost rule with the mcp target checks tool arguments before the tool runs and text results after it returns, then blocks or redacts according to the profile. Test with real payloads first, because data format and span boundaries affect what gets rewritten.
Does Presidio support languages other than English?
Yes, with configuration. The default setup includes English recognizers and models only. Each added language needs an NLP model and recognizers with context words in that language. A Bifrost Presidio profile sends one language value, so traffic in several languages needs an Analyzer configured for each language and a profile for each.
What happens if the Presidio Analyzer is down?
Bifrost fails open. A timeout or provider error is reported, the next linked profile runs, and traffic continues if nothing else blocks it, so raw PII could reach a provider during an outage. Teams that cannot accept that run a Custom Regex profile first and monitor Analyzer health through its /health endpoint.
- pii redaction
- ai guardrails
- llm guardrails



