How do you protect sensitive data when using AI?
In an AI system, data is copied to several places: input, search index, model context, logs, backups. Protecting it means classifying the data, sending as little as possible, carrying access rights into search and putting every provider under contract, as the Swiss data protection act requires.
One piece of data, several copies
In an AI system, data does not pass through once: it is copied. The text typed by the user, the documents indexed for search, the context sent to the model, the answer, the technical logs, the backups, sometimes the test sets. Each of these places has its own lifetime and its own set of people with access. Protecting sensitive data means knowing all of them, then applying the same rules to each.
Whether data leaves the company, and how to avoid it, is covered in Using AI without sending out your data. This article covers the rest: what has to be organised, whether the model runs on your premises or elsewhere.
1. Classify before choosing
Protection depends on the nature of the data, not on the tool. A simple written classification settles most cases:
| Class | Examples | Rule for use with AI |
|---|---|---|
| Public | Website, catalogue, press releases | Any service, including consumer ones |
| Internal | Procedures, project notes | Professional service under contract, no reuse for training |
| Personal | Names, addresses, correspondence with clients | Data processing agreement, known place of processing, limited retention |
| Sensitive under the FADP | Health, opinions, criminal or administrative proceedings and sanctions, social assistance measures (Art. 5(c)) | Consider an impact assessment; local processing or a dedicated instance preferred |
| Under secrecy | Files of lawyers, notaries, doctors (Art. 321 SCC); confidentiality promised by contract | First check that the secrecy obligation allows the data to be entrusted to a third party; otherwise, local processing |
A document takes the class of its most sensitive content.
2. Minimise
The Swiss Federal Act on Data Protection (FADP) requires proportionality and purpose limitation: data is destroyed or anonymised as soon as it is no longer needed (Art. 6). It also requires this to be built in from the design of the processing (Art. 7). In practice:
- Send the model the relevant excerpt, not the whole file.
- Remove fields unrelated to the task: an AHV number does not help summarise a letter.
- Do not index "the whole server" for document search: choose the folders that are actually useful.
- Pseudonymise where possible, bearing in mind that pseudonymised data remains personal for whoever holds the mapping table.
3. Carry access rights into search
A RAG index brings together documents that had different permissions in the file system. Without precautions, the assistant may hand an employee a passage from a file they could never have opened. OWASP, in its reference list of risks for large language model applications, ranks sensitive information disclosure second (LLM02:2025) and recommends, for retrieval, permission-aware indexes and strict partitioning of datasets (LLM08:2025).
- Filter passages according to the user's rights before they reach the model, not afterwards.
- Separate indexes by client or matter when secrecy requires it.
- Test with a restricted account: what it must not see must not come back.
4. Logs and retention
The logs of an AI application often contain complete questions and answers, and therefore personal data. You need to decide what is logged (metadata is often enough), who can read it and for how long. For automated processing of sensitive data on a large scale, where preventive measures are not sufficient, the Data Protection Ordinance requires logging of at least storage, modification, reading, disclosure and deletion, and keeping these logs for at least one year, separately from the system (Art. 4 DPO).
Retention follows two rules that pull in opposite directions: delete what is no longer needed (FADP), keep accounting records and vouchers for ten years (Art. 958f of the Code of Obligations). When a document is deleted at the source, it must also disappear from the search index, then from the backups as they rotate.
5. Contracts, cross-border transfers and professional secrecy
Entrusting processing to a provider — a host, a model provider, an integrator who accesses the data — is processing by a processor. The FADP allows it if a contract or the law provides for it, if the provider only does what you could do yourself, and if no legal or contractual duty of confidentiality prohibits it (Art. 9). You must ensure that the processor guarantees data security; it may only subcontract with your prior authorisation, and it must notify you as soon as possible of any data security breach (Art. 24).
Disclosure abroad follows Articles 16 and 17: a country recognised by the Federal Council, appropriate safeguards such as standard contractual clauses, or an exception provided by law. On complaint, the FADP punishes with a fine of up to CHF 250,000 any person who intentionally entrusts processing or discloses data abroad without meeting these conditions (Art. 61).
Professional secrecy (Art. 321 of the Swiss Criminal Code) is not settled by a contract with the provider: the condition in Art. 9 says as much. For a law firm or a medical practice, whether a third party may process the files is decided before any technical choice, with the professional body or a lawyer. The same reasoning applies to confidentiality promised by contract, which is common among fiduciaries.
When an impact assessment is required
If the planned processing is likely to involve a high risk — the law cites large-scale processing of sensitive data and mentions the use of new technologies — an impact assessment is mandatory before starting (Art. 22). In May 2025 the Federal Data Protection and Information Commissioner (FDPIC) recalled that the FADP applies directly to AI-based processing and requires transparency about purpose, functioning and data sources; in its view, people have the right to know they are dealing with a machine. The law also requires informing the person concerned of a decision taken exclusively by automated means that has legal effects on them or significantly affects them (Art. 21).
Limitations
- No technical measure corrects a badly chosen purpose. If the use itself is not justified, encryption and partitioning change nothing.
- Automatic detection is incomplete. A pseudonymisation filter misses names, and context is sometimes enough to identify a person.
- A contract cannot be verified technically. A no-retention promise is put in writing and checked by audit, not by measurement.
- Shadow use escapes everything. An employee who pastes a file into a consumer service bypasses the whole set-up; written rules and training are part of the protection.
- This article is not legal advice. It describes the framework; a sensitive case should be validated by a data protection specialist.
Frequently asked questions
Which data is "sensitive" under the Swiss data protection act?
The law lists it in Art. 5(c): notably data on health, the intimate sphere, racial or ethnic origin, religious, philosophical, political or trade union views, genetic and biometric data, criminal and administrative proceedings and sanctions, and social assistance measures.
Does an AI project require an impact assessment?
It is mandatory if the processing is likely to involve a high risk, for example large-scale processing of sensitive data (Art. 22 FADP). For an assistant that only works on internal procedures without personal data, the question generally does not arise.
Is an AI provider a processor under the Swiss data protection act?
Yes, if it processes personal data on your behalf. You then need a contract, assurance that it guarantees data security, and your prior authorisation for any further sub-processor (Art. 9 FADP).
How long should the logs of an AI application be kept?
As briefly as the purpose allows. For certain large-scale processing of sensitive data, however, the Data Protection Ordinance requires logging kept for at least one year; it records who did what and when, not necessarily the content of the exchanges.
Related articles
Sources
- Loi fédérale sur la protection des données (LPD, RS 235.1) — https://www.fedlex.admin.ch/eli/cc/2022/491/fr
- Ordonnance sur la protection des données (OPDo, RS 235.11) — https://www.fedlex.admin.ch/eli/cc/2022/568/fr
- Code pénal suisse, art. 321 (secret professionnel) — https://www.fedlex.admin.ch/eli/cc/54/757_781_799/fr
- Code des obligations, art. 958f (conservation des livres) — https://www.fedlex.admin.ch/eli/cc/27/317_321_377/fr
- PFPDT, La loi actuelle sur la protection des données est directement applicable à l'IA (8.5.2025) — https://www.edoeb.admin.ch/fr/update-loi-actuelle-applicable-ia
- OWASP, LLM02:2025 Sensitive Information Disclosure — https://genai.owasp.org/llmrisk/llm022025-sensitive-information-disclosure/
- OWASP, LLM08:2025 Vector and Embedding Weaknesses — https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/