Learn
AI security & red-teaming

Data Privacy in AI: Why Self-Hosting Keeps Enterprise Data Safe

The short answer

Self-hosting removes the model vendor from your data flow, which eliminates a subprocessor, a cross-border transfer and a contractual promise you cannot audit. It does not remove your obligations. Prompts, retrieval indexes, logs, caches and fine-tuning artefacts stay yours to secure, and the privacy claim only holds if deletion, access control and encryption are engineered rather than asserted.

On this page

What counts as your data in an AI system

Teams underestimate the data map because they think of the prompt as the only artefact. In practice an AI system produces and stores at least eight categories: the prompts users type, the completions the model returns, the documents retrieved to ground an answer, the embeddings computed from those documents, the logs and traces of every request, the evaluation and red-team transcripts, any fine-tuning dataset and the resulting adapter weights, and the caches that sit between the user and the model. Each has a different sensitivity, a different retention period and a different deletion path.

Write the map before comparing deployment options. A question such as whether the vendor trains on our data is unanswerable until you know which of those eight categories leave your network, which are stored at rest, and for how long.

Where data goes on the hosted path

A hosted inference call is a chain, not a single hop. Your application sends the prompt to the vendor's API, which routes it through a load balancer and an inference fleet, writes request metadata for billing and abuse monitoring, and may retain the content itself for a defined period to investigate policy violations. Behind the vendor sit subprocessors: cloud regions, observability vendors, support tooling, and sometimes human reviewers in a different jurisdiction. Each hop is a place where data exists, and each is a party your regulator may treat as a processor.

The no-training commitment most vendors offer is contractual and enforced by process, not by architecture. It is a promise that your prompts will not enter a training pipeline, backed by access controls and audits you cannot inspect. That is often a perfectly reasonable risk to accept, especially for low-sensitivity workloads, but it is a different kind of assurance from data that never leaves a network you operate.

Cross-border transfer is the part that surprises enterprises. Even when the vendor is in your country, the support engineer reading a ticket may not be, the backup region may not be, and the subprocessor list may change with thirty days' notice. For European workloads this is the territory of GDPR Chapter V, standard contractual clauses and a transfer impact assessment post-Schrems II, with the EU-U.S. Data Privacy Framework as a partial successor for certified recipients. For Indian workloads it is the Digital Personal Data Protection Act, 2023 and whatever cross-border rules are in force when you sign.

  • Controller and processor: under GDPR you are the controller and a model vendor is a processor, which requires an Article 28 contract with documented instructions, subprocessor approval, assistance duties and deletion obligations.
  • Purpose limitation and minimisation: collecting a full prompt when a classification result would do is a minimisation problem regardless of where the model runs.
  • Storage limitation: retention periods must be defined per artefact, and a log store that keeps prompts indefinitely is the most common finding in an AI privacy review.
  • Special category data: health, biometric, caste, religion, sexual orientation and similar data attract stricter conditions, and a general-purpose model endpoint is rarely the right place to process them.
  • Sector rules: HIPAA requires a business associate agreement and Security Rule safeguards for PHI; PCI DSS scope shrinks dramatically if card data never reaches the model or its logs.
  • Data subject rights: access, correction and erasure have to be answerable across every artefact in the map, including embeddings, caches, backups and evaluation sets.
  • Breach notification: GDPR requires notifying the supervisory authority within 72 hours of awareness where there is a risk to rights, so detection has to work at machine speed.

What self-hosting actually changes

Self-hosting removes the model vendor from the data flow. Inference happens on hardware you control, under a network policy you write, with logs that land in a store you own. There is no subprocessor for the model call, no cross-border transfer created by inference, and no reliance on a contractual promise about training because there is no training pipeline on the other side. For a regulated workload that alone can remove months of vendor diligence.

It does not make you compliant by itself. You become the operator of a system that processes personal data, which means the Article 30 record, the DPIA, the retention schedule, the access control, the encryption and the breach response are now yours to build and evidence. Self-hosting converts a vendor risk into an engineering obligation, and the obligation is larger than most teams expect.

