API + AI PRIVACY GUARD

Add protection.
Keep your workflow.

Send selected text to the protection API or wrap a supported AI client with the Python SDK. Keep credentials on your server and check the protected result before forwarding it.

01 Receive authorized content

02 Detect and transform sensitive details

03 Forward protected context

Read the SDK guide → API documentation →
● ● ●protect_with_api.pyPYTHON
Writing the integration

Preparing selected content…

Automatic typing · illustrative outputServer-side integration
PYTHON SDK · v1.1.0

PrivoNest AI Privacy Gateway SDK

Install one Python package for supported integration workflows: protect textual LLM inputs with Guard(), and protect text before it reaches your LLM provider. Both use the same PrivoNest API key and credit wallet.

from openai import OpenAI
from privonest_guardrail import Guard

guard = Guard()
client = guard.wrap(OpenAI())
01

App prompt

Your backend receives normal user text.

02

PrivoNest detect

The SDK asks your PrivoNest API for detected spans.

03

Protected LLM call

The model can receive [PN_NAME_1] instead of the raw name.

04

Restore

Exact placeholders can be restored using short-lived application-side memory.

Document & Data Boundary

File protection stays in the PrivoNest REST API

The current Guard().wrap(...) SDK automatically protects textual LLM inputs. PDF, DOCX, XLSX, CSV, images, email, DICOM and transcript processing are handled by the existing POST /v1/hide multipart/document API rather than being silently intercepted as provider file uploads.

POST /v1/hide
X-API-Key: YOUR_KEY
Content-Type: multipart/form-data

file = customer.pdf
strategy = redact
country = PK

This separation keeps the SDK's automatic LLM interception behavior explicit and avoids claiming provider-specific binary upload transformation that the current Guard wrapper does not implement.

Where do I deploy the SDK?

You do not deploy it as a separate website. Install it into the Python backend that already calls OpenAI, Claude, Gemini, Ollama or a framework LLM.

Keep both the PrivoNest API key and the LLM provider key on the server side. Do not put them into frontend JavaScript.
# after extracting the SDK
pip install ./privonest_guardrail_sdk

# Linux/macOS
export PRIVONEST_API_KEY="YOUR_KEY"

# PowerShell
$env:PRIVONEST_API_KEY="YOUR_KEY"
Bring your own AI

OpenAI Is an Adapter, Not a Dependency

PrivoNest does the privacy work. The customer's chosen model provider does the AI work. A customer can keep OpenAI today and switch to Claude, Gemini or a local Ollama client later without changing the purpose of PrivoNest.

1. Application receives the original prompt
2. Guard asks PrivoNest for sensitive spans
3. Guard replaces exact spans with scoped aliases
4. Protected prompt goes to the selected AI provider
5. Aliases remain hidden by default; restoration requires explicit opt-in
Customer owns:
  PRIVONEST_API_KEY
  + provider API key

PrivoNest handles:
  detect → alias → explicit restore

Provider handles:
  reasoning / generation

Provider can be changed by the app.

Adapter examples

OPENAI
Guard().wrap(OpenAI())
CLAUDE
Guard().wrap(Anthropic())
GEMINI
Guard().wrap(genai.Client())
OLLAMA
Guard().wrap(ollama.Client())
LANGCHAIN
Guard().wrap(ChatOpenAI(...))
LLAMAINDEX
Guard().wrap(OpenAI(...))

The PrivoNest SDK package is v1.1.0. Provider adapters still depend on third-party SDK method shapes, so integration-test the exact provider/library versions used by your application. Need help? Open the private SDK support form