Reference catalog of HIPAA Security Rule-aligned test patterns - administrative safeguards (45 CFR §164.308: workforce training, access management, contingency planning), physical safeguards (§164.310: facility access, workstation security, device disposal), technical safeguards (§164.312: access control, audit logs, integrity, transmission security); PHI handling assertions in fixtures; minimum-necessary tests per §164.502(b); BAA-scope boundary verification. Use when authoring HIPAA-readiness tests for any product handling Protected Health Information.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Reference catalog of test patterns by HIPAA Security Rule section
(45 CFR §164). Pair with audit-trail-test-author
for §164.312(b) audit-log requirements. Anchors:
hhs.gov/hipaa and NIST SP 800-66.
Per HHS, PHI = individually identifiable health information + created/received/maintained/transmitted by a covered entity. The 18 HIPAA identifiers per §164.514(b)(2) (Safe Harbor):
1. Name
2. Geographic subdivisions smaller than state (ZIP codes need restrictions)
3. All elements of dates (except year) for dates directly related to an individual
4. Telephone numbers
5. Vehicle identifiers + license plates
6. Fax numbers
7. Device identifiers + serial numbers
8. Email addresses
9. Web URLs
10. SSN
11. IP addresses
12. Medical record numbers
13. Biometric identifiers (fingerprints, voiceprints)
14. Health plan beneficiary numbers
15. Full-face photos + comparable images
16. Account numbers
17. Any other unique identifying number / characteristic / code
18. Certificate / license numbersTest fixtures for HIPAA-scope systems MUST avoid these 18
identifiers (or use synthetic-pii-generator in the qa-test-data
plugin to generate safe substitutes).
synthetic-pii-generator.audit-trail-test-author.Full per-section patterns live in references/security-rule-test-patterns.md, covering administrative safeguards (§164.308 workforce access management, workforce training), physical safeguards (§164.310 device + media disposal), technical safeguards (§164.312 access control, audit controls, integrity, transmission security), the §164.502(b) minimum-necessary standard, and §164.504(e) BAA-scope boundaries. Each entry is a copy-ready pytest-style test keyed to its CFR section.
A billing clerk's role is added to the scheduling service. The team runs the §164.502(b) minimum-necessary pattern against /patient/123/billing-summary with the billing-clerk token. The response asserts amount_due and insurance_provider are present and that clinical_notes, medications, and genetic_test_results are absent. The negative assertion fails: the summary serializer eager-loads the full patient record, leaking medications. The team narrows the serializer to billing fields, re-runs, and the test passes, proving the role sees only the minimum-necessary PHI, with the read logged via the §164.312(b) audit pattern.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Real PHI in test fixtures | HIPAA violation in tests | synthetic-pii-generator + de-identified data |
| Audit log without tamper-evidence | Logs can be modified post-incident | Hash-chain or signed-batch log integrity (§164.312(b)) |
| Role-based access without minimum-necessary check | Over-broad access; minimum-necessary violation | Per-PHI-type test (Step §164.502(b)) |
| Skip BAA scope tests | Vendor accesses PHI outside agreement | Step §164.504(e) scope test |
| Allow plaintext HTTP for PHI even in dev | Production drift; eventual leak | Always enforce HTTPS (Step §164.312(e)) |
gdpr-test-patterns,
ccpa-test-patterns - sister
privacy-pattern catalogsaudit-trail-test-author -
§164.312(b) audit log requirementssynthetic-pii-generator - cross-plugin: safe PHI fixture generation