synthetic-pii-generator
Generates realistic-but-fake personally identifiable information (PII) - emails, phone numbers, SSNs / national IDs, addresses, names, credit-card numbers (test BIN ranges), date-of-birth - for non-production environments. Wraps Faker / mimesis with PII-aware constraints so generated values match real format expectations (Luhn-valid card numbers, region-valid phone formats, ITIN/SSN format) without ever generating real-person data. Use when seeding test environments, building demo data, or replacing real PII in copied datasets.
Install with skills.sh (any agent)
npx skills add testland/qa --skill synthetic-pii-generatorsynthetic-pii-generator
Overview
Synthetic PII is data that looks like the real thing (passes the same format validators) but never matches a real person. This skill wraps the synthetic-data libraries (faker-data, the synthetic-data-toolkit generators) with PII-specific constraints to produce format-valid but identity-safe values.
Default: Faker (Python) - broadest locale coverage and the most PII-aware defaults (RFC 2606 emails out of the box, deterministic seeding via Faker.seed()). Use mimesis when the project needs provider-level locale control (e.g. Japanese addresses with prefecture accuracy); use Bogus for .NET projects that already ship it.
When to use
Step 1 - Identify the PII fields
For each field in the target schema, classify:
| Field | PII tier |
|---|---|
| Direct (regulator-recognized PII). | |
| Full name | Direct. |
| Phone number | Direct. |
| Street address | Direct. |
| Date of birth (alone) | Indirect (combine with name → direct). |
| Postal code (alone) | Indirect. |
| Government ID (SSN, ITIN, NIN, TIN, etc.) | Sensitive PII. |
| Payment card number | Sensitive PII (PCI scope; not GDPR PII per se). |
| Health record fields | Special-category (GDPR Art. 9). |
| User-generated content | Could embed PII; case-by-case. |
This skill generates synthetic values for each - the matching real-data pattern (format) without matching a real person.
Step 2 - Use safe-by-construction values
Email - RFC 2606 reserved domains
Per RFC 2606, these domains are reserved for examples and guaranteed never to deliver to real mailboxes:
Faker / mimesis / Bogus all default to RFC 2606 domains. Never override to a real domain in synthetic-PII mode - even if your test fixture has good intentions, an integration that actually sends email will spam real recipients.
from faker import Faker
fake = Faker()
fake.email() # 'roccelline1878@example.com' - safe
fake.email(domain='gmail.com') # NEVER - could spam real usersPhone numbers, government IDs, and card numbers
These need reserved test ranges, not generator defaults - a format-valid random SSN, phone, or card can collide with a real one. Emit the documented safe constants (US SSN in the IRS 900-XX-XXXX range, issuer-published Luhn-valid test card BINs, regional fictional phone ranges) from the lookup tables: references/pii-lookup-tables.md.
Never generate values from a real-issuance range.
Addresses - synthetic but plausibly local
from mimesis import Address, Locale
addr = Address(Locale.JA)
addr.full_address() # Japanese-format synthetic addressMimesis / Faker generate format-valid addresses but not real addresses. For absolute safety, prefix the address with [TEST] or use the example-street convention (100 Test St).
Date of birth - restrict the range
from faker import Faker
fake = Faker()
fake.date_of_birth(minimum_age=18, maximum_age=80)Restrict DOB to plausible ranges; combined with synthetic name + address, the result is structurally complete without identifying a real person.
Step 3 - Persist synthetic markers
Mark every generated PII field as synthetic so a downstream review can confirm the dataset's safety:
# fixtures/users-test.yaml
users:
- id: u1
email: alice.doe-synthetic@example.com # Suffix 'synthetic' for clarity
name: Alice Doe
phone: '+1 (555) 0123' # Test range
ssn: '900-12-3456' # IRS test range
card: '4111 1111 1111 1111' # Stripe Visa test card
_synthetic: true # Marker for auditThe _synthetic: true marker is a contract - every consumer respects it (e.g. a "clear synthetic data" maintenance script can delete all rows where _synthetic = true without affecting any real production data).
Output format
## Synthetic PII generated for `<dataset-name>`
**Source factory library:** Faker (Python) | mimesis | Bogus | etc.
**Rows generated:** N
**PII tier breakdown:**
- Direct: 4 fields (email, name, phone, address)
- Indirect: 2 fields (zip, dob)
- Sensitive: 2 fields (ssn, card)
### Safety guarantees
- All emails use RFC 2606 reserved domains.
- All phones use region-specific test ranges.
- All SSNs use the IRS test range (`900-XX-XXXX`).
- All cards use issuer-published Luhn-valid test BINs.
- All rows tagged `_synthetic: true`.
### Verification commands
```bash
# Confirm no email matches a real-looking domain
jq -r '.users[].email' fixtures/users-test.yaml | grep -v '@example\.\(com\|org\|net\)' && echo 'WARNING: non-test domain found'
# Confirm SSN range
jq -r '.users[].ssn' fixtures/users-test.yaml | grep -v '^9[0-9]{2}-' && echo 'WARNING: SSN outside IRS test range'
```
Anti-patterns
| Anti-pattern | Why it fails | Fix |
|---|---|---|
Faker email with domain='gmail.com' | Generates <random>@gmail.com - could match a real Gmail user. | Always RFC 2606 domains. |
| Real-format SSN without test-range constraint | Random 9-digit numbers occasionally hit a real-issuance range. | Always use the IRS test range. |
| Real card number ranges | Even "fake" 16-digit Luhn-valid numbers can match a real BIN. | Use issuer-published test BINs only. |
| Copying production database to staging "for realism" | Compliance violation; PII bleeds; legal exposure. | Always synthetic; never copy production rows. |
Skipping the _synthetic: true marker | Cleanup scripts can't distinguish synthetic from real data. | Always tag synthetic rows. |
| Generating PII for ID fields the system stores indefinitely | Synthetic value persists even after the fixture lifecycle. | Use predictable identifiers (e.g. test-user-001) for IDs; reserve synthetic generation for human-facing fields. |
Limitations
References
PII safe-value lookup tables
View source (opens in new window)PII safe-value lookup tables
Reserved test ranges and issuer-published test values that pass real format validators without matching a real person. Emit these constants instead of trusting a generator's defaults, which may collide with a real number.
Phone numbers - region-specific test ranges
| Region | Test range |
|---|---|
| US | (555) 0100 - (555) 0199 (per Numbering Plan documentation, reserved for fictional use). |
| UK | 0790 7900 000-999 (Ofcom reserved for drama/fiction). |
| Germany | +49 (123) 4567-... patterns reserved for examples. |
Faker's phone_number defaults to format-valid but doesn't guarantee non-real numbers. For absolute safety, post-process generated phone numbers to substitute the regional test range.
Government IDs - never generate real-format
| ID | Synthetic strategy |
|---|---|
| US SSN | Use the IRS test range 900-XX-XXXX to 999-XX-XXXX (not validly issued). Faker's ssn() defaults to invalid-format strings. |
| US ITIN | Format: 9XX-7X-XXXX or 9XX-8X-XXXX (range reserved for ITIN issuance; never generate real values). |
| UK NI Number | AB123456C patterns; use JR987654A style which HMRC reserves. |
| Generic | If your test environment doesn't enforce format validation, use obvious-fake values like 000-00-0000. |
Never generate values from a real-issuance range. A correctly- formatted but real-issuance SSN may collide with a real person - the exact privacy violation this skill avoids.
Credit card numbers - test BIN ranges
Major card networks publish test BIN ranges that pass Luhn checksum but never authorize. Use these in test fixtures:
| Card type | Test BIN (use with random suffix; Luhn-valid) |
|---|---|
| Visa | 4111 1111 1111 1111 |
| Mastercard | 5555 5555 5555 4444 |
| American Express | 3782 822463 10005 |
| Discover | 6011 1111 1111 1117 |
(Standard Stripe / Adyen test cards; documented in their respective testing guides.) Faker's credit_card_number() produces format-valid values but may collide with a real card if the issuer's BIN happens to match; the Stripe / Adyen test cards are guaranteed safe.
Related skills
boundary-value-generator
Generates boundary-value test cases from typed input specifications - for each input field, produces the canonical 6-point set (one below, at, and above the lower bound; one below, at, and above the upper bound) plus equivalence-class representatives. Emits cases as parameterized test inputs (pytest @parametrize / Jest test.each / xUnit InlineData / etc.). Use when a function or endpoint has numeric / string-length / collection-size constraints and the team needs systematic edge-case coverage.
faker-data
Fixes test data that breaks tests - factory values in a shape the code under test rejects (a phone number that is not E.164), fixtures that only pass when the whole suite runs in order, and random values that make an assertion pass or fail depending on the run. Authors test-data factories with Faker: the Python `faker` library, the `@faker-js/faker` JS port, and the `faker-ruby` gem - install per language, the provider catalogue (person / internet / location / date / finance / lorem), locale selection and multi-locale mode, and seed-based determinism for reproducible runs. Scope is generating fresh values for tests that start from nothing, not replacing values inside a dataset that already holds real records - that goes to pii-masking-pipeline-builder. Use when fixtures need realistic values, a stable shape, or a fixed seed.
golden-file-conventions
Reference catalog for snapshot / golden file management - naming conventions, directory layout, when to add / update / remove a baseline, sanitization (timestamps, IDs, PII), per-OS / per-runtime variant strategy, and review workflow for snapshot diffs in PRs. Use when designing a snapshot-testing convention or auditing an existing one for drift.
malicious-payload-bank
Reference catalog of curated adversarial input payloads keyed by attack class - SQL injection, XSS, SSRF, path traversal, command injection, XXE, prototype pollution, regex DoS, Unicode confusables, header injection - plus per-context guidance for which payloads apply (URL parameter / form input / JSON body / file upload). Use when authoring negative-test cases for input validation, fuzz targets, or a security-focused test suite that needs to exercise the OWASP Top 10 attack surface.
msw-handlers
Authors Mock Service Worker (MSW) request handlers for both browser and Node.js test environments using the `http.get` / `http.post` / `HttpResponse.json` API, wires them via `setupWorker` (browser) or `setupServer` (Node), and manages the test lifecycle (`server.listen` / `resetHandlers` / `close`). Use when the project uses JavaScript / TypeScript and needs to mock fetch / XHR at the network layer for both Vitest / Jest unit tests and Cypress / Playwright integration tests.
negative-test-generator
Covers the refusal paths a handler already implements but nothing tests - a batch endpoint that must apply all rows or none, optimistic-concurrency version conflicts between two editors, or a delete that deliberately separates who you are from what you may do from the state the record is in. For each happy-path test, produces companions exercising input validation rejection, missing required fields, type mismatches, authorization failures, rate-limit errors, and adversarial payloads from the malicious-payload-bank, emitted as parameterized tests in the project's runner format. Use when code has deliberate error paths and the suite only proves the success case.
pairwise-test-case-generator
Generates parameterized test inputs combining boundary-value, equivalence-class, and pairwise-combinatorial cases from a typed multi-input specification - produces the cross-product of cases up to a configurable strength (1-wise / 2-wise / N-wise) using all-pairs reduction so the test surface stays tractable. Emits cases in the project's test-runner-native parametrize format. Use when a function or endpoint takes 3+ inputs whose interactions matter and full Cartesian product would explode.
seed-data-curator
Builds a reproducible E2E seed dataset for the project's test environments - picks a representative user / org / data-product cross-section, generates the rows via the project's chosen factory library (FactoryBot / mimesis / Bogus / Faker + factory_boy), persists the dataset as a checked-in fixture (SQL dump / JSON / per-engine seed file), and wires it into the test bootstrap. Use when starting E2E coverage on a project that has no seed strategy, or when an existing seed has drifted.
synthetic-data-toolkit
Umbrella for the synthetic test data generators beyond plain Faker - FactoryBot (Ruby factories with traits, associations, and build / create / build_stubbed strategies), Mimesis (fast type-hinted Python generator with the Schema/Field bulk pattern and 46 locales), and Bogus (.NET typed `Faker<T>` builders with `.RuleFor` / `StrictMode` / `UseSeed`). Picks the right generator by language and job, shows side-by-side equivalents of the same fixture across all four ecosystems, and carries each tool's full workflow in references/ (factory-bot.md, mimesis.md, bogus.md). faker-data stays the default for plain field values in Python / JS / Ruby; use this skill when the project needs typed factory orchestration, .NET fixtures, or a documented "which tool should I use" decision.
test-data-patterns
Pure reference catalog of the cross-language object-construction patterns for test data - Test Data Builder (Pryce/Freeman), Factory (with traits and associations), Object Mother, Fixture composition (per-test / per-describe / shared), Snapshot (defers to `golden-file-conventions` for the operational details), and Production-Data Anonymisation. Distinct from the per-language tool skills (`faker-data` and the `synthetic-data-toolkit` umbrella covering FactoryBot / mimesis / Bogus) which document tool-specific configuration; this catalog is the architecture-tier reference for choosing **which pattern** before reaching for the tool. Use when choosing a test-data construction pattern for a new suite, or auditing an existing suite whose fixtures have drifted into shared mutable state.
wiremock-stubs
Authors WireMock stub mappings for HTTP service mocking - `stubFor` with verb/path/header matchers + `willReturn` response shaping, lifecycle via `WireMockServer` (start / stop) or JUnit `WireMockExtension`, request verification via `verify()`, and dynamic-port allocation for parallel tests. Also carries the Mountebank multi-protocol workflow (TCP / SMTP / LDAP / gRPC imposters, record-playback proxying) in references/mountebank.md. Use when the project is JVM-based and tests need to mock HTTP dependencies (third-party APIs, internal microservices) at the network layer, or when mocking must go beyond HTTP.