Detect and tokenise PII before it reaches any LLM. One endpoint change — no architecture rewrite.
Integrating with an AI coding assistant? Point it to our llms.txt
Sign up and create your account. Your API key will be available in the dashboard under Settings → API Keys. It starts with prvr_.
Create your accountChoose your stack. The SDK has zero runtime dependencies.
npm install privaro-sdkA pipeline defines which LLM provider you use and which policy rules apply. Create one in the dashboard, then copy its UUID.
# In your dashboard: /app/pipelines → New pipeline
# Choose your LLM provider and configure policy rules
# Copy the pipeline UUID from the pipeline detail pagePass any text through Privaro before sending it to your LLM. PII is detected and replaced with reversible tokens.
import { PrivaroClient } from "privaro-sdk";
const privaro = new PrivaroClient({
apiKey: process.env.PRIVARO_API_KEY,
pipelineId: process.env.PRIVARO_PIPELINE_ID,
});
const result = await privaro.protect(
"Solicitante: Laura Sánchez (DNI: 23456789D) " +
"Email: laura@empresa.com · IBAN: ES98 2100 0418 6819 6340 7321"
);
console.log(result.protected);
// "Solicitante: [NM-0001] (DNI: [ID-0001]) "
// "Email: [EM-0001] · IBAN: [BK-0001]"
console.log(result.summary());
// [Privaro] 4 detected, 4 masked, risk=high, gdpr=✓, 48msUse result.protected instead of the original prompt. Your LLM never sees real PII — only tokens like [NM-0001] and [ID-0001].
// Send the protected prompt to your LLM
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: result.protected }],
});
// LLM never sees the real PII — only tokens like [NM-0001]Building a RAG pipeline? The three steps above cover single-turn chat protection. Document ingestion and retrieval-time protection follow a different flow — see the dedicated RAG protection guide for accurate, working code samples.
What you get out of the box
Hybrid detection
Tier 1 regex (deterministic) + Tier 2 Presidio NLP (contextual). 10 entity types including DNI, IBAN, phone, full name, and health records.
Under 60 ms
P95 latency across all pipelines. Privaro adds less than 60 ms to your existing LLM call — invisible to the end user.
GDPR-ready audit trail
Every request writes an audit log entry certified on iCommunity Blockchain. Exportable as PDF for DPO reports and EU AI Act compliance.
Base URL: https://api.privaro.ai/v1
/proxy/protectDetect and tokenise PII. Writes audit log + iBS blockchain certification.
/proxy/detectDetect PII without masking. Analysis mode — no state written.
/relay/completeFull-cycle relay: protect → route to configured LLM → de-tokenise response.
/agent/revealReplace tokens with original values in a text. Requires conversationId.
/relay/streamStreaming relay (SSE). Each delta is returned already de-tokenised. Output is audited in real time but not masked — chunks are delivered as they are produced.
/proxy/protect-outputScan and mask the response text from your own LLM. Use it when you call /proxy/protect and then your model directly. Requires output_scanning_enabled on the pipeline.
/proxy/protect-documentProtect a text document — paste up to 2,000,000 characters directly. Same detection engine as /proxy/protect. Synchronous under ~20,000 characters; above that, returns a job_id to poll.
/proxy/protect-document/uploadProtect a document by uploading a file directly — PDF, Word, Excel, CSV or email, up to 20MB. Extracts the text server-side and masks it with the same detection engine.
/proxy/protect-document/{job_id}Poll the result of a large document submitted to /proxy/protect-document (over ~20,000 characters), processed asynchronously by a separate worker.
/proxy/protect-retrievalProtect a batch of chunks retrieved from your vector store before they reach the LLM's context. Per-chunk role-based access control; fails closed on any detection error.
/proxy/protect-image-documentProtect a photographed or scanned document (national ID, passport, contract). OCR + detection + masking in one call, with an optional redacted copy of the image returned.
/healthHealth check. Returns proxy status, version, and detector state.
Input scanning protects what goes into the model: /proxy/protect and /relay/complete detect and tokenise PII before the prompt reaches OpenAI, Anthropic or Gemini.
Output scanning protects what comes back. On /relay/complete, /agent/protect and /proxy/protect-output the response is scanned and masked inline before it reaches your application, and audited with direction='output'.
Limitation on streaming: on /relay/stream the output is audited in real time but cannot be masked — chunks are already delivered to the client before the scan completes. Use /relay/complete when masking of the response is required.
14-day free trial, full Pro access, no credit card required.
No credit card · No commitment · Cancel anytime