Data privacy and security define how you collect, store, and use information without harming people or breaking laws. For anyone studying the Salesforce AI Associate exam, these principles matter because AI models are only as trustworthy as the data they learn from and the safeguards around that data. Mastering privacy and security basics helps you answer exam questions about responsible AI and protects real customers from harm.
Jump to a section
A simple way to picture Data Privacy and Security for AI
Because a restaurant opens a shared kitchen to several chefs, each using the same fridge and pantry, it leads to strict rules about labelling ingredients and keeping raw chicken separate from ready-to-eat salad.
In this shared kitchen, every chef must write their name and date on every container they put in the fridge. A chef who brings in a bag of onions cannot use another chef's butter without asking first. The head chef audits the fridge weekly, looking for unlabelled containers or food past its use-by date. If a chef leaves an open tin of tomatoes too long, the head chef throws it out and sends the chef a note reminding them of the rules.
This mirrors data privacy and security for AI. The kitchen is a company's data store. The chefs are different AI models or teams training models. The labelled containers are datasets with clear consent tags and access permissions. The raw chicken rule is like personally identifiable information (PII) that must stay isolated from general training data. The head chef's audit is the data governance team checking that no model uses data it shouldn't. If a chef uses the wrong ingredient, the soufflé collapses — if an AI model trains on private data without consent, it breaks privacy law and erodes trust. The shared kitchen works only when everyone follows the rules, just as safe AI relies on disciplined data handling.
Data privacy and security for AI are two different but connected ideas. Data privacy is about respecting people's rights over their own information — who can see it, how it can be used, and when it must be deleted. Data security is about protecting that information from being stolen, lost, or changed by someone who shouldn't have access. Together, they form the foundation of trustworthy AI.
When an AI model learns from data, it can accidentally memorise private details about individuals, even if the data was supposed to be anonymous. For example, a language model trained on customer support chats might learn a person's phone number and later repeat it in a response. This is a privacy leak. To prevent this, companies use techniques like data masking (replacing real sensitive values with fake ones) and differential privacy (adding a small amount of random noise to data so the model cannot identify any single person).
Security for AI introduces additional risks. Traditional security protects a database or a server. AI security must also protect the training process and the model itself. Attackers can try to extract training data from a model by carefully crafting prompts. They can also try to poison the training data by sneaking in corrupted examples that cause the model to behave badly. For instance, a fraud-detection AI could be trained on data that includes fake transactions, making it miss real fraud. This is called a data poisoning attack.
Consent is a core principle of data privacy. Under regulations like the UK General Data Protection Regulation (UK GDPR), companies must get clear, explicit permission from people before using their data for AI training. This permission must be specific — you cannot ask for consent for one purpose and then use the data for AI training without asking again. People also have the right to request that their data be deleted, which means the company must remove it from both the database and any trained model, which is technically difficult for many AI systems.
Purpose limitation is another key principle. You can only use data for the reason you originally collected it. If you collected email addresses to send newsletters, you cannot feed them into an AI model to predict customer churn without getting new consent. Data minimisation says you should only collect the minimum amount of data needed. For AI, this means carefully selecting which fields to include in training data rather than dumping every available column.
Access control is a practical security measure. Not everyone in an organisation should be able to see training data or modify models. Role-based access control (RBAC) lets companies define who can read data, who can write to the training pipeline, and who can deploy models. Multi-factor authentication (MFA) adds a second check, like a code sent to a phone, before someone can access sensitive systems. Encryption keeps data unreadable if it is stolen — both when stored (at rest) and when travelling over the internet (in transit).
Audit trails record every action taken on data and models. If a privacy breach happens, the audit trail shows exactly who accessed the data, when, and what they did with it. This is critical for proving compliance with regulations and for identifying the source of a security incident. Finally, model explainability tools help data scientists check whether a model is making fair, unbiased decisions, which protects against unintentional discrimination based on protected characteristics like race or gender.
Identify Data Sources
List every system that holds data you might use for AI training. For each source, document what type of data it contains (e.g., customer names, purchase amounts, chat logs) and how the data was originally collected.
Review Consent and Legal Basis
Check the privacy policy and consent records for each data source. Confirm that the original collection purpose covers AI training. If it does not, stop and obtain new consent or find a different legal basis before proceeding.
Apply Data Minimisation
Remove any fields that the model does not need. For example, drop exact birth dates, full addresses, and national insurance numbers. Keep only the minimum set of attributes required for the prediction task.
Mask or Anonymise PII
Replace personally identifiable information (PII) like names, email addresses, and phone numbers with fake values or tokens. Use techniques like hashing or differential privacy to ensure individuals cannot be re-identified from the training dataset.
Set Access Controls and Logging
Configure RBAC so only specific roles (e.g., data engineer, data scientist) can access the training data. Enable audit logging to record who accesses the data, when, and what changes they make. Require MFA for any privileged actions.
Train and Monitor for Privacy Leaks
During model training, monitor for signs of data memorisation, such as the model being able to repeat training examples verbatim. After deployment, continuously audit model outputs for accidental disclosure of sensitive information.
An IT professional working with AI in a company like a mid-sized retailer would start by reviewing the data privacy policy for customer information. Suppose the retailer wants to build an AI model that predicts which customers are likely to return items. The data team first identifies all the data sources: purchase history, returns history, customer service calls, and website clicks. They check each source to confirm that customers consented to their data being used for AI analysis. If the original sign-up form only mentioned 'improving shopping experience', the retailer may need to send a new consent request.
Next, the team applies data masking to remove personally identifiable information. They replace customer names with random IDs, obfuscate phone numbers and email addresses, and strip out exact home addresses. Only the region or postcode area is kept so the model can still learn geographical patterns. They also check for data minimisation — if the model doesn't need a customer's birthday year, that column is dropped.
Access is restricted using RBAC. The data engineer can read the raw data. The data scientist can only see the masked dataset in a secure development environment. The model is trained in a sandboxed environment that does not have internet access, preventing the model from sending data outside the company. The security team sets up MFA for every person who can trigger model training or deployment.
Throughout development, the team runs audit logs:
Who uploaded the training data?
Who modified the data schema?
Who trained each version of the model?
Who approved the model for production?
Who deployed it?
After the model goes live, the team monitors for data extraction attempts. If a customer asks retailers to delete their data, the team must retrace which version of the training data included that customer, retrain the model without that data, and confirm the old model is decommissioned. This is why version control for datasets and models is essential — without it, you cannot easily remove a person's data. The IT professional also runs periodic privacy impact assessments (PIAs) to evaluate whether any new feature of the AI system creates new privacy risks.
The Salesforce AI Associate exam tests data privacy and security in the context of responsible AI. You will see scenario-based questions where you must identify the correct principle or action. The exam loves concepts from the Salesforce AI Ethics framework: transparency, fairness, accountability, and privacy. Expect questions about data consent, data masking, differential privacy, and access control.
A common trap question presents a scenario where a company uses customer purchase history to train a model. The question will say the company collected the data for order processing. The trap answer is that this is okay because the company already has the data. The correct answer is that the company needs explicit consent for the new purpose (AI training) because of purpose limitation.
Another trap involves data minimisation. A question might list a dataset with dozens of fields, including sensitive ones like social insurance numbers or health data. The wrong answer says these are fine as long as the model is accurate. The right answer says they should be removed because the model does not need them and collecting them violates data minimisation.
Exam concepts to memorise:
Data masking: replacing real sensitive data with realistic but fake values.
Differential privacy: adding mathematical noise so individual records cannot be identified.
Purpose limitation: using data only for the reason it was collected.
Data minimisation: collecting only the minimum necessary data.
Consent: explicit permission for a specific use.
RBAC: restricting system access based on job role.
Encryption: scrambling data so it is unreadable without a key.
Audit trails: logs that record every action for compliance and investigations.
Explainability: tools to understand why a model made a decision.
PIA: assessment that identifies and mitigates privacy risks before deployment.
The exam often presents a story about an AI assistant or a predictive model and asks which ethical principle is being violated. Look for clues in the story: if the story mentions a model treating different groups unfairly, the answer is 'fairness'. If it mentions unknown use of personal data, the answer is 'privacy' or 'consent'. If it mentions the company not explaining why a loan was denied, the answer is 'transparency' or 'explainability'. You will also see direct questions like 'What is the purpose of data masking?' with multiple choices. The answer is 'to protect PII while keeping data usable for model training.'
Data privacy is about people's rights over their information; data security is about protecting that information from theft or loss.
You must get explicit, specific consent before using data for AI training, even if you already own the data for another purpose.
Data masking replaces real sensitive values with fake ones to protect PII while keeping data useful for model training.
Differential privacy adds random noise to prevent models from memorising individual records.
Role-based access control (RBAC) ensures only authorised people can view or modify training data and AI models.
Audit trails record every action on data and models, which is critical for compliance and incident investigation.
Data minimisation means you should only collect the fields necessary for the AI task — avoid hoarding unnecessary sensitive data.
Explainability tools help check that AI models are fair and not making decisions based on biased or irrelevant data.
Privacy Impact Assessments (PIAs) must be completed before deploying AI systems that use personal data.
These come up on the exam all the time. Here's how to tell them apart.
Data Privacy
Focuses on individuals' rights over their data
Governs how data can be collected, used, and shared
Breaches involve violating consent or purpose
Data Security
Focuses on protecting data from threats
Governs who can access data and how it is stored
Breaches involve theft, loss, or unauthorised access
Data Masking
Replaces real data with fake values statically
Applied before training, no mathematical guarantee
Does not protect against re-identification from other columns
Differential Privacy
Adds random noise dynamically during training
Provides a mathematical guarantee of privacy
Reduces accuracy as trade-off for privacy
Role-Based Access Control (RBAC)
Defines what each user can access based on role
Does not verify user identity beyond password
Requires setup and maintenance of roles
Multi-Factor Authentication (MFA)
Verifies identity with an extra factor (e.g., phone code)
Works independently of role definitions
Adds friction but greatly reduces unauthorised access
Consent for AI Training
Must be explicit and specific to AI use
Often obtained via a separate opt-in
Can be withdrawn at any time, requiring data removal
Consent for Original Purpose
Often broad, covering general service delivery
Rarely includes machine learning or model training
Revoking does not always require model retraining
Mistake
Anonymising data by removing names is enough to make it safe for AI training.
Correct
Removing names alone does not anonymise data — other fields like postcode and birth date can uniquely identify people when combined (re-identification risk). True anonymisation requires techniques like differential privacy or k-anonymity.
People think removing obvious identifiers solves privacy, but they forget that combinations of non-obvious fields can still pinpoint an individual.
Mistake
If a company has collected data, it can automatically use that data to train an AI model.
Correct
Using collected data for AI training requires explicit consent for that specific purpose, unless a different legal basis exists. The original collection purpose usually does not cover AI training.
Many assume ownership of data means unlimited use, but privacy regulations separate collection purpose from new uses like machine learning.
Mistake
Encryption guarantees complete security for AI data.
Correct
Encryption protects data from being read if stolen, but it does not protect against other threats like data poisoning, model extraction, or unauthorised access by someone with valid credentials.
Encryption is a powerful tool but often misunderstood as a silver bullet — people overlook that security requires multiple layers, not just encryption.
Mistake
Differential privacy is just about keeping data secret.
Correct
Differential privacy adds controlled noise to data or model outputs so that an attacker cannot tell whether any specific individual contributed to the dataset. It balances privacy with accuracy rather than simply hiding data.
The name 'differential privacy' sounds like it is about secrecy, but it is actually about mathematically limiting information leakage while still allowing useful analysis.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Data privacy is about how data is collected, used, and shared with respect for individuals' rights. Data security is about protecting data from unauthorised access, theft, or damage. Privacy is useless without security, but security alone does not guarantee privacy.
Generally no, because the original consent for CRM data usually covers customer service and sales activities, not AI model training. You need to obtain new, specific consent unless a different legal basis applies.
Data masking replaces real sensitive values (like a customer's real name or phone number) with realistic but fake values so the AI model can learn patterns without exposing actual personal information.
Yes, usually there is a trade-off. Adding more noise increases privacy protection but reduces model accuracy. The goal is to find a balance where privacy is meaningfully protected while the model remains useful.
You must remove their data from the training dataset and retrain the model without that data. This is technically challenging and expensive, which is why data minimisation and consent management are critical before training starts.
A PIA is a structured process to identify and mitigate privacy risks before launching a new AI system that uses personal data. It is often required by law and helps catch issues early.
You've finished Data Privacy and Security for AI. Continue through the AI Associate study guide to build a complete picture of the exam.
Done with this chapter?