Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HIPAA Safeguards – Control Mapping

This document maps the HIPAA Security Rule safeguards (45 CFR Part 164, Subpart C) to Mnemo’s security architecture. It is intended for organizations that deploy Mnemo in environments where Protected Health Information (PHI) may be stored as agent memories.

HIPAA compliance is a shared responsibility between Mnemo (as the software component) and the deploying organization (as the covered entity or business associate). This document identifies which safeguards Mnemo addresses through its architecture and which require operational controls from the deploying organization.

For background on Mnemo’s security features, see the Security page and the Compliance Overview.


Administrative Safeguards (Section 164.308)

Administrative safeguards are administrative actions, policies, and procedures to manage the selection, development, implementation, and maintenance of security measures to protect ePHI.

164.308(a)(1) – Security Management Process

Requirement: Implement policies and procedures to prevent, detect, contain, and correct security violations.

(i) Risk Analysis (Required)

FieldDetail
HIPAA Reference164.308(a)(1)(ii)(A)
RequirementConduct an accurate and thorough assessment of the potential risks and vulnerabilities to the confidentiality, integrity, and availability of ePHI.
Mnemo ImplementationMnemo provides built-in risk analysis capabilities through the memory poisoning detection system (crates/mnemo-core/src/query/poisoning.rs). The check_for_anomaly() function evaluates three risk vectors for every memory write: importance deviation from agent baseline, content length anomalies, and high-frequency burst detection. Agent behavioral profiles (AgentProfile) are maintained with running averages to establish baselines. The anomaly scoring system produces quantified risk assessments (AnomalyCheckResult with score and reasons).
StatusPartially Implemented
GapsMnemo provides automated risk detection for data integrity threats but does not replace a comprehensive organizational risk analysis. Deploying organizations must conduct their own risk assessment covering infrastructure, personnel, and operational risks.

(ii) Risk Management (Required)

FieldDetail
HIPAA Reference164.308(a)(1)(ii)(B)
RequirementImplement security measures sufficient to reduce risks and vulnerabilities to a reasonable and appropriate level.
Mnemo ImplementationMnemo implements multiple security measures: AES-256-based encryption at rest (encryption.rs), SHA-256 hash chain integrity verification (hash.rs), six-level RBAC (acl.rs), scoped delegation with depth limits (delegation.rs), automatic quarantine of anomalous memories, TTL enforcement for data retention, and cognitive forgetting for automatic data lifecycle management (lifecycle.rs).
StatusImplemented
GapsEncryption implementation should be upgraded to production-grade aes-gcm crate. See SOC 2 CC6.3 for details.

(iii) Sanction Policy (Required)

FieldDetail
HIPAA Reference164.308(a)(1)(ii)(C)
RequirementApply appropriate sanctions against workforce members who fail to comply with security policies.
Mnemo ImplementationThe delegation model supports revocation (revoke_delegation()) to immediately terminate an agent’s delegated access. Quarantine isolates suspect agent activity. The event log provides evidence for sanction decisions.
StatusPartially Implemented
GapsSanction policies are organizational responsibilities. Mnemo provides the enforcement mechanisms but does not define the policies themselves.

(iv) Information System Activity Review (Required)

FieldDetail
HIPAA Reference164.308(a)(1)(ii)(D)
RequirementImplement procedures to regularly review records of information system activity, such as audit logs, access reports, and security incident tracking reports.
Mnemo ImplementationThe AgentEvent log (crates/mnemo-core/src/model/event.rs) provides an immutable, hash-chained audit trail. It captures 15 event types covering all data operations. Events include OpenTelemetry fields for correlation. The StorageBackend trait provides query methods: list_events(agent_id, limit, offset), get_events_by_thread(thread_id, limit), list_child_events(parent_event_id, limit). The mnemo.verify MCP tool enables integrity verification of the event chain.
StatusImplemented
GapsAdd scheduled activity review reports and dashboards. Implement automated alerting for suspicious activity patterns.

164.308(a)(2) – Assigned Security Responsibility

FieldDetail
HIPAA Reference164.308(a)(2)
RequirementIdentify the security official responsible for developing and implementing security policies.
Mnemo ImplementationMnemo’s permission model supports Admin-level principals who have full control over all operations. The PrincipalType::Role type enables mapping organizational security roles to Mnemo permissions.
StatusOperational
GapsThis is an organizational requirement. Mnemo provides the RBAC infrastructure to support it. The deploying organization must designate a security official and map their role to Mnemo’s Admin permission.

