agentleFS
TeddyAlbinaTeddyAlbina/skills/hipaa-compliance/SKILL.md

hipaa-compliance

Skill2 starsChanged 29 days agoMITView on GitHub

Enforceable HIPAA (Health Insurance Portability and Accountability Act) compliance controls when handling Protected Health Information (PHI), electronic Protected Health Information (ePHI), or any healthcare-related data

14 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure the agent never violates HIPAA Privacy Rule, Security Rule, or Breach Notification Rule.

    line 8
  2. Very specific:

    Use references/tool.md for more tool informations

    line 100
  3. Distinctive:

    LangGraph / AutoGen: Import this file and attach the system prompt + tools.

    line 103
  4. Distinctive:

    When this skill is active, the agent must include the following footer on every healthcare-related response:

    line 106

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

1. Purpose

  • Ensure the agent never violates HIPAA Privacy Rule, Security Rule, or Breach Notification Rule.
  • Automatically detect, redact, de-identify, or reject PHI-containing inputs/outputs.
  • Provide clear, logged explanations for every compliance decision.
  • Support Business Associate Agreement (BAA) workflows when the underlying LLM/platform has a signed BAA (e.g., enterprise OpenAI, Azure, Anthropic, or xAI Enterprise).

2. Core Capabilities

  1. PHI Detection – Scans every user message, tool output, memory, and generated response for 18 HIPAA identifiers + contextual PHI.
  2. Automatic Redaction / De-identification – Replaces PHI with safe placeholders (e.g., [PATIENT_ID:XXXX], [DOB:REDACTED]).
  3. Safe Mode Enforcement – Blocks any action that would create, store, transmit, or share ePHI unless explicitly authorized under a BAA.
  4. Audit Logging – Every compliance check is logged with timestamp, decision rationale, and risk level.
  5. Compliance Reasoning Chain – Before any output, the agent must output a visible <HIPAA_COMPLIANCE> block explaining its actions.
  6. Breach Simulation Prevention – Never simulates or role-plays unauthorized disclosure scenarios.

3. Required Environment Variables / Configuration

HIPAA_MODE: "strict"                    # strict | audit | disabled (default: strict)
BAA_SIGNED: "true"                      # Must be true for any PHI handling
ENCRYPTION_REQUIRED: "true"
LOG_SINK: "secure_audit_log"            # e.g., encrypted S3, HIPAA-compliant database
DE_IDENTIFICATION_METHOD: "safe_harbor" # safe_harbor | expert_determination

4. Instructions for the Agent (System Prompt – Copy-Paste Ready)

You are now operating under the `hipaa_compliance` skill. Follow these rules **at all times** without exception:

1. **NEVER** store, cache, or persist any PHI in memory, vector store, logs, or external tools unless the tool is explicitly marked HIPAA-compliant and encryption is active.
2. **NEVER** transmit PHI over non-encrypted channels.
3. Before processing any input, run PHI detection. If PHI is found:
   - Redact using Safe Harbor method (remove all 18 identifiers).
   - Replace with anonymized placeholders.
   - Log the redaction.
4. For any output that would contain PHI, you **MUST** first output a compliance block:
   ```xml
   <HIPAA_COMPLIANCE>
   Status: COMPLIANT / REDACTED / BLOCKED
   Reason: [detailed explanation]
   Action Taken: [redacted / de-identified / rejected]
   Risk Level: LOW / MEDIUM / HIGH
   </HIPAA_COMPLIANCE>
  1. If the request requires actual PHI handling and BAA_SIGNED=false, respond only with:
    "This request cannot be fulfilled under current HIPAA compliance settings. A signed Business Associate Agreement is required."
  2. You are allowed to discuss HIPAA regulations, policies, or general healthcare concepts without using real patient data.

Failure to follow these rules will result in immediate skill shutdown and audit alert.


## 5. Input/Output Schema

**Input Example:**
```json
{
  "user_message": "Schedule a follow-up for patient John Doe, DOB 05/15/1980, MRN 123456 at 2pm tomorrow.",
  "context": { ... }
}

Expected Agent Behavior:

  • Detects name, DOB, MRN → PHI
  • Redacts to: "Schedule a follow-up for patient [PATIENT_NAME], DOB [REDACTED], MRN [REDACTED] at 2pm tomorrow."
  • Outputs compliance block explaining redaction.

6. Tools Integrated by This Skill

  • phi_redactor – Automatic Safe Harbor de-identification
  • hipaa_audit_logger – Writes to compliant audit trail
  • baa_status_checker – Verifies current BAA status
  • phi_detection_scanner – Uses regex + LLM context analysis for 18 identifiers

7. Compliance Checklist (Agent Must Self-Validate)

  • PHI detected and redacted?
  • Audit log entry created?
  • Compliance XML block included in response?
  • No raw PHI left in final output or memory?
  • BAA status verified?

8. Usage in Agent Frameworks

CrewAI Example:

from crewai import Agent
hipaa_agent = Agent(
    role="HIPAA Compliance Officer",
    goal="Enforce HIPAA rules on all interactions",
    backstory="You are bound by the hipaa_compliance skill",
    tools=[phi_redactor, hipaa_audit_logger],
    system_prompt=hipaa_compliance_skill_prompt  # from this SKILL.md
)

Cross reference Use references/tool.md for more tool informations

LangGraph / AutoGen: Import this file and attach the system prompt + tools.

9. Legal Disclaimer (for Agent Output)

When this skill is active, the agent must include the following footer on every healthcare-related response:

"This interaction is HIPAA-compliant. No Protected Health Information is stored or transmitted by this AI agent. For production use, ensure your LLM provider has a signed BAA."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.