Skip to content

Data Protection in AI Operations: Setting Up Local Systems Right

Running a language model on your own hardware removes one big question: prompts, documents and answers no longer travel to a third-party AI provider. It does not remove data protection work. The responsibility simply moves in-house, and decisions a cloud vendor used to make for you, such as what is logged, who can read it and when it is deleted, are now yours. This guide covers the technical and organisational side of operating local AI under the GDPR. For the legal framework, read GDPR and AI agents at work. Nothing here is legal advice.

What does data protection mean when you run AI locally?

It means applying the GDPR principles to every place where your AI system stores or handles personal data. That includes the model server and the prompt, but also chat history, logs, the vector database, caches and backups. Self-hosting changes who carries the responsibility. It does not change whether the rules apply.

The principles sit in Article 5 GDPR: lawfulness, fairness and transparency; purpose limitation; data minimisation; accuracy; storage limitation; integrity and confidentiality. Article 5(2) adds accountability. You must be able to demonstrate compliance, not just achieve it. For an AI system, that translates into documentation showing which data sits where, and why.

Self-hosting is still a genuine advantage. Germany's joint body of data protection authorities, the Datenschutzkonferenz (DSK), notes in its October 2025 guidance on RAG systems that a retrieval-augmented system can in some cases run on-premises, which avoids sending personal data to operators of large online models. The same document stresses that transparency, purpose limitation and data subject rights still have to be assessed case by case.

The questions come up as soon as you deploy something useful, for example:

  • an internal assistant answering questions from manuals, inspection reports and support tickets,
  • an agent drafting quotes from past deals, which means reading customer contacts,
  • a search tool over HR policies, works agreements or contracts.

Each of these pulls names, email addresses and information about people into the system, whether anyone planned for it or not.

Which components does a local AI stack have, and where does personal data end up?

A typical stack has five parts: the model server, the application or chat interface, the document store, the vector database, and operational data such as logs and backups. Personal data can sit in any of them. Each one needs its own answer on access, retention and deletion.

Model server. This is where the model runs, for instance with Ollama or vLLM. The weights contain whatever the publisher trained on, which you cannot inspect. The European Data Protection Board states in Opinion 28/2024 that models trained on personal data cannot in all cases be considered anonymous; for that, the likelihood of extracting such data, directly or through queries, has to be insignificant. In practice, pick models with documented provenance and make an explicit assessment instead of assuming the question away.

Application and chat interface. Most interfaces store conversation history per user. It is convenient and often the largest unplanned data collection in the stack, because staff paste emails, CVs and customer records into prompts.

Document store. The reference documents for retrieval-augmented generation (RAG) come from file shares, SharePoint, the ticketing system or the ERP. They bring their own personal data and their own access rules.

Vector database. Documents are split into chunks and converted into vectors, known as embeddings. The DSK describes how these vectors are stored together with the chunks or with a link to them. Anyone who can read the database can, in effect, read the content.

Operational data. Server logs, monitoring, crash reports, caches and backups. The vLLM CLI reference, for example, documents an option to log requests; at debug level that includes prompt inputs, and a separate option adds model outputs. A setting switched on for one afternoon of troubleshooting can quietly become a permanent prompt archive.

What do you have to manage in day-to-day operation?

Four topics keep coming back: what you log and for how long, who may see which documents through the assistant, how data disappears from every store, and which classes of data may go into which model. All four can be solved technically, but only if they are decided before go-live.

Logging prompts and responses

You need logs for debugging, security and traceability. They are also a copy of everything users typed. Separate by purpose. Technical metadata such as timestamp, user ID, model, latency and error codes is usually enough for routine operation. Full prompt and response text should be the exception, with a short, defined retention period and restricted read access. The DSK points out that recording which sources were used for an answer (references to chunks or documents) improves traceability. Those references are often more useful than the full answer text.

Permissions in retrieval

The model has no concept of access rights. The DSK says plainly that the language model itself cannot control which information a given user may access. Control has to happen before the model, in the vector database and in document retrieval. The guidance names tenant or functional separation and a roles-and-permissions concept as established measures. In practice, each chunk inherits the permissions of its source document, and the retriever filters by the requesting user's groups before any text reaches the model.

Deletion across every store

