TOOL WIKI · SECURITY & IDENTITY

Presidio

Helps detect and transform sensitive information in text and other data workflows.

Download example files Code + setup + checks in a ZIP
Jump to a section 10 sections

EXAMPLE USE CASE

Remove an email address before a trace is exported

An agent application needs independently enforced input, identity, data or action checks before exposing a protected capability.

Input
Synthetic text containing demo.person@example.com.
Expected output
Redacted text and detected entity spans.
  • Success check: The synthetic email is replaced before the text is logged or sent downstream.
  • Try a failure: Test punctuation and false positives; verify the original email is absent from exported text.

Example scope: Actual local analyzer/anonymizer operation; detection coverage depends on recognizers and language.

Official reference · Presidio

WHAT IT ISData-privacy toolkit
WHERE IT FITSSecurity & identity
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
inputprocessresultcheckoutputRequest or workloadVerified application inputPresidioData-privacy toolkitApplicationenforcementInterpret and enforceAllowed operationScoped service callAuthoritative outcomeSuccess or explicit errorAudit + reviewEvidence of the decision
  1. Identify the actor, operation, resource, and relevant evidence.

  2. Redacting sensitive content before logging, retrieval, or model calls. Test entity coverage and false positives on your actual document types.

  3. Consume the identity, policy result, credential, or detection from this component. Fail according to an explicit application policy.

  4. The business service still checks permission for the actual target resource.

  5. Record the result without leaking unnecessary credentials or sensitive content.

  6. Retain actor, policy version, operation identifier, and result with deliberate redaction.

    Result or stopping point
Presidio

Redacting sensitive content before logging, retrieval, or model calls. Test entity coverage and false positives on your actual document types.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

When to consider it

  • Redacting sensitive content before logging, retrieval, or model calls.

A design decision to make

  • Test entity coverage and false positives on your actual document types.

Prerequisites and setup

  • Use an isolated test environment and synthetic data. Keep provider keys and real secrets out of test fixtures.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install presidio-analyzer presidio-anonymizer
python -m spacy download en_core_web_lg

Try a small integration

redact.py

Python · redact.py
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine

text = "Contact demo.person@example.com about order A104."
findings = AnalyzerEngine().analyze(text=text, language="en", entities=["EMAIL_ADDRESS"])
redacted = AnonymizerEngine().anonymize(text=text, analyzer_results=findings)
assert "demo.person@example.com" not in redacted.text
print(redacted.text)
print("Detected spans:", len(findings))

Run and check the result

Shell
python redact.py
  • The synthetic email is replaced before the text is logged or sent downstream.
  • Test punctuation, multilingual text, false positives and nested/overlapping entities for your actual data.

Common failures

  • Do not continue a protected operation when the policy response is missing, invalid or unavailable.
  • A successful test on one fixture is not a complete security evaluation; include bypass attempts and legitimate requests.

Production decisions

  • Enforce decisions in application/service code before an operation. A detector score or valid schema is not user authorization.
  • Test allowed, denied, malformed, timeout and unavailable outcomes; record redacted decision reasons and default to a safe failure state.
  • Redact before trace export, not after storage. Choose entity types and replacement operators deliberately; do not describe pattern detection as complete anonymization.

Keep exploring

A human approval boundary for agent actionsA governed tool layer with MCP

Explore the same layer

Guardrails AINeMo GuardrailsLlama GuardLakera

Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.