Insights · Engineering
Where does a privacy layer sit in your AI stack, and who runs it?
A privacy layer sits between your apps and the model, as a gateway hook or a sidecar, and your platform team runs it under security's policy.
- Published
- Reading time
- 8 min read
- By
- Saskia Russell, Founder's Associate

In this article
A privacy layer sits between your applications and the model endpoint, usually as a gateway hook or a sidecar container. Your platform team runs it under policy set by security and data protection, and it cannot sit inside Microsoft 365 Copilot.
If you run the AI platform at a bank or insurer, you already have Copilot, a model catalogue in Azure, AWS or Google Cloud, and probably an internal gateway. Then someone proposes a privacy layer, and nobody can say where it plugs in or who is responsible for monitoring it.
A privacy layer replaces personal details in each request with safe substitutes and, if it is reversible, restores the originals in the answer. The map between the two stays in your environment, which is what makes it pseudonymisation under GDPR Article 4(5). The map and the key back to the original have to stay secure and private.
What your vendor controls already do
| Control | What the model receives | Originals restored? |
|---|---|---|
| Purview DLP for Microsoft 365 Copilot | Nothing (the prompt is blocked; in preview) or the clear text | Not applicable |
| AWS Bedrock Guardrails | A type label in place of each value, or a block | No |
| Azure AI Language PII | Masked characters, a numbered type label, or random substitutes (in preview) | No |
| Google Sensitive Data Protection | Encrypted tokens | Yes, via a re-identify call |
| LiteLLM with Presidio | A type label in place of each value | Yes, with output_parse_pii |
Microsoft documents no natural point where you can insert your own transformation into Copilot, so your levers there are labels, DLP and permissions. A type label doesn't tell the model that two mentions are the same person, which is why masked pilots so often give thin, undeveloped answers. If you only need to stop regulated data reaching a model, you probably have the controls already, but they strip context and give less useful answers back. A separate layer matters when the model has to work with the full record.
Where the layer can sit
A layer protects only the traffic routed through it, so placement is the decision that matters. It dictates what is covered, and how much.
| Placement | What it sees | Trade-off |
|---|---|---|
| Central LLM gateway hook | Every call made with a gateway-issued key | Easy to govern, but the gateway now sees raw data and can become a single point of failure |
| Sidecar container beside each app | All model traffic in and out of that pod | No code changes; needs a container platform |
| SDK inside the app | Whatever the developer passes in | Relies on every team adopting it |
| Agent and MCP tool hooks (MCP connects models to tools) | Tool arguments and results | The only place that sees agent tool traffic |
Pair it with egress rules that block direct calls to model providers, so that all traffic routes through the layer, and test for bypasses. Nakato, for example, runs as an Envoy sidecar on Kubernetes or as a standalone gateway, inside your VPC or on your premises, and twins everything routed through it before it leaves your environment.
A worked example, end to end
A complaints analyst at a UK bank asks an internal assistant to summarise a customer's file. The record is synthetic.
- The app builds a prompt from the question and a complaint letter naming “Margaret Hale, 82, account ending 4417, Leeds”.
- The privacy layer, in the same pod or network segment, detects each identifier and swaps it for a semantic twin: a fictional value that keeps the context the task needs, such as age band and region, but changes the identifying details. The map is written locally.
- Anything the detector is unsure of is held back, not sent.
- Only the twin and the task cross to the external model.
- The answer returns, and the layer restores the originals and logs each swap. The analyst reads a summary naming Margaret Hale, whose file they could already open.
What leaves your domain is the twin, plus any operational telemetry the layer sends to its vendor. Ask what that telemetry contains.
Who operates it, and who sees the real data
No regulator prescribes an org chart, but the EDPB's pseudonymisation guidelines (01/2025) set the rules: reversal information is kept separately (paragraphs 16 and 20), only specifically authorised people can reverse it (paragraph 32), and that access is logged and rate-limited (paragraph 109). A workable split might look like this:
| Role | Responsibility | Sees real data? |
|---|---|---|
| Analyst | Uses the AI application | Yes, for records they could already open |
| Platform or AI engineering | Runs the layer: uptime, upgrades, monitoring | No; twins and health metrics |
| Security | Sets entity policy and thresholds, holds keys | Only through logged, approved lookups |
| Data protection officer | Owns the impact assessment, signs off residual risk | No |
| Break-glass reviewer | Investigates incidents, clears held items | Yes, with dual approval, every lookup logged |
| Model provider | Runs the model | No; twins and the task |
Human effort depends mostly on the confidence threshold, because a layer that fails closed builds a queue of held items. Measure this held rate on your own documents during the pilot.
Build, buy or rely on what you have?
The answer depends on what you need the model to do. Rely on vendor controls if blocking or masking is enough. Building on open source, such as Presidio behind LiteLLM, makes sense if you have an NLP team and mostly need one-way masking; you will own the recognisers for internal IDs, an evaluation set and upgrades. Buy a layer when the model must reason over full records and answers need to come back with real values.
A technology company with a strong machine-learning team can build this, and probably should. Nakato currently deploys in your environment, not as hosted SaaS, and its output is pseudonymised rather than anonymised, so it doesn't take records out of GDPR scope while you hold the key that returns them. Under DORA, the LLM provider is still an ICT third party whatever layer you add.
What to do now
Step 1. Trace one real request, on a whiteboard if that helps, and mark every point, including logs and caches, where raw personal data exists today. That chart is your integration work, and it shows where data could leak.
Step 2. Put names in the ownership table, including who clears held items, before you book the pilot.
FAQ
Frequently asked questions
Is pseudonymised data still personal data?
Pseudonymised data remains personal data for you, because you hold the map. In EDPS v SRB (4 September 2025), the EU Court of Justice said it may not be personal data for a recipient with no reasonable means of re-identifying it, provided identifiers don't slip through.
How much latency does a privacy layer add?
A privacy layer adds a processing step to every request, because each one is read, transformed and restored on the way back. How much that adds depends on the length of the text, the entities in it and where the layer runs, so measure it on your own traffic during the pilot, alongside the held rate. Streaming and keeping substitutes consistent across a conversation are usually the harder design problems.
Do we need confidential computing?
Confidential computing is not required by the reference architectures we reviewed; standard containers are the norm. A trusted execution environment, hardware that encrypts memory even from the host's administrators, can protect the map on your most sensitive workloads, but it won't catch a missed identifier.
Does it work with any MCP server, or any gateway other than LiteLLM?
A privacy layer that sits on the network path, rather than inside one gateway product, isn't tied to a particular gateway or MCP server. Nakato runs as an Envoy sidecar next to the application, or as a standalone gateway, and covers inbound and outbound calls, including incoming webhooks. LiteLLM appears in this article only as an example of a gateway with its own masking. Traffic is protected only when it passes through the layer, so route gateway and MCP tool calls through it and block direct egress to model providers.
Does it work for RAG and for creating embeddings?
A privacy layer can protect retrieval-augmented generation (RAG) at two points: when retrieved passages are added to a prompt, and when documents are embedded and stored. Retrieved text in a live prompt passes through the layer like any other request. Bulk jobs, such as embedding a document store, don't travel as live requests; Nakato handles workloads like these through its SDK, which runs the same engine and is currently in early access. If an external model creates your embeddings, pseudonymise the text before it is sent, or the vector store will hold real values.
Sources
EUR-Lex (Regulation (EU) 2016/679), 27 April 2016
Definition of pseudonymisation.
Guidelines 01/2025 on Pseudonymisation
European Data Protection Board, Adopted 16 January 2025
Paragraphs 16, 20, 32, 35, 108 and 109: separation, authorised reversal, logged access.
Learn about using DLP with Microsoft 365 Copilot
Microsoft Learn, Updated 10 November 2026
Prompt blocking, web search blocking and label exclusion.
Microsoft 365 Copilot architecture: data protection and auditing
Microsoft Learn, Updated 10 November 2026
Service boundary and permission trimming.
Remove PII from conversations by using sensitive information filters
Amazon Bedrock User Guide, Accessed 23 November 2026
Block and mask modes.
Microsoft Learn, Azure AI Language, Updated 2 June 2026
Redaction policies, including synthetic replacement in preview.
Google Cloud, Sensitive Data Protection, Updated 22 October 2026
Reversible encryption and re-identification.
LiteLLM, Accessed 23 November 2026
Presidio masking and output_parse_pii.
Access Azure OpenAI and other language models through a gateway
Microsoft Learn, Azure Architecture Center, Updated 2 July 2026
Gateway trade-offs.
Presidio project, Accessed 23 November 2026
Community ownership; no guarantee of complete detection.
Trust and threat model, confidential virtual machines
NVIDIA, Accessed 23 November 2026
What trusted execution environments protect, and what they don't.
Case C-413/23 P, European Data Protection Supervisor v Single Resolution Board
Court of Justice of the European Union, 4 September 2025
Pseudonymised data from the recipient's perspective.
Written by
Saskia Russell
Founder's Associate
Saskia Russell is Founder's Associate at Nakato. She writes about how organisations can use sensitive customer data with AI models: what the law says, how the methods compare, and what is required to get a project moving.
More insights

Engineering ·
Who audits the AI that audits your data?
An AI that checks your data for personal information is only as trustworthy as your ability to test it, reproduce its decisions and show them to an auditor.
11 min read

Engineering ·
The AI data paradox: the safer you make the data, the worse the AI gets
Enterprise data is valuable because it’s specific, yet that specificity is the first thing protection tools strip out. Privacy needs designing in.
3 min read

Engineering ·
How can teams test for bypasses around an AI de-identification layer?
A de-identification layer protects only the traffic routed through it. Test every route a prompt can take, not just the detector.
5 min read