164.308(a)(3) – Workforce Security

Requirement: Implement policies and procedures to ensure that all members of the workforce have appropriate access to ePHI.

(i) Authorization and/or Supervision (Addressable)

FieldDetail
HIPAA Reference164.308(a)(3)(ii)(A)
RequirementImplement procedures for the authorization and/or supervision of workforce members who work with ePHI.
Mnemo ImplementationThe three-tier access control model (Owner, ACL, Delegation) ensures that agents only access memories they are authorized for. The list_accessible_memory_ids() method on StorageBackend enforces this during vector search. Every ACL entry records granted_by to track authorization chains. Delegation records track both delegator_id and delegate_id with max_depth and current_depth for oversight.
StatusImplemented
GapsNone at the application level.

(ii) Workforce Clearance Procedure (Addressable)

FieldDetail
HIPAA Reference164.308(a)(3)(ii)(B)
RequirementImplement procedures to determine that the access of a workforce member to ePHI is appropriate.
Mnemo ImplementationThe permission hierarchy (Permission::satisfies()) enforces that each agent has only the minimum required permission level. Delegation scope (DelegationScope::AllMemories, ByTag, ByMemoryId) restricts access to relevant data subsets. Time-bounded ACLs and delegations (expires_at) ensure access is reviewed and renewed.
StatusImplemented
GapsAdd periodic access review reports listing all active permissions and delegations per agent.

(iii) Termination Procedures (Addressable)

FieldDetail
HIPAA Reference164.308(a)(3)(ii)(C)
RequirementImplement procedures for terminating access to ePHI when employment or access is no longer required.
Mnemo ImplementationDelegation revocation (revoke_delegation()) sets revoked_at timestamp to immediately terminate delegated access. ACL entries support expires_at for automatic expiration. Soft delete (soft_delete_memory()) preserves audit history while removing access to the content.
StatusImplemented
GapsAdd a bulk access termination API that revokes all permissions for a given agent in a single operation.

164.308(a)(4) – Information Access Management

Requirement: Implement policies and procedures for authorizing access to ePHI.

(i) Isolating Health Care Clearinghouse Functions (Required)

FieldDetail
HIPAA Reference164.308(a)(4)(ii)(A)
RequirementIf a health care clearinghouse is part of a larger organization, isolate its functions.
Mnemo ImplementationMemory scoping (Private, Shared, Public, Global) combined with org_id field enables organizational isolation. Multi-tenant deployments can use org_id to enforce data separation at the storage layer.
StatusPartially Implemented
GapsImplement strict tenant isolation enforcement at the database level. Add cross-org access prevention in all query paths.

(ii) Access Authorization (Addressable)

FieldDetail
HIPAA Reference164.308(a)(4)(ii)(B)
RequirementImplement policies and procedures for granting access to ePHI.
Mnemo ImplementationThe mnemo.share MCP tool provides explicit access granting. The mnemo.delegate MCP tool enables controlled permission delegation. Both record the granting agent and support time bounds.
StatusImplemented
GapsNone.

(iii) Access Establishment and Modification (Addressable)

FieldDetail
HIPAA Reference164.308(a)(4)(ii)(C)
RequirementImplement policies and procedures that establish, document, review, and modify access.
Mnemo ImplementationAll access changes are logged as AgentEvent records (MemoryShare event type). ACL entries include created_at and expires_at for temporal tracking. Delegation records include creation time, expiration, and revocation timestamps.
StatusImplemented
GapsNone.

164.308(a)(5) – Security Awareness and Training

Requirement: Implement a security awareness and training program for all members of the workforce.

FieldDetail
HIPAA Reference164.308(a)(5)
RequirementSecurity reminders, malicious software protection, log-in monitoring, password management.
Mnemo ImplementationMnemo provides documentation on security best practices (see docs/src/security.md). The memory poisoning detection system protects against malicious data injection. The event log enables monitoring of all access attempts.
StatusPartially Implemented
GapsThis is primarily an organizational requirement. Create deployment-specific security guides for teams handling PHI. Add security warning messages for operations involving high-sensitivity memories.

