Research & Analysis · Privacy and cryptography · 17 min read
Can You Use Production Customer Data in Test Environments?
Use purpose-built test data by default. Treat access to production customer data as a specific, governed exception that must justify the information required, the people and systems receiving it, and the conditions for ending that access. Replacing names, turning on masking or calling a dataset synthetic does not by itself establish that customers cannot be identified. Nor does a privacy improvement establish that the resulting data still tests the failure you need to find.
I would start with the test's decision: what must this exercise demonstrate before the software can move forward? A complete production copy may be convenient, but convenience is not evidence that every field and customer is necessary. Sometimes the test needs a particular relationship, malformed value or sequence of events that can be reproduced without anyone's real history.
This paper proposes a release process for test datasets that evaluates privacy and test usefulness separately. It draws on twelve authoritative and peer-reviewed sources, with mechanisms checked on October 29, 2026. It is an engineering assessment, not a determination of legal permission to repurpose personal data. The example is fictional, and the proposed process has not been empirically validated here. Applicable privacy, contractual and sector obligations require their own assessment before a real-data exception proceeds.
Define the defect you need to expose
“Production-like” can mean several incompatible things. A parser test needs valid and invalid syntax. A migration test needs representative relationships, constraints and historical states. A load test needs volume, skew and contention. A model evaluation may need meaningful joint distributions. A dataset can be excellent for one purpose and misleading for another.
NIST distinguishes syntactically valid test data from realistic test data and from fully synthetic data generated through a model of an original population. Its guidance specifically recognizes software-development uses and the danger of confusing fabricated test records with real confidential records (Garfinkel et al., 2023, §§4.4.2–4.4.4). Those distinctions prevent a single word, synthetic, from concealing how the data was produced.
Write an acceptance statement for each important test. For a billing migration, it might require a customer with multiple historical identifiers, a reversed payment and an invoice crossing a date boundary. That is a set of behaviors and relationships, not necessarily a requirement to preserve a real customer's identity. A fixture designed around the defect may reveal more than a large random sample that happens not to contain the relevant state.
I would ask the test owner to identify the consequence of removing each sensitive field or precision level. If no test assertion depends on a field, its inclusion needs another justification. If a real relationship is essential, ask whether a fabricated relationship with the same structural property would work. Keep the unresolved cases visible rather than declaring either that all production data is indispensable or that all generated data is an adequate substitute.
Choose the least revealing representation that supports the test
There is no single ladder on which every dataset moves neatly from dangerous to safe. Different transformations preserve different information. A small extract can still expose a rare person's complete history; a large fabricated dataset can contain no customer-derived values while failing to reproduce a critical production defect.
| Candidate representation | Useful when | Question that still needs an answer |
|---|---|---|
| Hand-built or rule-generated fixture | The test requires known formats, states and relationships | Does it include the important boundary and failure cases? |
| Model-generated synthetic data | Statistical relationships matter | What information can the trained generator or released output reveal? |
| Transformed production subset | Specific real-world structure is difficult to reproduce | What identity, linkage and inference risks remain? |
| Restricted access to a real-data environment | An exceptional test genuinely needs original values | Can the task be performed without distributing another copy? |
This table is a proposed decision aid, not a legal classification. Document how the artifact was created, including whether the generator was trained on confidential records. “No row was copied verbatim” does not resolve what the output reveals about the people whose data shaped it.
Separate reusable fixtures from exceptional diagnostic work. A one-off investigation of a difficult migration problem should not silently become a permanent seed database distributed to every developer. Conversely, a carefully designed reusable fixture can reduce repeated requests for fresh production extracts. Give the two workflows different owners, retention decisions and release criteria so an emergency workaround does not become the ordinary development architecture.
A masked screen is not a sanitized database
Microsoft describes dynamic data masking as limiting the exposure of values to nonprivileged query users. Its security note explicitly warns that users with ad hoc query permissions can infer underlying values, so masking should not be treated as sufficient protection against that form of access (Microsoft, 2025). The product's intended query behavior is different from creating a permanently transformed export.
Before approving a test copy, identify what the preparation job actually reads and writes. Does it copy original values and rely on the receiving database to mask them? Does its export identity have privileges that reveal unmasked values? Does a transformation produce a separate artifact whose contents have changed? Those are implementation questions to verify, not assumptions to make from the presence of a masking rule.
I would test the resulting artifact through the intended recipient's actual tools and privileges. A developer allowed to run arbitrary queries, inspect backups or administer the test database may have capabilities beyond the application account used in a demonstration. The release claim must match that audience. A masked screenshot establishes very little about the database file that was handed to the same person.
Also distinguish a sensitive field that was removed from one that was replaced by a reversible token. Both may be useful choices, but they have different dependencies. Retaining the original data, the tokenization service and the mapping under the same broad test-team access can undo the intended separation. The review should explain where the original remains and who can reconstruct it.
Preserve relationships deliberately without creating unnecessary links
Software tests often need a consistent customer reference across orders, refunds and support cases. Independently randomizing every occurrence can break those relationships and make the dataset useless for migration or reconciliation testing. The solution is to define which joins must survive and which should become impossible in the released fixture.
Google's pseudonymization documentation describes transformations that preserve referential integrity and distinguishes reversible encryption-based tokens from one-way cryptographic hashing. It also describes a context tweak that can influence token consistency (Google Cloud, 2026b). These are concrete mechanisms for a design decision; the mere use of a token does not establish anonymity.
A stable token can enable the intended join and an unintended one. If the same transformation domain is reused across unrelated test releases, recipients may combine histories that were meant to stay separate. I would scope consistency to the relationships the test requires, record the domain and key or mapping custody, and verify that forbidden joins are not enabled by an accidental global identifier.
Field-by-field replacement can also change meaning. If dates are shifted inconsistently, a refund may precede its purchase or a child's record may become logically incompatible with a guardian record. Preserving every original interval, however, can retain a distinctive behavioral pattern. Decide which temporal properties the test needs, then validate both the resulting invariants and the information they continue to disclose. Referential integrity is a test requirement, not a complete privacy assessment.
Names are only the beginning of the identification problem
A record can become recognizable through combinations of attributes, unusual events or information available elsewhere. Removing the obvious identifiers does not establish that the remaining pattern is shared by many people. The relevant audience may include an employee who already knows a customer's circumstances, not only an anonymous outsider.
The UK's Information Commissioner's Office recommends considering the capabilities and background information of a motivated person attempting identification, and distinguishes public release from access restricted to a defined group (Information Commissioner's Office [ICO], n.d.). Its guidance was marked under review when checked. I use that material for the technical risk questions, not as a universal legal test or a conclusion that a particular dataset is anonymous.
For a test release, consider what recipients can already access: customer tickets, operational dashboards, earlier extracts or a mapping service. A transformation that looks adequate when assessed in isolation may be inadequate in that combined environment. Access restrictions can reduce exposure, but their effectiveness depends on actual permissions and permitted outputs rather than a label saying internal use only.
Rare cases deserve particular attention because they may be both important to testing and identifying. The record that triggers a difficult edge case could also describe a unique sequence of events. Where possible, preserve the causal structure of the defect in a fabricated fixture instead of retaining the entire original history. If that substitution changes the behavior being investigated, document the limitation and use the exception process rather than weakening the privacy claim silently.
Synthetic generation requires evidence, not a safe-sounding label
Stadler et al. (2022) evaluated several tabular-data generation methods and found substantial privacy–utility tradeoffs, including uneven protection for individual records. Their experiments challenge the assumption that synthetic generation automatically solves disclosure risk. They do not establish that every possible generator, dataset or future method has the same outcome.
The distinction matters operationally. A generator trained on confidential production data is part of the sensitive processing environment even if its output contains new rows. Assess what the model, training artifacts and generated release can reveal. Do not send the raw training input to another system merely because the intended final output will be called synthetic.
I would demand evidence tied to the proposed release and use. A claim about overall similarity is insufficient if the test depends on rare state transitions. A claim that exact matches were not found is insufficient if other inference remains possible. The evaluation should disclose the generator version, source population, selected parameters, release size and known weaknesses so the result can be reproduced and revisited.
Rule-generated data that never uses customer information presents a different question. Its principal weakness may be inadequate test coverage rather than leakage from a training population. Keep that distinction visible. Requiring an elaborate disclosure study for every invented unit-test fixture would waste effort; treating a learned generator as equivalent to invented fixtures would overlook the evidence needed to justify releasing its outputs.
Attack testing and formal privacy guarantees answer different questions
Giomi et al. (2023) present Anonymeter, which evaluates singling-out, linkability and inference risks using attacks and comparison baselines. A control dataset helps distinguish population-level inference from information associated specifically with the training records. The authors also explain that an attack-based evaluation provides a lower bound on risk: its findings depend on the strength and coverage of the attacks used.
For a release decision, that means “the tested attack did not succeed” should remain a statement about that test. It is not proof that no recipient can identify anyone. Record the attack assumptions, control-set construction, uncertainty and failures to outperform a trivial baseline. An uninformative test should not produce a reassuring privacy badge.
Differential privacy offers a different type of claim. NIST emphasizes the importance of the protected unit, privacy parameters and cumulative effects of multiple analyses. Event-level protection is not automatically person-level protection when a person contributes many events (Near et al., 2025, §§2.2, 2.4). A vendor's reference to differential privacy therefore needs a precise account of what is protected and which releases and preprocessing steps fall within that account.
Neither approach decides whether the fixture finds a software defect. Formal protection can coexist with inadequate preservation of the relationship needed by a test, while useful data can remain too revealing for the proposed audience. Keep the privacy assessment and the engineering acceptance record separate, then require both to pass the applicable criteria. This paper does not prescribe a universal privacy parameter or claim that an empirical score substitutes for a formal guarantee.
Measure usefulness against assertions, not visual realism
The U.S. Census Bureau explains that synthetic datasets may not support every analysis accurately and describes validation against internal data as one response to that limitation (U.S. Census Bureau, 2021). Statistical data publication is not the same task as software testing, but it supplies an important caution: usefulness needs validation for the intended analysis rather than confidence based on realistic-looking rows.
For functional tests, I would record explicit invariants: expected joins, boundary values, invalid encodings, missing fields and state transitions. For performance tests, record the properties that affect execution, such as skew, object sizes or relationship fan-out. These are candidate criteria, not a claim that every system needs all of them. Select the properties that can change the conclusion of the actual test.
Then look for false reassurance created by the transformation. Uniform replacement strings can change compression behavior. Removing long free-text fields can change payload sizes. Breaking relationships can bypass the code path under investigation. These are illustrative failure mechanisms to examine where applicable, not measured effects in the user's environment. A test that passes because preparation removed the triggering condition has not established the software is correct.
A privacy-preserving fixture can intentionally differ from production while still answering a bounded question. Document that boundary. A successful serialization test does not establish performance at production scale; a successful aggregate model comparison does not establish correct handling of every rare record. The release process becomes more efficient when it permits several purpose-specific datasets instead of demanding one supposedly universal copy that is both maximally realistic and safe for everyone.
Transform and verify before crossing the audience boundary
Google's Sensitive Data Protection documentation separates detection configuration from the transformations applied to findings, and describes both built-in and custom detectors (Google Cloud, 2026a). That supports a practical review question: which sensitive forms can this configuration recognize, and which fields are being transformed directly rather than relying on detection?
Do not equate no findings with no sensitive content. A scan can only support a conclusion within its configured detectors, input coverage and observed execution. Inspect nested objects, free text and attachments where the application actually stores them. A field-name inventory alone can miss an identifier embedded in a diagnostic message or a structured payload stored inside another column.
I would perform preparation inside an appropriately restricted environment, validate the output there, and release only the approved artifact to the test audience. Copying raw production data into the widely accessible test system and transforming it afterward creates a period of exposure and additional copies that the final sanitized table does not describe. If a workflow must do that, it belongs in the explicit real-data exception rather than being represented as a clean transformation boundary.
Treat preparation code and configuration as release inputs. Record the source snapshot, selected fields and population, transformation version, keys or mapping references, detector configuration, validation result and destination. Use protected identifiers rather than secret values in that record. A schema change that introduces a new field should trigger review; the old transformation's success does not establish coverage of the new data.
Isolate behavior as well as data
A test database can contain values that cause actions: email addresses, webhook destinations, payment references or account identifiers. Even fabricated records can produce real effects if the application points at a production service. Data sanitization and environment isolation therefore solve complementary problems.
NIST's Secure Software Development Framework calls for separating and protecting development environments, including controls on connections and reduced reliance on production services from nonproduction environments (Souppaya et al., 2022, PO.5.1). That guidance supports reviewing the test system's service identities and outbound behavior alongside its dataset. It does not certify a specific isolation configuration.
I would use controlled test recipients and service substitutes where appropriate, then verify that the actual workflow uses them. A configuration file saying sandbox is not proof if a background worker retains a production credential or an older job reads another endpoint. Test the permitted path and the important forbidden path using harmless activity. State any production dependency that remains necessary.
Preparation should also exclude operational secrets that are not legitimate test inputs. A customer-record export may carry authentication tokens, connection details or diagnostic payloads alongside business data. Replacing names does not neutralize those capabilities. Where a test needs a secret-shaped value, use a synthetic value accepted only by the approved test system. Keep the actual credential handling separate from the personal-data transformation so neither review assumes the other removed it.
Retire the dataset's copies, not just its main table
Test data can outlive the environment that first received it. A failing test may attach a sample to a report, serialize a request into a log or leave an export in a build artifact. Review those outputs as recipients of the data. The main database's retention setting does not establish the lifecycle of each derivative.
OWASP's logging guidance identifies credentials, encryption keys and sensitive personal information as material generally unsuitable for direct recording and discusses appropriate exclusion or treatment (OWASP Foundation, n.d.). Use that as a design input for test diagnostics. An assertion failure should retain the evidence needed to reproduce the defect without casually printing the entire customer object.
Platform retention behavior also needs verification. GitHub documents that a changed organization retention period applies to newly created covered objects and does not retroactively change existing ones (GitHub, n.d.). That is a concrete example of why tightening a policy is not evidence that historical artifacts disappeared. Check the selected platform and object type instead of assuming every retention control behaves identically.
I would assign a release identifier to the dataset and track its authorized destinations, including approved diagnostic outputs. At expiry, verify removal or continued authorized retention for those copies. Where backups or immutable records remain, record the applicable access and expiry constraints rather than declaring immediate universal erasure. No generic retention duration is prescribed here. The useful evidence is which copies remain, why, who can access them and what prevents another unreviewed refresh.
Make a real-data exception specific enough to expire
There are cases where a defect cannot yet be reproduced with a fixture. A legacy parser may fail on an input the team does not understand, or a migration may depend on a historical state that the generator does not model. Treat that as a bounded diagnostic problem rather than a standing entitlement to a complete customer database.
The request should identify the test, unresolved property, minimum records and fields, access recipients, environment, permitted outputs and termination condition. The data owner and appropriate privacy or contractual authority must assess whether the proposed use is permissible. Security review should establish how the environment enforces the agreed limits. One approval field cannot silently substitute for all those decisions.
Prefer bringing the diagnostic work to a controlled data environment when that avoids distributing another copy. The reviewer still needs to assess the code, queries and outputs: a protected workspace does not make every exported result safe. The arrangement should limit what leaves and retain enough evidence to explain the conclusion without releasing the sensitive input itself.
An exception should produce a reusable lesson. Once the triggering property is understood, build a fabricated regression fixture where feasible and retire the exceptional access. If the team still needs real data for recurring validation, establish a separate governed workflow with periodic reassessment. Calling a permanent production mirror a temporary exception makes the inventory less truthful and weakens the next decision about exposure.
A fictional migration shows why two approvals are necessary
Fictional Marlow is migrating customer orders. Its initial test sample replaces names and email addresses, but retains transaction dates, support notes and stable customer references. The migration passes a basic row-count check. The team calls the dataset anonymous and asks to distribute it to an external testing partner.
A review identifies two independent problems. First, the remaining notes and unusual histories could reveal customers to someone with relevant background information. Second, the sample lacks the sequence that caused a historical migration failure: a refund after an identifier change. Privacy and test quality are both unresolved, even though the masking job completed successfully.
Marlow creates a rule-generated fixture containing the identifier transition and refund relationship, with invented values and controlled outbound destinations. It adds assertions for the expected reconciliation result and tests that the preparation pipeline rejects an unexpected free-text field. The partner receives that fixture for the bounded regression task. Any later performance evaluation needs its own distribution and workload criteria.
The result is deliberately narrow: a useful regression case without copying the original customer's history. It does not establish that every migration defect is covered or that all original data can be discarded. If another failure still requires restricted inspection of real records, Marlow can request that specific exception. This is an illustrative reasoning example, not a client engagement or an observed reduction in breach risk.
Evidence that earns release
I would require a dataset release record to answer four questions: what test decision it supports, what sensitive information could remain, who and what will receive it, and how access and copies end. Attach the utility results and privacy assessment separately. If either is incomplete, name the missing evidence instead of averaging the two into a green score.
The method has limits. No finite fixture covers every possible application state, and no unsuccessful identification attempt proves universal anonymity. Learned generators can change with training data or software updates. Purpose-built data can miss defects that have not yet been understood. Those limits favor repeatable, versioned review and narrow claims, not routine unrestricted production copying or a blanket promise that synthetic data solves every problem.
For adjacent controls, see turning data classification into enforceable access rules and reducing sensitive content in security telemetry. Those controls govern handling and evidence. The decision here comes earlier: what information does this test need to receive in the first place?
If production extracts have become the default way your teams test software, contact me about a test-data exposure assessment. We can examine one refresh workflow, identify the properties its tests actually need and define a verified fixture or a controlled exception. The deliverable is a practical release decision supported by privacy evidence, engineering assertions and a clear account of where the data goes.
References
- Garfinkel, S., Guttman, B., Near, J., Dajani, A., & Singer, P. (2023). De-identifying government datasets: Techniques and governance (NIST Special Publication 800-188). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-188
- Giomi, M., Boenisch, F., Wehmeyer, C., & Tasnádi, B. (2023). A unified framework for quantifying privacy risk in synthetic data. Proceedings on Privacy Enhancing Technologies, 2023(2), 312–328. https://doi.org/10.56553/popets-2023-0055
- GitHub. (n.d.). Configuring the retention period for checks, workflow runs, commit statuses, artifacts, and logs in your organization. Retrieved October 29, 2026, from https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization
- Google Cloud. (2026a, October 26). De-identifying sensitive data. https://docs.cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data
- Google Cloud. (2026b, October 26). Pseudonymization. https://docs.cloud.google.com/sensitive-data-protection/docs/pseudonymization
- Information Commissioner's Office. (n.d.). How do we ensure anonymisation is effective? Retrieved October 29, 2026, from https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/data-sharing/anonymisation/how-do-we-ensure-anonymisation-is-effective/
- Microsoft. (2025, June 30). Dynamic data masking. https://learn.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking?view=sql-server-ver17
- Near, J., Darais, D., Lefkovitz, N., & Howarth, G. (2025). Guidelines for evaluating differential privacy guarantees (NIST Special Publication 800-226). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-226
- OWASP Foundation. (n.d.). Logging cheat sheet. Retrieved October 29, 2026, from https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html
- Souppaya, M., Scarfone, K., & Dodson, D. (2022). Secure Software Development Framework (SSDF) version 1.1: Recommendations for mitigating the risk of software vulnerabilities (NIST Special Publication 800-218). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-218
- Stadler, T., Oprisanu, B., & Troncoso, C. (2022). Synthetic data—Anonymisation groundhog day. In 31st USENIX Security Symposium (USENIX Security 22) (pp. 1451–1468). USENIX Association. https://www.usenix.org/conference/usenixsecurity22/presentation/stadler
- U.S. Census Bureau. (2021, November 18). What are synthetic data? https://www.census.gov/about/what/synthetic-data.html