Data Privacy Basics

Updated · 7 min read
easyPython 3.13aidataprivacypersonal-dataconsentbeginnersinterview

Whose data is it, anyway? Advitha's coaching center wants to build an app that predicts which students need extra help. It has years of records: names, phone numbers, marks, attendance, even notes about health. The data could really help students, but every row is about a real person who never expected it to train an AI system.

Much of the data AI learns from is about people. This lesson covers the basics of handling it responsibly: what counts as personal data, why consent and purpose matter, and how to share less.

Personal, Sensitive and Non-Personal Data

Four kinds of data, and four questions to ask
KindExamplesWhy it matters
Personal dataName, phone number, address, email, a photo of a faceIt identifies a person, alone or combined with other data
Sensitive personal dataHealth, money, religion, biometrics such as fingerprints, children's dataMisuse can cause serious harm, so it needs extra care
Data collected around youCamera video, location history, app activityPeople often don't notice it being collected
Non-personal dataAverage prices, weather readings, totals with no namesIt can't identify anyone, so it is usually safe to share

Data can identify someone even without a name. A postcode, a birth date and a school together can point to one person. That is why removing the name column is not always enough.

Consent means people knowingly agree to their data being collected and used. Purpose means the data is used only for what they agreed to. Advitha's coaching center collected phone numbers to send class updates; using them to train a model is a new purpose, and it needs a new, clear agreement.

Good practiceWhat it looks like
Ask clearlyPlain words about what is collected and why, not hidden in long terms
Collect only what you needNo phone numbers if the task only needs marks
Use it only for the stated purposeClass updates stay class updates
Protect itLimited access, passwords, encryption
Let people see, correct or delete itA simple way to ask

Share Less: Remove What the Task Doesn't Need

The safest personal data is the data you never share. Before using data for analysis or AI, keep only the fields the task needs and replace names with anonymous IDs:

Python
students = [
    {"name": "Navika", "phone": "00000 00001", "marks": 91},
    {"name": "Srihitha", "phone": "00000 00002", "marks": 84},
]
 
# Keep only what the task needs: an anonymous ID and the marks
shared = [{"student": f"S{i + 1}", "marks": s["marks"]} for i, s in enumerate(students)]
print(shared)
Output
[{'student': 'S1', 'marks': 91}, {'student': 'S2', 'marks': 84}]

The marks are still useful for analysis, but names and phone numbers never leave. Replacing identifiers like this is called pseudonymization; it lowers the risk, but someone with the original list could still match the IDs back, so the data still needs protecting.

Laws Differ, Principles Don't

Many countries have data protection laws, as of November 2026. Two well-known ones are the European Union's General Data Protection Regulation (GDPR) and India's Digital Personal Data Protection Act, 2023. Their details differ, and this lesson is not legal advice, but the core ideas are shared: collect with consent, use only for the stated purpose, collect no more than needed, protect it, and respect people's rights over their own data.

Common Mistakes

Thinking public data is free to use for anything. A photo posted publicly was shared for people to see, not necessarily to train a model.

Thinking removing names makes data anonymous. Other fields together can still identify someone.

Collecting everything "just in case". Every extra field is extra risk, and many laws require collecting only what is needed.

Pasting personal data into AI tools. What you type may be stored by the service; "Privacy: What Not to Share with AI" covers this in detail.

Interview Corner

What is personal data?

Any information that identifies a person, directly, like a name or a photo of a face, or indirectly, like a combination of postcode, birth date and school. Sensitive personal data, such as health or financial information, needs extra protection.

What do consent and purpose limitation mean?

Consent means people knowingly agree to their data being collected and used. Purpose limitation means the data is used only for what they agreed to; a new use, such as training an AI model, needs a new basis such as fresh consent.

Practice

Exercise: plan a privacy-safe dataset. Advitha's coaching center wants to predict which students need extra help. List the fields you would keep, remove or replace with an ID, from: name, phone number, marks, attendance, health notes, parent's income and city. Then write the one-paragraph consent message you would show students, in plain words.

Check your understanding:

  1. Give two examples of personal data and two of sensitive personal data.
  2. Why might removing names not be enough to protect people?
  3. What is the difference between consent and purpose?

Quick check: data privacy basics

4 questions
1Which of these is sensitive personal data?
2A shop collected phone numbers for delivery updates. Can it use them to train a marketing model without asking?
3Why isn't removing names always enough to make data anonymous?
4What is the safest way to handle personal data a task doesn't need?

Key Takeaways

Quick reference

TermMeaning
Personal dataInformation that identifies a person
Sensitive personal dataPersonal data whose misuse can cause serious harm
ConsentPeople knowingly agreeing to how their data is used
Purpose limitationUsing data only for the purpose people agreed to
Data minimizationCollecting and keeping only what the task needs
PseudonymizationReplacing identifiers, such as names, with IDs

Was this tutorial helpful?

Lesson 12 of 186