Documentation

    Integrate Privaro in under an hour

    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

    1

    Get your API key

    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 account
    2

    Install the SDK

    Choose your stack. The SDK has zero runtime dependencies.

    bash
    npm install privaro-sdk
    3

    Create a pipeline

    A pipeline defines which LLM provider you use and which policy rules apply. Create one in the dashboard, then copy its UUID.

    bashInstructions — not code to run
    # In your dashboard: /app/pipelines → New pipeline
    # Choose your LLM provider and configure policy rules
    # Copy the pipeline UUID from the pipeline detail page
    4

    Protect your first prompt

    Pass any text through Privaro before sending it to your LLM. PII is detected and replaced with reversible tokens.

    typescript
    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=✓, 48ms
    5

    Send the protected prompt to your LLM

    Use result.protected instead of the original prompt. Your LLM never sees real PII — only tokens like [NM-0001] and [ID-0001].

    typescript
    // 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.

    API reference

    Base URL: https://api.privaro.ai/v1

    POST
    /proxy/protect

    Detect and tokenise PII. Writes audit log + iBS blockchain certification.

    POST
    /proxy/detect

    Detect PII without masking. Analysis mode — no state written.

    POST
    /relay/complete

    Full-cycle relay: protect → route to configured LLM → de-tokenise response.

    POST
    /agent/reveal

    Replace tokens with original values in a text. Requires conversationId.

    POST
    /relay/stream

    Streaming 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.

    POST
    /proxy/protect-output

    Scan 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.

    POST
    /proxy/protect-document

    Protect 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.

    POST
    /proxy/protect-document/upload

    Protect 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.

    GET
    /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.

    POST
    /proxy/protect-retrieval

    Protect 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.

    POST
    /proxy/protect-image-document

    Protect a photographed or scanned document (national ID, passport, contract). OCR + detection + masking in one call, with an optional redacted copy of the image returned.

    GET
    /health

    Health check. Returns proxy status, version, and detector state.

    Input vs. output scanning

    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.

    Ready to protect your first prompt?

    14-day free trial, full Pro access, no credit card required.

    No credit card · No commitment · Cancel anytime