HIPAA Privacy Minimum Necessary
Overview
This skill operationalizes the HIPAA Privacy Rule standards for minimum necessary use and disclosure of protected health information (PHI), de-identification, Limited Data Sets, and individual rights. Primary citations:
| Topic |
Citation |
| Minimum necessary |
45 CFR §164.502(b) — covered entities and BAAs |
| Minimum necessary policies |
45 CFR §164.514(d) — implementation specifications |
| De-identification (Safe Harbor / Expert Determination) |
45 CFR §164.514(a)–(b) |
| Limited Data Set |
45 CFR §164.514(e) — data use agreement required |
| Patient access to PHI |
45 CFR §164.524 |
| Amendment of PHI |
45 CFR §164.526 |
| Accounting of disclosures |
45 CFR §164.528 (where applicable) |
Minimum necessary requires covered entities and business associates to limit PHI to the minimum needed to accomplish the intended purpose. For AI agents, this means:
- Prompts to LLMs contain only fields required for the compliance task—not full charts
- Role-based exposure: auditor role ≠ billing role ≠ clinical role
- Redaction upstream via
redaction.py before LLM reasoning—complements hipaa-phi-redaction-pipeline
- No reconstruction of redacted tokens in model context unless authorized downstream delivery
The Security Rule (§164.312) technical controls are addressed in hipaa-technical-safeguards; this skill focuses on Privacy Rule use/disclosure limits.
When to Use
Use this skill when:
- Designing agent workflows that may process ePHI (compliance audits, chart review assistants)
- Auditing whether current LLM prompts/logs exceed minimum necessary
- Implementing role-based PHI access for agent operators and MCP tools
- Planning de-identified or Limited Data Set datasets for analytics/training
- Building patient access or amendment workflows touching agent-held data
- Policy review for §164.514(d) minimum necessary procedures
- Complementing redaction pipeline deployment with organizational privacy controls
Do not use this skill when:
- Tuning Presidio entity types and thresholds (use
hipaa-phi-redaction-pipeline)
- Encryption, access control, audit logs under Security Rule (use
hipaa-technical-safeguards)
- Vendor BAA clause negotiation (use
hipaa-baa-vendor-assessment)
- California consumer privacy rights (use
ccpa-cpra-privacy-rights)
Core Process
Execute steps in order.
Step 1: PHI flow and purpose mapping (§164.502(b))
- Document each agent use case and its ** intended purpose** (treatment, payment, healthcare operations, or other with authorization).
- Map PHI elements accessed per use case:
| Use case |
PHI elements |
Purpose |
Minimum necessary? |
| HIPAA gap audit |
Policies, configs (no clinical) |
Operations |
Yes |
| Clinical coding assist |
Diagnosis, procedures |
Treatment |
Partial—review scope |
| Full chart summarization |
Entire note |
Unclear |
Likely excessive |
- Identify routine disclosures vs non-routine (§164.514(d)(3)—non-routine requires case-by-case minimum necessary review).
- Artifact:
phi-purpose-map-{id}.json.
Step 2: Minimum necessary policies (§164.514(d))
- Verify organizational policies define:
- Roles and classes of persons who need access to PHI
- Categories of PHI accessible per role
- Conditions appropriate for access (§164.514(d)(2))
- For non-routine requests, document case-by-case review process.
- Standard disclosures (e.g., to HHS)—document limited data sets permitted.
- Map agent service accounts to human role equivalents—MCP Postgres roles must mirror policy.
Step 3: Agent prompt minimization
- Audit sample agent prompts (redacted captures only) against purpose map:
- Remove demographics not needed for task (e.g., full address for policy audit)
- Remove dates not needed (over-redaction preferred over under-collection)
- Use structured fields instead of full narrative notes where possible
- Implement prompt templates per skill/task with explicit PHI field allowlists.
- Verify
agent.py pipeline:
- Redaction runs before
compliance_agent.run()
- System instructions prohibit requesting additional PHI from user
- FAIL if prompts include entire EMR exports for narrow compliance questions.
Step 4: Role-based PHI exposure
- Define RBAC matrix for agent operators and tools:
| Role |
Agent skills allowed |
MCP tools |
PHI categories |
| Compliance auditor |
hipaa-, soc2- |
Read-only Postgres (config) |
No clinical PHI |
| Privacy officer |
+ hipaa-privacy-* |
Presidio, evidence DB |
De-identified + LDS |
| Break-glass clinical |
Restricted |
Full read with logging |
Full PHI—time-bound |
- Enforce via IAM, MCP OAuth scopes, and Postgres row/column policies—cross-ref
access-control-identity-audit.
- Deanonymization (
deanonymize_response) restricted to roles with documented need.
Step 5: De-identification (§164.514(a)–(b))
- For datasets used in analytics, ML, or broad agent testing, apply:
Safe Harbor method (§164.514(b)(2)) — remove 18 identifiers:
- Names, geographic subdivisions smaller than state, dates (except year), telephone, fax, email, SSN, MRN, health plan numbers, account numbers, certificate/license numbers, vehicle identifiers, device identifiers, URLs, IP addresses, biometric identifiers, full-face photos, other unique identifying numbers/characteristics/code
Expert Determination (§164.514(b)(1)) — qualified expert documents re-identification risk is very small.
- Agent test corpora must use synthetic or de-identified data—never production PHI in CI logs.
- Document method in
de-identification-record-{id}.yaml.
Step 6: Limited Data Sets (§164.514(e))
- If using LDS (may include city, state, ZIP, dates of service, age, dates of birth/death):
- Execute Data Use Agreement (DUA) with recipient
- Limit use to research, public health, or healthcare operations purposes stated in agreement
- Agent accessing LDS must not combine with other data to re-identify.
- LDS in LLM prompts still requires BAA and minimum necessary review—LDS ≠ unlimited disclosure.
Step 7: Patient rights — access and amendment (§164.524, §164.526)
- Right of access:
- Provide access to PHI in designated record set within 30 days (§164.524(b))
- If agent stores derived summaries, determine if part of designated record set—legal review if unclear
- Access requests fulfilled without sending other patients' PHI to LLM
- Right to amend:
- Process amendment requests; if denied, document reason (§164.526)
- If agent outputs incorrect PHI-derived conclusions, trigger amendment workflow—not silent correction in model only
- Use Postgres MCP read-only for structured retrieval—never paste full database exports into LLM.
Step 8: Integration with redaction pipeline
- Confirm
hipaa-phi-redaction-pipeline controls:
- Entity coverage matches minimum necessary policy (don't redact then deanonymize unnecessarily)
- Session
reset_session() between patients/engagements
- False negative testing for elements intentionally excluded from prompts
- Redaction ≠ minimum necessary alone—redaction supports it but policy defines which fields enter the pipeline at all.
- Presidio MCP (if used) must mirror local
redaction.py thresholds per mcp-compliance-integration.
Step 9: Findings and evidence
- Emit findings:
id: FIND-HIPAA-PRIV-001
severity: HIGH
control_id: 45CFR-164.502(b)
observation: "Agent prompt template includes full clinical note for billing audit task"
recommendation: "Restrict template to claim ID, procedure codes, and payer policy fields only"
owner: ""
due_date: null
status: open
- Package: purpose map, RBAC matrix, policy excerpts, prompt audit samples (redacted), de-id records, hashes.
Common Rationalizations
| Excuse the agent might generate |
Required rebuttal |
| "Redaction handles minimum necessary—we send full charts." |
Redaction masks PHI still sent to LLM—minimum necessary requires not collecting excess fields upstream. |
| "LLM needs context; more PHI means better answers." |
Privacy Rule limits disclosure regardless of model performance—narrow the task or use de-identified data. |
| "De-identified Safe Harbor is too hard; we'll use production." |
Production PHI in dev/test violates minimum necessary and Security Rule—use synthetic or de-identified corpora. |
| "All staff can use the agent—it's internal." |
Internal access still requires role-based limits per §164.514(d)—standing access to all PHI fails. |
| "Limited Data Set means we can put it in any prompt." |
LDS requires DUA and purpose limits—LLM vendor must be covered BAA with permitted uses. |
| "Patient access requests can go through the LLM for speed." |
Access fulfillment must be accurate and complete—LLM summarization risks omission; use authoritative records. |
Red Flags
- Full EMR notes or CCDA documents in agent prompts for narrow operational tasks
- MCP Postgres tool returns
SELECT * from clinical tables without column restrictions
- Deanonymization available to all agent users without role check
- Production PHI in agent test logs or Slack MCP notifications
- No documented minimum necessary policy for agent use cases (§164.514(d))
- LDS used without executed Data Use Agreement
- Agent-derived patient summaries treated as source of truth for access requests
- Cross-patient PHI in single session without
reset_session()
Verification
1---2name: hipaa-privacy-minimum-necessary3description: Implements HIPAA Privacy Rule minimum necessary standard—45 CFR §164.502(b)—plus §164.514 de-identification, Limited Data Sets, and patient rights to access and amend records, with agent prompt minimization, role-based PHI exposure, and integration with the Presidio redaction pipeline. Trigger when designing LLM/agent PHI access policies, auditing disclosure practices, implementing patient rights workflows, or validating that agent prompts contain only minimum necessary ePHI. Do not use for Presidio entity tuning alone (use hipaa-phi-redaction-pipeline), Security Rule technical controls (use hipaa-technical-safeguards), or BAA legal review (use hipaa-baa-vendor-assessment).4---56# HIPAA Privacy Minimum Necessary78## Overview910This skill operationalizes the **HIPAA Privacy Rule** standards for **minimum necessary** use and disclosure of protected health information (PHI), **de-identification**, **Limited Data Sets**, and **individual rights**. Primary citations:1112| Topic | Citation |13| --- | --- |14| Minimum necessary | **45 CFR §164.502(b)** — covered entities and BAAs |15| Minimum necessary policies | **45 CFR §164.514(d)** — implementation specifications |16| De-identification (Safe Harbor / Expert Determination) | **45 CFR §164.514(a)–(b)** |17| Limited Data Set | **45 CFR §164.514(e)** — data use agreement required |18| Patient access to PHI | **45 CFR §164.524** |19| Amendment of PHI | **45 CFR §164.526** |20| Accounting of disclosures | **45 CFR §164.528** (where applicable) |2122**Minimum necessary** requires covered entities and business associates to **limit PHI** to the minimum needed to accomplish the intended purpose. For **AI agents**, this means:2324- Prompts to LLMs contain **only fields required** for the compliance task—not full charts25- **Role-based** exposure: auditor role ≠ billing role ≠ clinical role26- **Redaction upstream** via `redaction.py` before LLM reasoning—complements `hipaa-phi-redaction-pipeline`27- **No reconstruction** of redacted tokens in model context unless authorized downstream delivery2829The **Security Rule** (§164.312) technical controls are addressed in `hipaa-technical-safeguards`; this skill focuses on **Privacy Rule** use/disclosure limits.3031## When to Use3233Use this skill when:3435- **Designing agent workflows** that may process ePHI (compliance audits, chart review assistants)36- Auditing whether current LLM prompts/logs exceed **minimum necessary**37- Implementing **role-based PHI access** for agent operators and MCP tools38- Planning **de-identified** or **Limited Data Set** datasets for analytics/training39- Building **patient access** or **amendment** workflows touching agent-held data40- **Policy review** for §164.514(d) minimum necessary procedures41- Complementing redaction pipeline deployment with **organizational** privacy controls4243Do **not** use this skill when:4445- Tuning Presidio entity types and thresholds (use `hipaa-phi-redaction-pipeline`)46- Encryption, access control, audit logs under Security Rule (use `hipaa-technical-safeguards`)47- Vendor BAA clause negotiation (use `hipaa-baa-vendor-assessment`)48- California consumer privacy rights (use `ccpa-cpra-privacy-rights`)4950## Core Process5152Execute steps **in order**.5354### Step 1: PHI flow and purpose mapping (§164.502(b))55561. Document each **agent use case** and its ** intended purpose** (treatment, payment, healthcare operations, or other with authorization).572. Map PHI elements accessed per use case:5859| Use case | PHI elements | Purpose | Minimum necessary? |60| --- | --- | --- | --- |61| HIPAA gap audit | Policies, configs (no clinical) | Operations | Yes |62| Clinical coding assist | Diagnosis, procedures | Treatment | Partial—review scope |63| Full chart summarization | Entire note | Unclear | Likely **excessive** |64653. Identify **routine disclosures** vs **non-routine** (§164.514(d)(3)—non-routine requires case-by-case minimum necessary review).664. Artifact: `phi-purpose-map-{id}.json`.6768### Step 2: Minimum necessary policies (§164.514(d))69701. Verify organizational policies define:71 - **Roles and classes of persons** who need access to PHI72 - **Categories of PHI** accessible per role73 - **Conditions** appropriate for access (§164.514(d)(2))742. For **non-routine requests**, document case-by-case review process.753. **Standard disclosures** (e.g., to HHS)—document limited data sets permitted.764. Map agent service accounts to **human role equivalents**—MCP Postgres roles must mirror policy.7778### Step 3: Agent prompt minimization79801. Audit sample agent prompts (redacted captures only) against purpose map:81 - Remove **demographics not needed** for task (e.g., full address for policy audit)82 - Remove **dates** not needed (over-redaction preferred over under-collection)83 - Use **structured fields** instead of full narrative notes where possible842. Implement **prompt templates** per skill/task with explicit PHI field allowlists.853. Verify `agent.py` pipeline:86 - Redaction runs **before** `compliance_agent.run()`87 - System instructions prohibit requesting additional PHI from user884. **FAIL** if prompts include entire EMR exports for narrow compliance questions.8990### Step 4: Role-based PHI exposure91921. Define RBAC matrix for agent operators and tools:9394| Role | Agent skills allowed | MCP tools | PHI categories |95| --- | --- | --- | --- |96| Compliance auditor | hipaa-*, soc2-* | Read-only Postgres (config) | No clinical PHI |97| Privacy officer | + hipaa-privacy-* | Presidio, evidence DB | De-identified + LDS |98| Break-glass clinical | Restricted | Full read with logging | Full PHI—time-bound |991002. Enforce via IAM, MCP OAuth scopes, and Postgres row/column policies—cross-ref `access-control-identity-audit`.1013. Deanonymization (`deanonymize_response`) restricted to roles with documented need.102103### Step 5: De-identification (§164.514(a)–(b))1041051. For datasets used in **analytics, ML, or broad agent testing**, apply:106107**Safe Harbor method (§164.514(b)(2))** — remove 18 identifiers:108- Names, geographic subdivisions smaller than state, dates (except year), telephone, fax, email, SSN, MRN, health plan numbers, account numbers, certificate/license numbers, vehicle identifiers, device identifiers, URLs, IP addresses, biometric identifiers, full-face photos, other unique identifying numbers/characteristics/code109110**Expert Determination (§164.514(b)(1))** — qualified expert documents re-identification risk is very small.1111122. **Agent test corpora** must use synthetic or de-identified data—never production PHI in CI logs.1133. Document method in `de-identification-record-{id}.yaml`.114115### Step 6: Limited Data Sets (§164.514(e))1161171. If using LDS (may include city, state, ZIP, dates of service, age, dates of birth/death):118 - Execute **Data Use Agreement (DUA)** with recipient119 - Limit use to research, public health, or healthcare operations purposes stated in agreement1202. Agent accessing LDS must not **combine** with other data to re-identify.1213. LDS in LLM prompts still requires BAA and minimum necessary review—LDS ≠ unlimited disclosure.122123### Step 7: Patient rights — access and amendment (§164.524, §164.526)1241251. **Right of access**:126 - Provide access to PHI in designated record set within 30 days (§164.524(b))127 - If agent stores derived summaries, determine if part of designated record set—legal review if unclear128 - Access requests fulfilled without sending **other patients'** PHI to LLM1292. **Right to amend**:130 - Process amendment requests; if denied, document reason (§164.526)131 - If agent outputs incorrect PHI-derived conclusions, trigger amendment workflow—not silent correction in model only1323. Use **Postgres MCP read-only** for structured retrieval—never paste full database exports into LLM.133134### Step 8: Integration with redaction pipeline1351361. Confirm `hipaa-phi-redaction-pipeline` controls:137 - Entity coverage matches minimum necessary policy (don't redact then deanonymize unnecessarily)138 - Session `reset_session()` between patients/engagements139 - False negative testing for elements **intentionally excluded** from prompts1402. **Redaction ≠ minimum necessary alone**—redaction supports it but policy defines **which fields enter the pipeline at all**.1413. Presidio MCP (if used) must mirror local `redaction.py` thresholds per `mcp-compliance-integration`.142143### Step 9: Findings and evidence1441451. Emit findings:146147```yaml148id: FIND-HIPAA-PRIV-001149severity: HIGH150control_id: 45CFR-164.502(b)151observation: "Agent prompt template includes full clinical note for billing audit task"152recommendation: "Restrict template to claim ID, procedure codes, and payer policy fields only"153owner: ""154due_date: null155status: open156```1571582. Package: purpose map, RBAC matrix, policy excerpts, prompt audit samples (redacted), de-id records, hashes.159160## Common Rationalizations161162| Excuse the agent might generate | Required rebuttal |163| --- | --- |164| "Redaction handles minimum necessary—we send full charts." | Redaction **masks** PHI still sent to LLM—minimum necessary requires **not collecting** excess fields upstream. |165| "LLM needs context; more PHI means better answers." | Privacy Rule **limits** disclosure regardless of model performance—narrow the task or use de-identified data. |166| "De-identified Safe Harbor is too hard; we'll use production." | Production PHI in dev/test violates **minimum necessary** and Security Rule—use synthetic or de-identified corpora. |167| "All staff can use the agent—it's internal." | Internal access still requires **role-based** limits per §164.514(d)—standing access to all PHI fails. |168| "Limited Data Set means we can put it in any prompt." | LDS requires **DUA** and purpose limits—LLM vendor must be covered BAA with permitted uses. |169| "Patient access requests can go through the LLM for speed." | Access fulfillment must be **accurate and complete**—LLM summarization risks omission; use authoritative records. |170171## Red Flags172173- Full EMR notes or CCDA documents in agent prompts for narrow operational tasks174- MCP Postgres tool returns `SELECT *` from clinical tables without column restrictions175- Deanonymization available to all agent users without role check176- Production PHI in agent test logs or Slack MCP notifications177- No documented minimum necessary policy for agent use cases (§164.514(d))178- LDS used without executed Data Use Agreement179- Agent-derived patient summaries treated as source of truth for access requests180- Cross-patient PHI in single session without `reset_session()`181182## Verification183184- [ ] PHI purpose map complete for all agent use cases with minimum necessary assessment185- [ ] §164.514(d) minimum necessary policies documented and mapped to agent roles186- [ ] Prompt templates use field allowlists; sample audit shows no excess clinical PHI187- [ ] RBAC matrix enforced for operators, MCP tools, and deanonymization188- [ ] De-identification method documented for analytics/test data (Safe Harbor or Expert Determination)189- [ ] Limited Data Set agreements verified where LDS is used190- [ ] Patient access and amendment workflows defined for agent-held derived data191- [ ] Redaction pipeline integrated per hipaa-phi-redaction-pipeline with session isolation192- [ ] Findings logged with 45 CFR citations and remediation owners193- [ ] Evidence artifacts hashed with engagement ID and UTC timestamp