164.308(a)(6) – Security Incident Procedures

Requirement: Implement policies and procedures to address security incidents.

FieldDetail
HIPAA Reference164.308(a)(6)(ii)
RequirementIdentify and respond to suspected or known security incidents; mitigate harmful effects; document incidents and outcomes.
Mnemo ImplementationQuarantine mechanism automatically responds to detected anomalies. Hash chain verification (mnemo.verify) identifies data tampering incidents. The event log provides a forensic trail for incident investigation. Checkpoint restore enables rollback to pre-incident state. Delegation revocation enables immediate access termination.
StatusPartially Implemented
GapsImplement a formal incident tracking system within Mnemo (incident records, severity levels, resolution status). Add automated incident notification capabilities.

164.308(a)(7) – Contingency Plan

Requirement: Establish policies and procedures for responding to an emergency or other occurrence that damages systems containing ePHI.

(i) Data Backup Plan (Required)

FieldDetail
HIPAA Reference164.308(a)(7)(ii)(A)
RequirementEstablish and implement procedures to create and maintain retrievable exact copies of ePHI.
Mnemo ImplementationThe checkpoint system (crates/mnemo-core/src/model/checkpoint.rs) creates point-in-time snapshots with state_snapshot, memory_refs, and event_cursor. Checkpoints include parent_id for history linking. The mnemo.checkpoint MCP tool enables programmatic backup creation. DuckDB storage supports file-level backups of the database file.
StatusPartially Implemented
GapsImplement automated scheduled backups. Add backup verification (restore testing). Implement offsite backup replication.

(ii) Disaster Recovery Plan (Required)

FieldDetail
HIPAA Reference164.308(a)(7)(ii)(B)
RequirementEstablish procedures to restore any loss of data.
Mnemo ImplementationThe mnemo.replay MCP tool replays events from a checkpoint to restore state. Branch and merge operations enable state recovery from alternative timelines. The checkpoint system captures sufficient state for full reconstruction.
StatusPartially Implemented
GapsDocument formal disaster recovery procedures. Define Recovery Time Objective (RTO) and Recovery Point Objective (RPO). Implement automated recovery testing.

(iii) Emergency Mode Operation Plan (Required)

FieldDetail
HIPAA Reference164.308(a)(7)(ii)(C)
RequirementEstablish procedures to enable continuation of critical business processes during an emergency.
Mnemo ImplementationMnemo can operate with a local DuckDB file, enabling standalone operation without network dependencies. The NoopEmbedding provider allows operation without external API access.
StatusPartially Implemented
GapsDocument emergency operating procedures. Define minimum viable configuration for emergency operation.

164.308(a)(8) – Evaluation

FieldDetail
HIPAA Reference164.308(a)(8)
RequirementPerform periodic technical and nontechnical evaluation of security controls.
Mnemo ImplementationThe mnemo.verify MCP tool enables on-demand integrity verification. Criterion benchmarks track performance characteristics. The test suite (67 tests) validates security controls.
StatusPartially Implemented
GapsImplement scheduled security evaluations. Add compliance assessment tooling. Create security metrics dashboards.

Physical Safeguards (Section 164.310)

Physical safeguards are physical measures, policies, and procedures to protect electronic information systems and related buildings and equipment from natural and environmental hazards and unauthorized intrusion.

164.310(a)(1) – Facility Access Controls

FieldDetail
HIPAA Reference164.310(a)(1)
RequirementImplement policies and procedures to limit physical access to electronic information systems while ensuring that properly authorized access is allowed.
Mnemo ImplementationAs a software component, Mnemo defers facility-level controls to the deployment environment. The Docker deployment (Dockerfile) uses a minimal debian:bookworm-slim base image, reducing the attack surface. The Kubernetes deployment guide provides pod security recommendations.
StatusOperational
GapsThis is entirely an operational requirement. Document recommended deployment environments with facility access controls.

164.310(b) – Workstation Use

FieldDetail
HIPAA Reference164.310(b)
RequirementImplement policies and procedures that specify the proper functions to be performed and the physical attributes of the surroundings of workstations that access ePHI.
Mnemo ImplementationNot directly applicable to Mnemo as a server-side component. The MCP STDIO transport binds sessions to individual agent processes.
StatusOperational
GapsDocument workstation security requirements for operators who administer Mnemo deployments.