The deployment model matters too. On-premises gives the strongest control and the worst elasticity. A private VPC in your own cloud account with dedicated tenancy gives most of the control with better operations. A managed dedicated offering gives isolation and a contract but puts the operator back in the trust boundary. Choose by asking who can read memory, who holds the keys, and where backups replicate.

The leak surfaces that remain after self-hosting

The most common privacy failure in a self-hosted deployment is not a model attack. It is an observability agent. A tracing library configured with default settings ships full prompts and completions to a SaaS dashboard, which reintroduces the exact subprocessor the self-hosting decision was meant to remove. Audit every outbound connection from the inference namespace, and treat telemetry exporters as data transfers requiring the same review as an API vendor.

The second is the debugging habit. Crash dumps, core files, application logs at debug level, support bundles and notebook outputs all capture prompt text. A GPU out-of-memory trace that includes the input tensor is a data export. Set log levels in production, disable core dumps on the inference container, and scrub support bundles before they leave the host.

The third is the retrieval index. A vector database is a copy of your document corpus in a form that is harder to classify, easier to over-share and usually exempt from the access controls applied to the source system. Teams that would never let an analyst query the HR drive will happily let a chatbot retrieve from it because the embedding pipeline ran with a service account that could read everything.

Embeddings are not anonymisation

There is a persistent belief that vectors are safe because they are numbers. They are not. Inversion research has shown that text can be reconstructed from embeddings with high fidelity, including names, dates and short passages, and that the reconstruction improves with access to the embedding model, which a self-hoster by definition has. Even without inversion, embeddings support membership inference and attribute inference: an attacker who can query the index can learn whether a specific document is present and often what it is about.

Treat the vector store as a copy of the corpus at the same classification level as the source, with the same access control, the same encryption and the same retention. Partition by tenant and by permission group at the index level rather than filtering after retrieval, because a post-filter that runs in the application still transfers the chunk into the prompt. If different clearance levels share a collection, a metadata filter bug becomes a disclosure.

Memorisation, extraction and inference attacks

Language models memorise. Sequences that appear many times in training data, or that are unusual enough to be encoded precisely, can be reproduced on request. Extraction attacks probe a model with prefixes and can recover verbatim spans of training text, and membership inference can reveal whether a particular record was in the training set. Both matter most when the model was fine-tuned on customer data, because the fine-tuning set is small, duplicated across epochs and often contains exactly the records you would least like reproduced.

The controls are unglamorous. Deduplicate training data, because memorisation correlates with repetition. Exclude data you would not want emitted, rather than relying on a filter at inference time. Evaluate extraction risk by prompting the model with prefixes from held-out sensitive documents and checking for verbatim overlap. Differential privacy gives a formal bound, but the budget needed for useful quality often exceeds the risk tolerance, so it is a niche tool rather than a default.

For most enterprises the practical rule is simpler: do not fine-tune on data you cannot afford to have repeated. Use retrieval instead, where access control and deletion are at least tractable, and keep the fine-tuning set to synthetic or explicitly licensed material.

Deletion is a pipeline, not a button

A deletion request in a RAG system has to reach the source document, every chunk derived from it, every embedding of every chunk, the retrieval cache, the exact-match response cache, the conversation history that quoted it, the evaluation set that included it, the trace store, the backups and the snapshots. Miss one and the data is still there, and the audit trail will show that you marked the primary record deleted while a replica kept serving it.

Design for deletion before ingestion. Give every chunk a stable document identifier and a version, so deletion is a range delete rather than a semantic search for lookalikes. Use a vector store that supports hard delete and compaction, and understand how long tombstones persist. Encrypt per tenant or per document with envelope keys where the workload justifies it, so crypto-shredding by key destruction provides a defensible answer for immutable backups that cannot be rewritten.

Machine unlearning is an active research area, not a production control. You cannot reliably remove a fact from a fine-tuned model's weights, which is why the decision about what enters training data is the deletion control that actually works. Document that position, and make sure sales is not promising otherwise.

