Test data and environments Required
Keep a staging copy with fake data
Keep a staging environment that runs the same build, settings and service versions as production, with fake data.
How to do it
Deploy every change to staging first with the same script as production. Use the same database engine, runtime and web server versions. Give staging its own keys and accounts, so nothing in it can touch customers. Fill it with generated data, or a masked copy when you need production's shape. See also build every environment from the same code.
How to check
Staging and production report the same build and runtime versions, such as on a version endpoint or in the deploy log. Staging uses none of production's databases or keys, and its user records hold only generated addresses, such as @example.com.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/test-data-and-environments/production-like-staging.