164.310(c) – Workstation Security

FieldDetail
HIPAA Reference164.310(c)
RequirementImplement physical safeguards for all workstations that access ePHI.
Mnemo ImplementationNot directly applicable. See workstation use above.
StatusOperational
GapsDocument workstation security requirements in the deployment guide.

164.310(d)(1) – Device and Media Controls

Requirement: Implement policies and procedures that govern the receipt and removal of hardware and electronic media containing ePHI.

(i) Disposal (Required)

FieldDetail
HIPAA Reference164.310(d)(2)(i)
RequirementImplement policies for the final disposition of ePHI and/or the hardware or electronic media on which it is stored.
Mnemo Implementationhard_delete_memory() permanently removes records from DuckDB storage. cleanup_expired() removes expired memories. Cognitive forgetting (run_decay_pass()) automatically transitions aging memories through the Archived and Forgotten states. Encrypted content requires the encryption key for meaningful access.
StatusPartially Implemented
GapsImplement secure wipe (zero-fill) for hard-deleted records. Add cryptographic erasure support (destroying the encryption key to render stored ciphertext unrecoverable). Document media disposal procedures.

(ii) Media Re-use (Required)

FieldDetail
HIPAA Reference164.310(d)(2)(ii)
RequirementImplement procedures for removal of ePHI from electronic media before re-use.
Mnemo ImplementationDuckDB file storage can be wiped by deleting the database file. Encrypted content is not recoverable without the encryption key.
StatusOperational
GapsDocument media re-use procedures. Implement database purge utilities.

Technical Safeguards (Section 164.312)

Technical safeguards are the technology, and the policy and procedures for its use, that protect ePHI and control access to it.

164.312(a)(1) – Access Control

Requirement: Implement technical policies and procedures for electronic information systems that maintain ePHI to allow access only to those persons or software programs that have been granted access rights.

(i) Unique User Identification (Required)

FieldDetail
HIPAA Reference164.312(a)(2)(i)
RequirementAssign a unique name and/or number for identifying and tracking user identity.
Mnemo ImplementationEvery agent is identified by a unique agent_id string. All operations (memory CRUD, events, delegations) are attributed to the performing agent. The PrincipalType enum supports five identity types: Agent, User, Org, Role, Public. Memory records track created_by for creator attribution. Event records include agent_id, thread_id, and run_id for operation attribution.
StatusImplemented
GapsNone. Unique identification is comprehensive.

(ii) Emergency Access Procedure (Required)

FieldDetail
HIPAA Reference164.312(a)(2)(ii)
RequirementEstablish procedures for obtaining necessary ePHI during an emergency.
Mnemo ImplementationAdmin-level permissions provide unrestricted access. Mnemo can operate locally with DuckDB without network dependencies. Checkpoint restore enables recovery of specific state snapshots.
StatusPartially Implemented
GapsDocument emergency access procedures. Implement break-glass access mechanism with enhanced audit logging.

(iii) Automatic Logoff (Addressable)

FieldDetail
HIPAA Reference164.312(a)(2)(iii)
RequirementImplement electronic procedures that terminate an electronic session after a predetermined time of inactivity.
Mnemo ImplementationMCP STDIO sessions are bound to process lifetime. ACL entries and delegations support expires_at for time-based access termination.
StatusPartially Implemented
GapsImplement session timeout for REST API connections. Add configurable inactivity timeout for MCP sessions.

(iv) Encryption and Decryption (Addressable)

FieldDetail
HIPAA Reference164.312(a)(2)(iv)
RequirementImplement a mechanism to encrypt and decrypt ePHI.
Mnemo ImplementationThe ContentEncryption module (crates/mnemo-core/src/encryption.rs) provides encryption/decryption of memory content. Keys are 256-bit, loaded from environment variables. The encryption produces nonce || ciphertext || tag format with integrity verification on decryption.
StatusPartially Implemented
GapsUpgrade to production-grade AES-256-GCM using the aes-gcm crate (currently uses a simplified XOR cipher). Implement key rotation. Add per-field encryption for metadata.

164.312(b) – Audit Controls