Encryption, keys and isolation

  • Transport: TLS 1.2 or 1.3 everywhere, mTLS between gateway and inference, and no plaintext hop inside the cluster on the assumption that the network is trusted.
  • At rest: AES-256 for volumes, object storage and backups, with encryption enabled at bucket creation rather than retrofitted, since a bucket policy change does not re-encrypt existing objects.
  • Envelope encryption: a KMS master key wraps per-tenant data keys, so revocation is per tenant and rotation does not require re-encrypting the corpus.
  • Key custody: keep keys in a KMS or HSM that the inference operator cannot export from, separate key administrators from data administrators, and log every decrypt.
  • Bring your own key: where offered, it gives you a revocation lever, but confirm that revocation actually makes data unreadable rather than merely blocking new writes.
  • Tenant isolation: separate namespaces, separate indexes, separate adapters and separate rate-limit and cache namespaces, tested with a cross-tenant probe rather than assumed from configuration.
  • Access control: role-based access for the console, attribute-based filters for retrieval, just-in-time elevation for support staff, and a break-glass path that pages someone when used.

Confidential computing and the trust boundary

Self-hosting answers who owns the data, not who can see it. The cloud operator, the platform team with root, and anyone who can attach a debugger to the inference process sit inside the trust boundary. Confidential computing moves that line. CPU trusted execution environments such as Intel TDX and AMD SEV-SNP encrypt memory from the hypervisor, and GPU confidential computing on H100-class hardware extends the same protection to model weights and activations, with remote attestation proving which code is running before you release a key.

The costs are real: throughput penalties, a narrower set of supported drivers and inference stacks, complexity in attestation and key release, and limited support for multi-GPU topologies. It is justified when the threat is the infrastructure operator itself, such as a regulated data holder using a public cloud, or a model owner running on someone else's GPUs. For most internal deployments, strong access control and network isolation deliver more risk reduction per unit of effort.

Residency is a property of the whole stack

Data residency claims collapse when a backup replicates to another region, when the observability vendor stores traces in a third country, or when a support engineer in a fourth country can query the cluster. Map every storage location and every access path, not just the GPU location. Contractual residency commitments should name the regions for primary storage, backups, disaster recovery and support access, and should require notification before any of them changes.

For Indian enterprises, the DPDP Act and sectoral regulators add their own expectations, and many customers now ask for the data to stay in-country as a procurement condition rather than a legal one. Self-hosting in an Indian region is the straightforward way to answer that, provided the model weights, the container registry and the backup target are also in-country. A model pulled from a foreign registry at boot is an availability risk worth designing around, not a data transfer.

Operating model: policy, evidence and response

Privacy engineering is mostly documentation that matches reality. Maintain a record of processing, a data classification scheme, a retention schedule per artefact, a DPIA for each high-risk use case, and a vendor register that includes the observability and support tools people forget. Review the retention schedule against the actual bucket lifecycle policies quarterly, because the drift between the document and the configuration is where findings come from.

Rehearse the breach path. For an AI system the interesting questions are whether prompt logs contain personal data, how you would identify which tenants were affected by a cache leak, and whether you can delete a document from every store within the notification window. A tabletop exercise with the platform, security and legal teams will surface more than another questionnaire.

Key points

  • Your data includes prompts, completions, retrieved documents, embeddings, logs, caches, evaluation sets and fine-tuning artefacts, each with its own deletion path.
  • Self-hosting removes a subprocessor and a cross-border transfer; it does not remove controller obligations, retention limits or breach notification.
  • Audit telemetry and support tooling first, because the observability exporter is the most common way data leaves a self-hosted deployment.
  • Treat embeddings and the vector index as a copy of the corpus, not as anonymised derivatives.
  • Do not fine-tune on data you cannot afford to see repeated, and treat unlearning as research rather than a control.
  • Deletion, key custody and tenant isolation must be engineered and tested, because a privacy claim that cannot be demonstrated is a liability.
Page feedback

Was this helpful?

A quick signal helps improve these notes.

Report a mistake Straight to the lab inbox

Put it to work

See the models, datasets and gateway this lab runs.