Microsoft Presidio × Sentiqra
Run PII detection and redaction in your own environment before submitting text to Sentiqra. This pattern can reduce the amount of identifiable information sent downstream while keeping redaction policy under your control.
Why This Integration Matters
Operational question this answers:
"How do we make sure customer PII doesn't leave our infrastructure?"
Every enterprise buyer with a GDPR compliance obligation asks the same question during vendor evaluation: "How do we make sure customer PII doesn't leave our infrastructure?" Without a documented PII-stripping layer, regulated industries - finance, healthcare, telecom - literally cannot deploy any text-processing API.
Microsoft Presidio is the industry standard for PII detection and anonymization. It runs locally in your infrastructure, meaning PII is detected and stripped before text is sent to Sentiqra. This solves the biggest deployment blocker for regulated industries and strengthens your zero-retention claim: even if Sentiqra did retain data - which it doesn't - the input received has already been sanitized locally by your Presidio deployment.
Publishing this reference architecture removes the #1 deployment blocker for regulated industries and signals to DPOs that you understand their consent architecture.
Reference Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Your Infrastructure │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ User │────▶│ Presidio │────▶│ Sentiqra │ │
│ │ Input │ │ (local) │ │ API │ │
│ │ │ │ │ │ │ │
│ │ "Hi I'm │ │ Detect & │ │ Detect │ │
│ │ John │ │ Anonymize│ │ harmful │ │
│ │ Smith, │ │ PII │ │ language │ │
│ │ john@ │ │ │ │ │ │
│ │ gmail.." │ │ "Hi I'm │ │ Returns │ │
│ │ │ │ <PERSON>│ │ groups + │ │
│ │ │ │ <EMAIL> │ │ concepts │ │
│ │ │ │ .." │ │ │ │
│ └──────────┘ └──────────┘ └────┬─────┘ │
│ │ │
│ ┌────▼─────┐ │
│ │ Your │ │
│ │ Enforcement│ │
│ │ Pipeline │ │
│ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
│
Sentiqra API (submitted classification content is not retained)
No PII ever leaves your infra
Data flow: User input enters your infrastructure → Presidio runs locally to detect and anonymize PII (names, emails, phone numbers, SSNs, credit cards, etc.) → sanitized text is sent to Sentiqra API → detection result returned → your enforcement pipeline acts on the result. PII never crosses the network boundary to Sentiqra.
Working Code
Actual, tested, copy-pasteable code. Not pseudocode. Not aspirational.
Python - Presidio + Sentiqra
import os
import requests
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
# 1. Initialise Presidio (runs locally in your infrastructure)
analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()
# 2. User input - contains PII
user_input = (
"Hi, I'm John Smith and my email is john.smith@gmail.com. "
"You are a worthless idiot."
)
# 3. Detect PII with Presidio
analyzer_results = analyzer.analyze(text=user_input, language="en")
# 4. Anonymize PII - this happens LOCALLY, nothing leaves your infra
anonymized = anonymizer.anonymize(
text=user_input,
analyzer_results=analyzer_results,
)
# anonymized.text is now:
# "Hi, I'm <PERSON> and my email is <EMAIL_ADDRESS>. You are a worthless idiot."
# 5. Send sanitized text to Sentiqra - no PII in the request
response = requests.post(
"https://sentiqra.tech/v1/analyze",
headers={
"Authorization": f"Bearer {os.environ['SENTIQRA_API_KEY']}",
"Content-Type": "application/json",
},
json={"text": anonymized.text, "language": "en", "analyzers": ["trust-safety"]},
timeout=10,
)
data = response.json()
# 6. Act on the detection result
top = data["signals"][0]
print(top["code"]) # 'insults_derogation'
print(top["score"]) # 0.99
JavaScript / Node.js - Presidio (as a local REST service) + Sentiqra
// Presidio is Python-only - there is no official Node.js SDK.
// Run it as a local service instead:
// docker run -d -p 5002:5000 mcr.microsoft.com/presidio-analyzer
// docker run -d -p 5001:5000 mcr.microsoft.com/presidio-anonymizer
const PRESIDIO_ANALYZER = "http://localhost:5002";
const PRESIDIO_ANONYMIZER = "http://localhost:5001";
const userInput = "Hi, I'm John Smith (john.smith@gmail.com). You are a worthless idiot.";
// 1. Detect PII locally
const analyzerResults = await fetch(`${PRESIDIO_ANALYZER}/analyze`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: userInput, language: "en" }),
}).then((r) => r.json());
// 2. Anonymize PII locally - nothing leaves your infra
const anonymized = await fetch(`${PRESIDIO_ANONYMIZER}/anonymize`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: userInput, analyzer_results: analyzerResults }),
}).then((r) => r.json());
// 3. Send sanitized text to Sentiqra
const response = await fetch("https://sentiqra.tech/v1/analyze", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SENTIQRA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: anonymized.text, language: "en", analyzers: ["trust-safety"] }),
});
const data = await response.json();
const top = data.signals[0];
console.log(top.code); // "insults_derogation"
console.log(top.score); // 0.99
Install dependencies
# Python
pip install presidio-analyzer presidio-anonymizer requests
python -m spacy download en_core_web_lg
# JavaScript - Presidio runs as a local REST service (see comment above)
# Sentiqra is called over plain HTTPS - no SDK required
Security & Compliance Posture
-
✓
GDPR Article 5(1)(c) - Data Minimisation: PII is stripped before data reaches Sentiqra. Only the minimum necessary text (without identifiers) is processed externally.
-
✓
GDPR Article 32 - Security of Processing: Presidio runs locally in your infrastructure. No PII traverses the network to Sentiqra, reducing the attack surface.
-
✓
Zero-Retention Reinforcement: Sentiqra already operates zero-retention. With Presidio, even the zero-retention input contains no PII - defence in depth.
-
✓
DSA Article 6 - Risk Assessment: Provides evidence of proactive measures to protect user data during content moderation, which may support platform risk assessment documentation.
-
✓
SOC 2 Type II - CC6.1: PII sanitisation before external processing can provide evidence relevant to logical access controls over customer data.
-
✓
DLP Policy Support: Can help organizations implement data-loss-prevention policies that prohibit PII from being sent to third-party APIs.
Deployment Notes
Latency Impact
Presidio analysis adds approximately 10–30ms per request on a standard CPU (depends on text length and number of PII entities detected). This runs locally, so there is no network overhead. Total added latency is negligible compared to Sentiqra's published p95 latency target of <500ms.
Rate Limits
Presidio runs locally and has no rate limits. Sentiqra rate limits apply as normal - see your plan's per-second and per-day quotas. PII stripping does not change the number of Sentiqra calls.
Error Handling
If Presidio fails to analyse (e.g. NLP model not loaded), you should either (a) fail closed and block the request, or (b) log the error and proceed with raw text to Sentiqra. We recommend failing closed for regulated deployments - a PII leak is worse than a missed detection.
Cost Considerations
Presidio is open source (MIT licence) and runs on your infrastructure - no per-call cost. The only cost is the compute for the NLP models (spaCy or Stanza). Sentiqra costs are unchanged since the same number of API calls are made.
Supported PII Entity Types
Presidio supports 50+ PII entity types out of the box: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, IBAN_CODE, CREDIT_CARD, US_SSN, IP_ADDRESS, URL, DATE_TIME, and more. Custom recognisers can be added for domain-specific identifiers.
Questions about this integration?
Talk to Solutions Engineering - first response within 1 business day.
Talk to Solutions Engineering →Related Integrations
HashiCorp Vault
Secrets & Authentication
Store Sentiqra API credentials in Vault and inject them into applications at runtime.
OpenTelemetry
Observability
Capture operational metadata such as latency, status, request identifiers, taxonomy versions, and result metadata using OpenTelemetry. The reference architecture avoids recording raw submitted text by default.
Guardrails AI
AI & Agent Infrastructure
Add Sentiqra as a structured classification step before or alongside generative-model guardrails. Use the LLM for reasoning and Sentiqra where you need a fixed classification taxonomy and versioned output.