This is where retrieval and the model differ most. According to the DSK, entries in the vector database and the reference documents are directly addressable, so personal data can be erased selectively, and normal retention-based deletion works for both. Removing data from the model weights remains an unsolved problem. The architectural rule follows directly: personal data belongs in the retrieval layer, not in a model fine-tuned on company records. That matters for the right to erasure under Article 17 GDPR, which applies without undue delay once the grounds are met.

Data classes and model choice

Not every piece of information belongs in every system. Define data classes, for example public, internal, confidential and special category, and record which classes each model and each knowledge source may handle. Special categories under Article 9 GDPR, such as health data, need the most care. The DSK notes that such data can be processed in a RAG setup if the requirements are met, because it does not remain in the model as long as nobody trains on it. For how local systems fit into a wider sovereign setup, see sovereign AI.

What needs to be in place first?

Three things: an inventory of the data the system will see, an identity and permissions system the AI can plug into, and named owners for operations and data protection. Missing any of them produces the usual gaps, most often in access control and deletion.

Data inventory. Which sources will be connected? Which groups of people appear in them: customers, employees, applicants, suppliers? What retention rules already apply to the originals?

Identity and access. Connect the AI system to your existing directory, such as Microsoft Entra ID or an LDAP directory, so that groups are not maintained twice. Protect the model server itself as well. The Ollama FAQ states that Ollama binds to 127.0.0.1 on port 11434 by default; setting OLLAMA_HOST to all interfaces exposes the API on the network. The FAQ does not describe built-in authentication for the local API. vLLM offers an --api-key option, but its documentation notes that it only covers certain endpoints.

Ownership. Who approves new knowledge sources? Who reviews logs? Who handles access and erasure requests that touch the AI system? Without a name next to each of these, every policy stays on paper.

Contracts. Local does not always mean no service providers. If a hosting company runs the servers, an IT contractor has remote access, or monitoring runs as a cloud service, check whether you need a processing agreement under Article 28 GDPR. The processor may then only act on documented instructions. Outside the EU, check the equivalent rules of your own jurisdiction with whoever handles privacy for you.

How do you set it up, step by step?

Work through six steps: define the purpose, map the data flows, choose privacy-friendly defaults, pass permissions through to retrieval, automate retention and deletion, then document and review. The order matters, because each step depends on decisions made in the one before.

  1. Define the purpose. Write one concrete purpose per application, such as "answering technical questions from service manuals and closed tickets". The purpose decides which sources may be connected. A source that does not fit stays out, even if it would be handy.

  2. Map the data flows. Trace a prompt end to end: interface, application, retriever, vector database, model server, answer, log, backup. Mark every point where content is stored. That sketch feeds your record of processing activities under Article 30 GDPR, which lists purposes, categories of data and recipients, and where possible retention periods and a general description of security measures.

  3. Choose privacy-friendly defaults. Article 25 GDPR requires data protection by design and by default: only the data needed for the purpose should be processed, including in terms of storage period and accessibility. In concrete terms: keep chat history only where users genuinely need it, leave full-text request logging off on the model server, and enable debug levels only for a limited time.

  4. Pass permissions through. When ingesting documents, copy each source document's permissions into the chunk metadata. On every query, the retriever filters by the signed-in user's groups. Test this with two accounts from different departments before real users arrive.

  5. Automate retention and deletion. Set a period for every storage location and enforce it with scheduled jobs, not by hand. When a source document is deleted or changed, its chunks and vectors must disappear at the next sync. Check how long backups still hold deleted data, and write that down.

  6. Document and review. Article 32 GDPR calls for measures such as encryption and pseudonymisation where appropriate, the ability to restore access after an incident, and a process for regularly testing whether the measures work. Schedule that review, for instance after each new data source and each model change.

Whether you also need a Data Protection Impact Assessment depends on the risk. Article 35 GDPR requires one where processing is likely to result in a high risk, in particular when using new technologies, and lists large-scale processing of special category data among its examples.

What are the limits and risks?

The biggest operational risks are model servers reachable from the whole network, retrieval without permission checks, forgotten logs and backups, and the belief that a local model is safe by default. Some limits cannot be fully engineered away: outputs remain hard to explain, and the model can still produce wrong statements about people.

Transparency stays limited. The DSK notes that RAG makes the model's input traceable but does nothing for transparency about the model itself. It is also not possible to explain why a given chunk received a particular embedding.

