Prompt privacy
Prompts routinely contain customer names, emails, IDs and internal content. Without a security layer, all of that is sent to a third-party LLM.
Category · Educational pillar
Reference definition and architecture for the privacy-first LLM gateway category.
A vendor-neutral primer for engineering and security teams shipping AI features. For how Privian implements this layer, see the product page.
Definition
An AI Security Layer is the masking, routing and rehydration layer that sits between an application and one or more AI providers. It detects personal and sensitive data in inbound prompts, replaces it with deterministic placeholders, forwards the masked prompt to the configured provider, and rehydrates the response on the way back.
Why
Prompts routinely contain customer names, emails, IDs and internal content. Without a security layer, all of that is sent to a third-party LLM.
Direct provider calls leave no enforcement point for policy, masking, or auditing. The security layer centralizes that surface.
Even short-lived provider logs can become a compliance problem. Masking at the edge shrinks the exposure window to zero.
Product AI features blend customer records with user input. The security layer strips identifiers before that mix leaves your stack.
Employees paste internal documents into chat UIs. A gateway routes those prompts through masking before any external call.
A central choke point makes it tractable to apply structural validation and policy on every prompt — not scattered across clients.
How it works
Step 1
Your app POSTs prompt + model to the gateway endpoint instead of calling the provider directly.
Step 2
Detected personal and sensitive values are replaced with stable placeholders inside the request body.
Step 3
Structural and policy checks run at the edge. Disallowed prompts are rejected with a structured error.
Step 4
The masked prompt is forwarded to the configured provider using your own credentials (BYOK).
Step 5
Placeholders in the response are restored to original values before reaching your application.
Step 6
Raw prompts and responses are never persisted. Only structural counters are kept for observability.
Comparison
An LLM gateway is a routing layer for AI traffic — it accepts prompt requests, resolves the provider, and forwards the call. That alone does not change what the provider sees.
An AI Security Layer is the broader category. It wraps the gateway with PII masking, prompt security, rehydration, and a zero-retention guarantee. Every AI Security Layer contains a gateway; not every gateway is an AI Security Layer.
Capabilities
Masking
Deterministic detection and replacement of personal identifiers.
Policy
Structural validation and policy enforcement at the edge.
Privacy
Structural counters only — never raw prompt or response bodies.
Architecture
Use your own provider credentials. Privian routes, not resells.
Routing
One JSON gateway in front of multiple providers, selected via the model namespace.
Egress
Restore masked placeholders in the response so your app sees real data.
FAQ