FieldDetail
HIPAA Reference164.312(b)
RequirementImplement hardware, software, and/or procedural mechanisms that record and examine activity in information systems that contain or use ePHI.
Mnemo ImplementationThe AgentEvent system provides comprehensive audit logging. Every data access operation generates an event record with: unique id (UUID v7, time-ordered), agent_id, thread_id, run_id, event_type (15 types covering all operations), payload (JSON with operation details), timestamp, logical_clock (monotonic ordering), content_hash and prev_hash (hash chain integrity). OpenTelemetry fields (trace_id, span_id) enable correlation with external observability systems. Query methods support review by agent, thread, or event hierarchy.
StatusImplemented
GapsAdd tamper-evident log export to external storage. Implement log retention policies. Add real-time audit stream for SIEM integration.

164.312(c)(1) – Integrity

Requirement: Implement policies and procedures to protect ePHI from improper alteration or destruction.

(i) Mechanism to Authenticate ePHI (Addressable)

FieldDetail
HIPAA Reference164.312(c)(2)
RequirementImplement electronic mechanisms to corroborate that ePHI has not been altered or destroyed in an unauthorized manner.
Mnemo ImplementationThe hash chain system (crates/mnemo-core/src/hash.rs) provides two levels of integrity verification: (1) Content hashcompute_content_hash(content, agent_id, timestamp) produces a SHA-256 hash of each memory’s content, agent, and timestamp. (2) Chain hashcompute_chain_hash(content_hash, prev_hash) links each record to its predecessor, creating a tamper-evident chain. verify_chain() validates both content hashes and chain linkage, reporting ChainVerificationResult with the exact record where tampering is detected. The encryption module adds a 16-byte HMAC tag to ciphertext, verified on decryption. Memory versioning (version, prev_version_id) tracks all modifications.
StatusImplemented
GapsAdd automated periodic integrity verification. Consider adding digital signatures for non-repudiation.

164.312(d) – Person or Entity Authentication

FieldDetail
HIPAA Reference164.312(d)
RequirementImplement procedures to verify that a person or entity seeking access to ePHI is the one claimed.
Mnemo ImplementationAgent identity is established through the agent_id field on all operations. The MCP STDIO transport binds sessions to OS-level processes. The permission system verifies that the requesting agent has appropriate authorization before returning data.
StatusPartially Implemented
GapsImplement cryptographic authentication (API keys, mTLS, JWT). Add support for multi-factor authentication for administrative operations. Integrate with external identity providers (OIDC, SAML, LDAP).

164.312(e)(1) – Transmission Security

Requirement: Implement technical security measures to guard against unauthorized access to ePHI that is being transmitted over an electronic communications network.

(i) Integrity Controls (Addressable)

FieldDetail
HIPAA Reference164.312(e)(2)(i)
RequirementImplement security measures to ensure that electronically transmitted ePHI is not improperly modified without detection.
Mnemo ImplementationContent hashes travel with memory records, enabling integrity verification at the receiving end. The hash chain provides ordering integrity across sequences of records.
StatusPartially Implemented
GapsImplement message-level signatures for MCP protocol messages. Add integrity verification for REST API responses.

(ii) Encryption (Addressable)

FieldDetail
HIPAA Reference164.312(e)(2)(ii)
RequirementImplement a mechanism to encrypt ePHI whenever deemed appropriate during transmission.
Mnemo ImplementationThe MCP STDIO transport operates over local Unix pipes, which are not exposed to network transmission. For network deployments, the documentation recommends TLS. The PostgreSQL mode supports TLS connections. The Docker deployment guide recommends reverse proxy with TLS termination.
StatusPartially Implemented
GapsEnforce TLS for all network transports (reject non-TLS connections). Implement TLS certificate pinning for PostgreSQL connections. Add MCP-over-TLS support for remote agent connections.

Summary Matrix

