Can You Use Production Data in a Salesforce Sandbox Under GDPR?
GDPR doesn't specifically ban production personal data in a Salesforce sandbox, but it doesn't treat a sandbox copy as free either. Copying personal data is processing, so data minimisation, purpose limitation and security of processing all apply. In practice, most teams mask, subset or synthesise the data rather than copy it raw.
Not legal advice. This post explains general GDPR principles as they apply to test environments. It isn't legal advice and can't account for your lawful basis, contracts, or risk assessment. Talk to your DPO or counsel before settling on an approach.
Does GDPR allow production data in test environments?
GDPR has no rule specifically about test environments. It regulates processing of personal data, and copying production records into a sandbox counts as processing. The copy needs the same justification and protection as the original, and the principles below apply to it directly. Some teams can justify production-realistic data for a specific purpose, such as reproducing a defect that only shows up with real data. It's much harder to justify copying the whole org by default because a refresh is scheduled.
Which GDPR principles apply to Salesforce sandboxes?
Four parts of the regulation come up most often when planning sandbox data. All quotes are from the GDPR text.
- Purpose limitation (Art. 5(1)(b)). Personal data must be "collected for specified, explicit and legitimate purposes and not further processed in a manner that is incompatible with those purposes." Customers gave you their data to buy something or get support, not so it could be used as test fixtures. Whether testing counts as compatible further processing is exactly the question to put to counsel.
- Data minimisation (Art. 5(1)(c)). Data must be "adequate, relevant and limited to what is necessary." If a test only needs the shape of a Case and its related records, the customer's real email address isn't necessary.
- Data protection by design and by default (Art. 25). Controllers must implement measures "such as pseudonymisation" that put principles like minimisation into practice, and must ensure that "by default, only personal data which are necessary for each specific purpose" are processed. That covers amount, storage period and accessibility.
- Security of processing (Art. 32). Controllers and processors must ensure security "appropriate to the risk," explicitly including "the pseudonymisation and encryption of personal data."
Sandboxes are where these principles most often break down in Salesforce projects. More people have access, including contractors and partners. Integrations point at test endpoints nobody monitors, and refresh cycles leave old copies lying around long after the project ends.
What is the difference between pseudonymisation and anonymisation?
Pseudonymised data is still personal data under GDPR, and anonymous data is not. This is the distinction that matters most for sandboxes.
Article 4(5) defines pseudonymisation as processing personal data so it "can no longer be attributed to a specific data subject without the use of additional information," provided that information is kept separately and protected. Recital 26 then says that pseudonymised data which "could be attributed to a natural person by the use of additional information should be considered to be information on an identifiable natural person." Only information that is truly anonymous, where the person "is not or no longer identifiable," falls outside the regulation.
For Salesforce, this means that masking email and phone fields reduces risk and counts as a recognised safeguard under Articles 25 and 32. It doesn't make the sandbox anonymous. The record may still hold a real company name, a job title, a free-text case description that names the customer, or a combination of fields that identifies someone. Data this rich is very hard to anonymise, and you should assume it hasn't been unless someone has actually assessed it.
What are the practical options for sandbox data?
Most teams combine several of these. They're listed roughly from least to most privacy-protective:
| Approach | Personal data in sandbox? | Keeps realism | Main risk |
|---|---|---|---|
| Raw full copy + access controls | Yes, all of it | Highest | Everything in production is exposed if the sandbox is |
| Subset (filtered copy) | Yes, less of it | High for the slice | Still real people, just fewer |
| Mask during or after the copy | Yes, pseudonymised | High | Unmasked free text and quasi-identifiers |
| Subset + mask | Yes, less and pseudonymised | High for the slice | Same as above, smaller scope |
| Synthetic data | No (if generated from scratch) | Medium | Misses real-world edge cases |
A few practical notes:
- Subset first. Filter by object and date range so the sandbox holds only what the test needs. Minimisation is easier when there's simply less data.
- Mask identifiers and free text. Email, phone and national IDs are the obvious fields, but also check names, addresses, description and comment fields, and custom fields where agents paste customer details. Our PII masking methods comparison covers the trade-offs, including Salesforce's own Data Mask add-on.
- Use synthetic data where realism isn't needed. Demos, training orgs and CI pipelines rarely need real customers. A test data generator avoids the question altogether.
- Restrict access and outbound email. Limit sandbox logins to named people and restrict email deliverability so a workflow can't email a real customer. Deprovision stale sandboxes. Our post-refresh checklist covers the steps.
- Write the decision down. Record which approach you chose and why. That record is what you'll point to when someone asks how test data is handled.
Where does Syntharil fit?
Syntharil's data masking runs during replication, so the target sandbox only ever receives masked values, and each object can be filtered with its own SOQL clause to copy just the subset you need. Masking is deterministic: a keyed transform maps the same input to the same output across every run of the same replication config, so relationships and joins stay consistent between refreshes. Email, phone and SSN/Tax-ID fields are detected automatically. Every other field, including names and free text, needs to be opted in with one of the other masking styles.
To be precise about GDPR: this is a pseudonymisation-style control. It reduces what's exposed and supports minimisation, but it doesn't make the data anonymous, and using it doesn't make you "GDPR compliant". That depends on your whole processing context.
Bottom line
You can sometimes justify production data in a sandbox, but the regulation expects you to minimise it, protect it, and not use real people's data where fake data would do. For most teams, the defensible default is synthetic data for demos and CI, a masked subset where production realism is needed, and raw copies only in rare, documented, access-restricted cases. Then have your DPO confirm the approach.
FAQ
Is masked data still personal data under GDPR?
Usually, yes. If masked values can be linked back to a person using additional information such as a key, a mapping table or the unmasked fields left in the record, the data is pseudonymised, and Recital 26 says pseudonymised data is still personal data.
Does a Full Copy sandbox count as processing personal data?
Yes. Copying personal data into another environment is itself processing, so the copy needs a lawful basis and a compatible purpose and has to be secured, just like the production original.
Is synthetic test data covered by GDPR?
Data generated from scratch that does not relate to any real person is generally not personal data. Be careful with synthetic data that is derived from real records, because it can still leak real values or patterns.
Who should decide whether our sandbox approach is compliant?
Your data protection officer or legal counsel, based on your specific processing, lawful basis and risk assessment. Engineering can supply the technical controls, but compliance is a judgement about your whole context.