Accuracy is not guaranteed. In the DSK's assessment, RAG can reduce hallucinations to a certain extent, but it cannot fully rule out incorrect personal data in the output. When answers concern individuals, show the source and have a person check before anything leaves the organisation.

Purpose limitation can break silently. The DSK warns that data from the vector database can combine with personal data contained in the model, and that this may not be visible in the output. That argues for narrowly scoped applications rather than a single assistant that knows everything.

Attacks on the retrieval layer. The guidance mentions membership inference and data poisoning attacks against data in the RAG subsystem. Anyone who can write to the knowledge base can influence answers, so write access to sources is a security matter.

Fine-tuning on company data. Training a model on personal data gives up selective deletion. Only take that step when it is clearly necessary, and assess it first.

When self-hosting is the wrong choice. If you lack the people and processes for patching, access management and monitoring, a well-contracted service that processes data within the EU may carry less risk. A neglected server in your own building does not protect data better than a well-run service under a clear processing agreement.

How do you get started?

Start with one narrowly defined application where you can name the purpose, the sources and the user groups. Build permission filtering, logging rules and deletion jobs into it from day one, and only then add more sources.

A workable sequence for the first weeks:

  • Inventory: planned sources with the groups of people in them, existing permissions and retention rules.
  • Architecture sketch: the data flow from prompt to backup, with every storage point.
  • Operating rules: what is logged, who reads logs, which retention periods apply, who handles data subject requests.
  • Technical baseline: model server not open on the network, authentication on the interface, permission filter in the retriever, encrypted disks, tested deletion.
  • Documentation: entry in the record of processing, description of measures, and a reasoned decision on the impact assessment.
  • Role-based testing: two or three test accounts from different departments asking targeted questions about content they must not see.

In our own operations, it has worked well to turn the permission check into an automated test that runs whenever a source is added. A test account without access asks a question whose answer exists only in a restricted document, and the test fails if the system answers it.

If you plan to use local models for business processes rather than search alone, look at AI agents for knowledge management and at how a fractional head of AI can structure the rollout. The legal groundwork, including lawful basis, transparency obligations and data subject rights, is covered in GDPR and AI agents at work. This guide adds the practical side: how to implement it in your own infrastructure.

Frequently asked questions

Do I need a data processing agreement for a self-hosted model?

Usually not with the model publisher, as long as the weights only run on your hardware. If a hosting company, data centre operator or IT contractor runs the machines or has remote access, check whether an Article 28 GDPR contract is required.

Do vector embeddings count as personal data?

They can, because they are stored with, or linked to, the text chunks they were created from. Treat them like the source documents and apply the same permissions and retention periods.

Is a DPIA required for an internal AI assistant?

It depends on the risk, not on where the server sits. Large-scale processing of health or HR data, or preparing decisions about individuals, points strongly towards a Data Protection Impact Assessment under Article 35.

Can I remove a person from a local model?

Not reliably from the model weights, but you can from the document store, the vector database and the logs. That is why personal data belongs in the retrieval layer rather than in a fine-tuned model.

Is keeping the model server on the internal network enough?

No. A private network does not replace authentication, roles or logging. Without them, anyone with network access can retrieve every answer the system is able to give.

Sources

  1. EDPB: Opinion 28/2024 on certain data protection aspects related to the processing of personal data in the context of AI models edpb.europa.eu
  2. German Data Protection Conference (DSK): Guidance on generative AI systems using RAG, version 1.0, October 2025 (in German) datenschutz-berlin.de
  3. Article 5 GDPR – Principles relating to processing of personal data dsgvo-gesetz.de
  4. Article 17 GDPR – Right to erasure dsgvo-gesetz.de
  5. Article 25 GDPR – Data protection by design and by default dsgvo-gesetz.de
  6. Article 28 GDPR – Processor dsgvo-gesetz.de
  7. Article 30 GDPR – Records of processing activities dsgvo-gesetz.de
  8. Article 32 GDPR – Security of processing dsgvo-gesetz.de
  9. Article 35 GDPR – Data protection impact assessment dsgvo-gesetz.de
  10. Ollama FAQ docs.ollama.com
  11. vLLM: vllm serve CLI reference docs.vllm.ai