Cyberpediaby Brain

Anonymising or pseudonymising before asking an AI

Replacing a name with a code does not make data anonymous. What CNIL, ANSSI and the NCSC say before you paste a text into an AI.

On this page
  1. 1In 30 seconds
  2. 2What it is
  3. 3Straight answers
  4. 4How it works
  5. 5What you do
  6. 6Pitfalls
  7. 7Sources
  8. 8Cite this article

In 30 seconds

Where it happens
When you copy a document, sometimes a very long one, into the prompt of an AI tool to get an answer about its content[3].
What is at stake
The query is visible to the organisation providing the tool, it is stored, and it will almost certainly be used to develop the service or the model[3].
The reflex
Paste only what is necessary, remove the details that allow cross-referencing, and never send sensitive data to a public online AI tool[1][4].

What it is

Replacing a name with a code before pasting a text into an AI tool feels like it protects the person. According to CNIL, the French data protection authority, this step is pseudonymisation, and pseudonymised data remains personal data[1].

The weak point is cross-referencing. Even without a name, third-party data or rare values (an age, an address) can be enough to find someone[1]. The European data protection authorities have set three criteria for judging whether a dataset is truly anonymous[1][2].

Straight answers

What is the difference between anonymising and pseudonymising?

Anonymisation makes it impossible, in practice, to identify the person by any means whatsoever, and irreversibly[1]. Pseudonymisation replaces directly identifying data (surname, first name) with indirectly identifying data, such as an alias or a sequential number[1].

This operation is reversible. It is very often possible to find the identity of the people through third-party data, so the data concerned remains personal[1]. The G29, which brings together the European data protection authorities, points out that pseudonymised data is not anonymous data[2].

If I replace a name with a number, is the text anonymous?

No. CNIL gives the example of a CV database where only the surname and first names have been replaced by a number that matches only one person: this database makes it possible to single out the person, so it is pseudonymised, not anonymised[1].

What are the three G29 criteria?

They are used to check that a dataset is anonymous[1][2]:

  • Singling out: is it possible to isolate an individual in the data?[1][2]
  • Linkability: is it possible to link together distinct datasets concerning the same individual?[1][2]
  • Inference: can information about an individual be deduced?[2] CNIL specifies: with near certainty[1].

A dataset that allows no singling out, no linking and no inference is a priori anonymous. If even one of these criteria is not met, it can be considered anonymous only after a detailed analysis of the re-identification risks[2].

Is deleting a few fields enough?

No, that is not enough either. CNIL advises deleting the direct identifiers, but also the rare values that would allow easy re-identification. It cites age, which makes it very easy to find centenarians[1].

Does the AI tool keep what I write to it?

In 2023, the UK's NCSC stated that an AI model did not automatically add users' queries to its model, but that these queries were visible to the provider and stored[3]. ANSSI notes that, for most services, the data sent is collected and used by the provider to optimise the models[4].

How it works

CNIL groups anonymisation techniques into two families[1]. Randomisation modifies attributes to make them less precise while keeping the overall distribution; it protects against inference, and CNIL cites the permutation of birth dates[1]. Generalisation changes the scale of attributes so that they are shared by a group of people; it prevents singling out and limits linking, for example by replacing a birth date with the year alone[1].

CNIL's checklist for designers of AI systems points the same way: it recommends favouring less intrusive formats, for example an age bracket rather than a full birth date[5].

ENISA devoted two reports to pseudonymisation: the first, published in January 2019, explores the concept and various techniques[6]; the second, from January 2021, studies advanced solutions for more complex scenarios[7].

What you do

  • Paste only what is necessary. As a precaution, ANSSI asks that sensitive data of the organisation never be included in queries to an online generative AI service[4]. It counts as such data personal information (contact details, private information), contractual, legal and financial data, and IT secrets such as passwords or API keys[4].
  • Remove the details that can be cross-referenced: rare values, precise age, full birth date[1][5]. A name replaced by a code is not enough[1].
  • Do not submit to a public tool a query that would be a problem if it became public. This is the NCSC's recommendation[3].
  • For sensitive data, ANSSI rules out public tools such as ChatGPT, Gemini, Copilot, DeepL or Perplexity[4]. The NCSC adds that private models exist, offered by a cloud provider or hosted in-house, but that the terms of use and privacy policy of a cloud-provided model must be understood[3].

Pitfalls

  • The code that replaces the name: it singles out the person instead of protecting them[1].
  • Cross-referencing with other data. A database of addresses cannot be considered anonymous if other databases contain the same addresses with identifying data[1]. ANSSI also lists re-identification by cross-referencing with other datasets among the attacks against anonymised data[4].
  • Inference. In CNIL's example, a tax dataset shows that all the men aged 20 to 25 who responded are not taxable: if you know that Mr X, aged 24, responded, you deduce that he is not taxable[1].
  • Sensitivity that comes from who is asking. The NCSC cites the case of a chief executive who asks how to dismiss an employee, and points out that information accumulates from one query to the next under the same identifier[3].
  • Leaks. Stored queries can be hacked, leaked or accidentally made public, and the operator of the tool can be bought by an organisation with a different approach to privacy[3].
  • Anonymity that wears out. Anonymisation and re-identification techniques evolve, which requires regular monitoring from anyone who claims to have anonymised[1][2].

Sources

  1. CNIL, “L’anonymisation de données personnelles”, 19 May 2020. https://www.cnil.fr/fr/technologies/lanonymisation-de-donnees-personnelles (accessed 14 November 2026)
  2. CNIL, “Le G29 publie un avis sur les techniques d’anonymisation”, 25 January 2016. https://www.cnil.fr/fr/le-g29-publie-un-avis-sur-les-techniques-danonymisation (accessed 14 November 2026)
  3. NCSC (UK), “ChatGPT and large language models: what's the risk?”, 14 March 2023. https://www.ncsc.gov.uk/blog-post/chatgpt-and-large-language-models-whats-the-risk (accessed 14 November 2026)
  4. ANSSI, “Security recommendations for a generative AI system”, 29 April 2024. https://messervices.cyber.gouv.fr/documents-guides/security_recommandations_for_a_generative_ai_system.pdf (accessed 14 November 2026)
  5. CNIL, “Développement des systèmes d'IA : Que faut-il vérifier ?”. https://www.cnil.fr/sites/default/files/2025-07/ia_liste_de_verification.pdf (accessed 14 November 2026)
  6. ENISA, “Recommendations on shaping technology according to GDPR provisions - An overview on data pseudonymisation”, 28 January 2019. https://www.enisa.europa.eu/publications/recommendations-on-shaping-technology-according-to-gdpr-provisions (accessed 14 November 2026)
  7. ENISA, “Data Pseudonymisation: Advanced Techniques and Use Cases”, 28 January 2021. https://www.enisa.europa.eu/publications/data-pseudonymisation-advanced-techniques-and-use-cases (accessed 14 November 2026)