Reference implementation. ArchRails enforces the architectural slice of this framework — this template is not itself a compliance certification, attestation, or audit outcome. Read the full disclaimer →
Attestation, not implementation. Each snippet below records a CALM-level attestation against a node, edge, or graph. The engine enforces that the attestation is present and that the agent's declared_pattern matches what you authored. It does not read your runtime code or infrastructure to verify the attestation reflects reality — verifying that session-timeout-minutes: 15 actually appears in your session middleware is the responsibility of your runtime monitoring, infrastructure scanning, and HIPAA auditor review. ArchRails enforces the contract; the contract enforces the engineer.

Control template: HIPAA Security Rule

Status: Stable · Version: hipaa-security-rule/v1.0.0

A bundle of CALM control snippets covering the architecturally enforceable subset of the HIPAA Security Rule (45 CFR §§ 164.302–318). You copy these into your *.calm.json files on the nodes that store, transmit, or process electronic Protected Health Information (ePHI).

Who the HIPAA Security Rule applies to

If your organization handles ePHI in any of these roles, the Security Rule applies. The template focuses on the Technical Safeguards (§164.312) plus the architectural slice of the Administrative Safeguards (§164.308). Physical Safeguards (§164.310) are out of architectural scope (facility access, workstation security, device disposal).

What this template covers

HIPAA Security Rule citation Architectural surface Control alias
§164.312(a)(2)(iv) Encryption / decryption of ePHI at rest hipaa-ephi-encryption-at-rest
§164.312(d) Person / entity authentication (MFA) hipaa-authentication
§164.312(e)(1)+(2)(i)+(2)(ii) Transmission security (encryption in transit) hipaa-transmission-security

3 controls covering the architecturally enforceable Technical Safeguards. Administrative Safeguards (activity review, backup plan, disaster recovery, emergency access procedure) and Physical Safeguards (§164.310) are out of architectural scope — document those in your firm's HIPAA program.

The ePHI-scope pattern

A node handles ePHI if it stores, processes, transmits, or significantly influences electronic Protected Health Information. Tag those nodes explicitly:

{
  "unique-id": "patient-records-service",
  "node-type": "service",
  "name": "Patient Records Service",
  "metadata": {
    "ephi-in-scope": true,
    "data-classification": "phi",
    "hipaa-role": "covered-entity-system",
    "baa-required-for-downstream": true
  }
}

Then attach the relevant controls below. Stricter expectations apply to nodes that transmit ePHI across organizational boundaries (those require BAAs and stronger transmission-security controls).

Infrastructure verification. ArchRails now verifies the following controls against your infrastructure at PR review time and during code generation (AWS): hipaa-ephi-encryption-at-rest.

Control snippets

Copy each block under the controls key of the node it applies to.

§164.312(a)(2)(iv) — ePHI encryption at rest (hipaa-ephi-encryption-at-rest)

Per-node.

"hipaa-ephi-encryption-at-rest": {
  "description": "HIPAA §164.312(a)(2)(iv) — encryption of ePHI at rest. Addressable implementation specification; per HHS guidance, recommended approach is industry-standard cryptography (AES-256 or stronger).",
  "requirements": [
    {
      "requirement-url": "https://archrails.io/catalog/req/hipaa/ephi-encryption-at-rest",
      "config": {
        "control-id": "hipaa-ephi-encryption-at-rest",
        "algorithm": "AES-256-GCM",
        "key-management": "hsm-or-kms-cmk",
        "key-rotation-days": 365,
        "fips-140-validated": true
      }
    }
  ]
}

§164.312(d) — Person / entity authentication (hipaa-authentication)

Per-node.

"hipaa-authentication": {
  "description": "HIPAA §164.312(d) — procedures to verify that a person or entity seeking access to ePHI is the one claimed. MFA strongly recommended per HHS guidance.",
  "requirements": [
    {
      "requirement-url": "https://archrails.io/catalog/req/hipaa/authentication",
      "config": {
        "control-id": "hipaa-authentication",
        "mechanism": "saml-sso-plus-mfa",
        "factor-count": 2,
        "factor-types": ["password", "totp-or-webauthn"],
        "service-to-service-auth": "mtls-or-oauth2-client-credentials"
      }
    }
  ]
}

§164.312(e) — Transmission security (hipaa-transmission-security)

Relationship-level. Attach to edges that carry ePHI.

// On a relationship that transmits ePHI:
"controls": {
  "hipaa-transmission-security": {
    "description": "HIPAA §164.312(e)(1) + (2)(i) integrity controls + (2)(ii) encryption — ePHI in transit protected by strong cryptography over networks not exclusively under the firm's control.",
    "requirements": [
      {
        "requirement-url": "https://archrails.io/catalog/req/hipaa/transmission-security",
        "config": {
          "control-id": "hipaa-transmission-security",
          "minimum-tls-version": ["1.2", "1.3"],
          "forbidden-fields": ["http", "ftp", "telnet", "smtp-plain", "ws"],
          "integrity-mechanism": "tls-aead-or-message-auth-code",
          "mutual-auth-required-for-organization-boundary": true
        }
      }
    ]
  }
}
Where enforcement actually happens for this control. This snippet is an audit attestation — it declares your intent that the edge carries TLS-protected ePHI. The substantive enforcement that fires when a code change adds a non-TLS network call comes from ArchRails's relationship-protocol checks on declared CALM edges (AR-REL-006 plaintext-vs-TLS) and the diff-walking AR-REL-008 (external-host) validator. The snippet records the regulatory tag for audit pivot; the engine fires on the edge's protocol field, not on the snippet body. Forbidden-fields here pins your authoring intent so the constraint engine fires if an agent's declared_pattern claims to use a forbidden protocol.

What the engine actually enforces

There is no HIPAA-specific cross-cutter — the engine has no "if ephi-in-scope: true, require these controls" sweep. Enforcement is graph-driven: you attach a control where you want it enforced; the absence of an attach is opt-out by silence.

For the 3 HIPAA controls above, here is the enforcement map:

The other Technical Safeguards (unique user ID, automatic logoff, audit-event logging, integrity controls) declare policy or operational intent that no current ArchRails validator fires on against a diff. Author them in your HIPAA program documentation rather than CALM.

All checks are deterministic — pure function over your CALM JSON. Verdicts are replayable byte-for-byte. The same constraint engine handles PCI DSS, GDPR, SOC 2, MiFID II, ISO 27001:2022, NIST CSF 2, NYDFS Part 500, and any controls you author yourself.

Versioning

This is hipaa-security-rule/v1.0.0 — the first stable cut. Each surviving control has per-validator firing tests + cross-language coverage across 11 Tier A languages (Python, Java, C#, TypeScript, Go, Kotlin, Scala, Rust, Ruby, Swift, PHP). Future bumps: v1.x.y for additive controls and substantive validator coverage; v2.0.0 for breaking changes (control retired, semantics changed). Updates as authoritative guidance or enforcement priorities materially shift.

Out of scope for this template

For those surfaces, pair this template with your HIPAA program documentation and engage a HIPAA-qualified auditor for certification.