Safeguard CategorySectionStatusKey Modules
Security Management164.308(a)(1)Partially Implementedpoisoning.rs, encryption.rs, hash.rs, acl.rs
Assigned Security Responsibility164.308(a)(2)Operationalacl.rs (Admin role)
Workforce Security164.308(a)(3)Implementedacl.rs, delegation.rs
Information Access Management164.308(a)(4)Implementedacl.rs, delegation.rs, MCP tools
Security Awareness164.308(a)(5)Partially Implementedpoisoning.rs, documentation
Security Incident Procedures164.308(a)(6)Partially ImplementedQuarantine, hash.rs, event.rs
Contingency Plan164.308(a)(7)Partially Implementedcheckpoint.rs, MCP tools
Evaluation164.308(a)(8)Partially Implementedhash.rs, test suite
Facility Access164.310(a)(1)OperationalDocker, Kubernetes
Workstation Use/Security164.310(b-c)OperationalN/A
Device and Media Controls164.310(d)(1)Partially ImplementedDelete operations, encryption.rs
Access Control164.312(a)(1)Partially Implementedacl.rs, delegation.rs, encryption.rs
Audit Controls164.312(b)Implementedevent.rs
Integrity164.312(c)(1)Implementedhash.rs, encryption.rs
Authentication164.312(d)Partially Implementedagent_id, MCP session binding
Transmission Security164.312(e)(1)Partially ImplementedTLS recommendations, hash.rs

Priority Gaps for HIPAA Compliance

The following items represent the highest-priority gaps for organizations deploying Mnemo in HIPAA-regulated environments. They are listed in recommended order of implementation:

  1. Upgrade encryption to production-grade AES-256-GCM (164.312(a)(2)(iv)) – Replace the simplified XOR cipher with the aes-gcm crate. This is the single most critical gap for HIPAA compliance.

  2. Implement cryptographic authentication (164.312(d)) – Add API key management, mTLS, or JWT-based authentication. Agent identity must be cryptographically verified, not just asserted.

  3. Enforce TLS for all network transports (164.312(e)(2)(ii)) – Reject non-TLS connections in network deployment modes. Implement certificate validation.

  4. Add key rotation and management (164.312(a)(2)(iv)) – Implement encryption key rotation without downtime. Add envelope encryption for per-record key management.

  5. Implement automated backup and recovery (164.308(a)(7)) – Add scheduled checkpoint creation, backup verification, and documented recovery procedures with defined RTO/RPO.

  6. Add session timeout (164.312(a)(2)(iii)) – Implement configurable inactivity timeout for REST API and MCP sessions.

  7. Implement tenant isolation (164.308(a)(4)) – Enforce strict data separation by org_id at the database query level to prevent cross-tenant data leakage.

  8. Implement break-glass access (164.312(a)(2)(ii)) – Add an emergency access mechanism with enhanced audit logging for HIPAA-mandated emergency access procedures.


Deployment Recommendations for Covered Entities

Organizations subject to HIPAA that deploy Mnemo should implement the following operational controls in addition to Mnemo’s built-in safeguards:

Infrastructure

  • Deploy Mnemo behind a TLS-terminating reverse proxy (e.g., nginx, Envoy).
  • Use PostgreSQL mode with TLS-encrypted connections for production.
  • Store the encryption key (MNEMO_ENCRYPTION_KEY) in a secrets manager (e.g., HashiCorp Vault, AWS Secrets Manager), not in environment files.
  • Run Mnemo containers with read-only root filesystems and non-root users.
  • Implement network policies restricting Mnemo’s inbound and outbound traffic.

Operations

  • Assign a security official responsible for Mnemo deployment and configuration.
  • Conduct a risk assessment specific to your PHI data flows through Mnemo.
  • Establish backup schedules using the checkpoint system with offsite replication.
  • Document and test disaster recovery procedures quarterly.
  • Implement log forwarding from Mnemo’s event log to your SIEM system.
  • Schedule periodic hash chain verification using the mnemo.verify tool.

Access Management

  • Map organizational roles to Mnemo’s permission hierarchy.
  • Use time-bounded delegations with the minimum required permission level.
  • Review active ACLs and delegations quarterly.
  • Implement agent deprovisioning procedures that revoke all permissions.
  • Maintain an access authorization matrix mapping agents to data categories.

Incident Response

  • Define incident severity levels for Mnemo security events.
  • Establish escalation procedures for quarantine events and verification failures.
  • Document breach notification procedures per HIPAA requirements (60-day notification timeline).
  • Conduct tabletop exercises simulating data integrity incidents.

Training

  • Train operators on Mnemo’s security features and compliance controls.
  • Include Mnemo-specific content in HIPAA security awareness training.
  • Document procedures for handling PHI within agent memory workflows.