Skip to content
Hands-on Mentor
ENTR
Back to blog

Is it safe to share personal data with AI? What to keep out of chatbots

Anything you type into an AI tool may be stored and reviewed. Learn which personal data to keep out, how to anonymize text, and which settings to check.

4 min read

It is not safe to share sensitive personal data with an AI tool. Text, files, and photos you send usually travel to the servers of the company that runs the tool. They may be stored for some time, and in some tools they may be used to improve the models. A safe habit is to treat the chat box as a place that other people could read. Never share ID numbers, passwords, health details, or other people's personal data.

What should you not share with AI?

Type of informationExample
Identity detailsNational ID number, passport number
Login detailsPassword, verification code, API key
Financial detailsCard number, bank account details
Health detailsA diagnosis, medicine, or test result linked to your name
Other people's dataA friend's phone number, a class list, customer details
Private documentsInternal reports from your internship, unpublished exam questions

The last two rows are easy to forget. Pasting a friend's message, a class list, or a customer table from your internship into a tool means sharing those people's data without their permission.

What are the AI privacy risks?

The details differ from tool to tool, but the general picture is similar:

  • Storage. Your conversations are kept in your account and on the company's servers. Deleting a chat may not remove the record from the servers right away.
  • Model improvement. Some tools use your conversations to improve their models by default. Others do it only if you agree.
  • Human review. For safety and quality checks, authorized staff may read a part of the conversations.
  • School or work accounts. Accounts given by an institution often follow different rules, and administrators may be able to see how you use them.
  • Leaks. Any stored data can be exposed by a mistake or an attack.

The privacy policy and the settings page of the tool tell you which of these apply.

What happens to your chatbot data?

Your data goes through the same steps in most tools: you send it, the company processes it to produce an answer, and the company may keep it. After that, the settings and the policy decide whether it is used for training, how long it is stored, and who can see it. Read these once for each tool you use regularly. Rules about personal data also differ between countries, so check the rules where you live.

How do you use AI chatbots safely?

1. Anonymize. If you want a tool to analyze a table, remove names, phone numbers, and emails, or replace them with labels like "Student 1" and "Student 2". Most questions do not need real identities.

2. Share only what you need. Give the part of the document that the question needs, not the whole document.

3. Check the settings. Many tools let you turn off chat history or choose that your conversations are not used to train models. Some offer a temporary chat that is not saved.

4. Protect your account. Use a strong password and two-step verification. Anyone who gets into your account can read your chat history.

How can you anonymize data with Python?

Here is a simple way to replace names with labels:

records = [
    {"name": "Maya Chen", "score": 85},
    {"name": "Alex Rivera", "score": 72},
]

anonymous = [
    {"name": f"Student {i}", "score": r["score"]}
    for i, r in enumerate(records, start=1)
]
print(anonymous)

The scores you need for the analysis stay, and the names are gone.

You can also mask an email address and a phone number in plain text before you share it:

import re

text = "Contact me at 555-014-2877 or maya@example.com today"
text = re.sub(r"\S+@\S+", "[email]", text)
text = re.sub(r"\d{3}-\d{3}-\d{4}", "[phone]", text)
print(text)

The output is Contact me at [phone] or [email] today. These patterns catch only these exact formats, so check the result with your own eyes before you send it.

Removing a name does not always protect a person. In a class of ten, the columns "birth year, major, and hometown" together can point to one person. Remove columns that the question does not need.

What about photos and audio?

A photo may show faces, a license plate, an envelope with a home address, or a document open on a screen. Look at what is in the picture before you upload it. If an audio recording has other people's voices, think about their permission too.

Common mistakes

  • Thinking "nobody reads it". Data can be stored, and leaks happen.
  • Sharing other people's data. Your own choice about your data does not cover anyone else.
  • Sharing keys with code. When you debug, do not paste your .env file or an API key.
  • Never checking the settings. The default settings are not always the most private ones.

What to read next

The [AI course](/courses/ai) has a lesson on [privacy and personal data](/learn/ai/privacy-personal-data). To practice the techniques in this post, try [list comprehensions](/learn/python/list-comprehension), [record lists](/learn/python/record-lists), and [regular expressions](/learn/python/regular-expressions). If you use AI to write code, read [learn to code with AI](/blog/coding-with-ai) too.

  • #ai privacy
  • #personal data
  • #chatbot safety
  • #security
All posts