Skip to content

ADR-2253: Identity Vault and Layered Participant Identity (K006) ​

  • Status: Accepted
  • Date: 2026-09-29
  • Authors: @fderuiter
  • Deciders: @fderuiter

1. Context & Problem Statement ​

A participant is not a subject code. The same human has a healthcare identity (name, date of birth, MRN), may appear first as a recruitment candidate, becomes a study participant, carries a site-local screening number, a sponsor pseudonym and finally a submission identifier (USUBJID). EHR ingestion, decentralised trials and real-world data (ICH E6(R3) Annex 2) make those layers meet inside one platform. Privacy law (GDPR, HIPAA) and 21 CFR Part 11 §11.10(d) access controls (PRD-SYS-053) require that only authorised actors resolve a pseudonym to a person, and that every resolution is audited.

Today apps/execution stores an EncryptedDemographics blob on ClinicalSubject, with AES-GCM services local to that app, and other modules keep their own personal data.

2. Decision Drivers & Constraints ​

  • Driver 1 (minimisation): kernel APIs and projections carry ParticipantId only.
  • Driver 2 (controlled resolution): each identity layer has its own capability; every reveal is audited in the tenant chain.
  • Driver 3 (erasure vs retention): direct identifiers can be erased where law requires while GCP records remain.
  • Driver 4 (consistency): vault writes that accompany kernel commands must not drift from kernel state.

3. Options Considered ​

Option 1: Separate schema and key hierarchy inside the kernel deployment (Selected) ​

  • Overview: An identity_vault schema in the same database, owned by a separate role that the general application role cannot read. Envelope encryption: per-tenant key-encryption key in a KMS (cloud KMS in production, a local key file in development), per-record data keys, AES-256-GCM. Blind indexes (keyed HMAC) support exact-match lookup without decryption. Access only through the IIdentityVault port.
  • Pros:
    • ✅ Same transaction as the kernel command when needed; no cross-service drift.
    • ✅ Database role separation plus encryption: a leaked kernel dump contains no direct identifiers.
    • ✅ Crypto-shredding (delete the data key) implements erasure.
  • Cons:
    • ❌ Key management and rotation must be built and validated.

Option 2: Separate identity service ​

  • Pros:
    • ✅ Strongest runtime separation.
  • Cons:
    • ❌ Distributed consistency between vault and kernel, which the kernel architecture exists to avoid (ADR-2244).
    • ❌ Another service to operate and validate.

Option 3: Encrypted columns on kernel tables ​

  • Pros:
    • ✅ Simplest.
  • Cons:
    • ❌ Personal data sits next to clinical data under the same role; no layer-by-layer resolution control.

4. Decision Outcome ​

  • Chosen Option: Option 1.
  • Justification: It separates personal data by role and key while keeping transactional consistency, and it leaves room to move the vault to its own database later behind the same port.

Identity layers and resolution capabilities: identity.reveal.person, identity.reveal.site_local, identity.link.cross_study, identity.match.ehr. Linking a person across studies or matching an EHR record is a vault command with evidence and audit (K-IDN-2). Submission identifiers are generated by the standards projection.

5. Consequences & Trade-offs ​

  • Positive Impact: Recruitment, EHR and RWD sources can join the platform without spreading personal data.
  • Negative Impact / Technical Debt: Execution's AES-GCM services and EncryptedDemographics migrate into the vault (migration slice S4).
  • Mitigation Strategy: Key rotation re-wraps data keys only; migration re-encrypts per record with a verification pass.

6. Implementation & Verification ​

  • Affected Assemblies: Cadence.Kernel.Abstractions (IIdentityVault), Cadence.Kernel.Persistence (vault schema, role, key provider), apps/execution (migration).
  • Tracked by: #4782.
  • Verification Plan:
    • Integration test: the application role cannot select from the vault schema.
    • Every reveal writes an audit entry; a reveal without the capability is denied.
    • Crypto-shred test: after data-key deletion the record is unreadable and kernel records remain intact.