---
title: "Keep personal data out of test copies · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/personal-data/masked-copies
updated: 2026-10-20
licence: "All rights reserved"
---

# Keep personal data out of test copies

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Personal data](https://agentwranglers.se/playbook/data/personal-data)
- Rule: Never copy personal data into development, test or staging databases. Mask or replace it while copying.
- How: Run a masking step as part of the copy, such as replacing names and emails with fake values and shifting dates. Keep IDs and relations intact, so tests still work. Tools such as PostgreSQL Anonymizer do this, or a script with a fake data library.
- Check: Search a staging copy for a few known email addresses. None are found.

**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 data playbook: https://agentwranglers.se/playbook/data/personal-data/masked-copies`.

- Previous: [Delete old data automatically](https://agentwranglers.se/playbook/data/personal-data/retention-jobs)
- Next: [Encrypt the most sensitive fields](https://agentwranglers.se/playbook/data/personal-data/field-encryption)
- [Personal data](https://agentwranglers.se/playbook/data/personal-data)
