You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deepen the clinical realism of the healthcare example while keeping the
FDA/NHS/MOH jurisdiction variants untouched.
- Replace the thin canned EHR data with one coherent patient: ICD-10-coded
diagnoses, medications with dosing, documented allergies and labs. The
clinical_decision_support differential now matches the record.
- Add ehr.drug_interaction_check, which screens a proposed treatment against
the patient's current medications and allergies. The agent passes its result
into the write call.
- Add a medication-contraindication forbid: a severe interaction or allergy
contraindication blocks the treatment-plan write, alongside the existing
EU AI Act Art. 14 high-risk human-oversight rule.
- Three scenarios (standard / high-risk / contraindication), each with a
signed TRACE record regenerated from a real run.
- New clinical_engine module + unit tests and a CI job.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|`financial-services/`| Corporate credit risk agent: six-step assessment with CDD, exposure and IFRS 9 guardrails on the write | SEV-SNP / TDX | EU AI Act Art. 9/12, CRR Art. 395, EBA/GL/2020/06, EU AML, DORA Art. 9 |
16
-
|`healthcare/`| Clinical decision agent: EU AI Act Art. 14 HITL deny on high-risk treatment plans| SEV-SNP / TDX | EU AI Act Art. 14, HIPAA |
16
+
|`healthcare/`| Clinical agent on a coherent ICD-10 patient: drug-interaction check feeds EU AI Act Art. 14 HITL and contraindication denies| SEV-SNP / TDX | EU AI Act Art. 14, HIPAA |
17
17
|`industrial-embodied-ai/`| Material-movement agent with cMCP authorization, an independent safety-controller boundary and offline-verifiable closed-session evidence | TEE / software-only development mode | OT security and industrial robot safety references |
18
18
|`multi-tenant-saas/`| HR SaaS with an EU tenant (enforcing GDPR residency/Art. 9) and a US tenant (advisory) on one catalog | TDX | GDPR Art. 6/9/44, customer DPA |
19
19
|`startup-tpm/`| 15-minute quickstart on any cloud VM with Trusted Launch | TPM 2.0 | Development / staging |
Copy file name to clipboardExpand all lines: healthcare/README.md
+67-32Lines changed: 67 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# healthcare: Clinical Decision Support Agent Demo
2
2
3
-
End-to-end demo of a hospital AI agent processing patient records through a cMCP Runtime with Cedar policy enforcement and signed TRACE Trust Records for healthcare regulatory compliance (EU AI Act Art. 14, HIPAA).
3
+
End-to-end demo of a hospital AI agent running a clinical assessment through a cMCP Runtime with Cedar policy enforcement and signed TRACE Trust Records for healthcare regulatory compliance (EU AI Act Art. 14, HIPAA).
4
+
5
+
The worked patient is a fictional 54-year-old with type 2 diabetes and hypertension. Diagnoses carry ICD-10 codes, medications carry dosing, and the agent runs a drug-interaction check whose result feeds the human-oversight guardrails, so a deny reflects the real safety outcome of the plan.
4
6
5
7
---
6
8
@@ -9,14 +11,17 @@ End-to-end demo of a hospital AI agent processing patient records through a cMCP
9
11
**1. EU AI Act Article 14 - human oversight for high-risk AI**
10
12
The Cedar policy blocks any treatment plan write where `patient_risk_category == "high"`. The deny response carries the policy's `@annotation` metadata as structured advice (`regulation: eu-ai-act-art-14`, `reviewer_role: attending-physician`), and the audit chain records the deny as machine-readable Art. 14 evidence.
11
13
12
-
**2. HIPAA PHI protection at the tool boundary**
13
-
All three tools are classified `compliance_domain: hipaa_phi` in the attested catalog. A Cedar rule forbids PHI tools when no attestation evidence is present, enforcing "PHI only flows through attested runtimes" at the policy layer.
14
+
**2. A medication-safety guardrail that fires on the assessment result**
15
+
The agent runs `ehr.drug_interaction_check` against the patient's current medications and documented allergies, then passes `has_severe_contraindication` into the write call. A Cedar rule blocks the write when a severe contraindication is present, so the guardrail acts on the actual interaction result rather than on a static flag.
16
+
17
+
**3. HIPAA PHI protection at the tool boundary**
18
+
All four tools are classified `compliance_domain: hipaa_phi` in the attested catalog. A Cedar rule forbids PHI tools when no attestation evidence is present, enforcing "PHI only flows through attested runtimes" at the policy layer.
14
19
15
-
**3. Cryptographic proof of the tool call sequence**
20
+
**4. Cryptographic proof of the tool call sequence**
16
21
Every call is recorded in a hash-chained audit log persisted to SQLite. Closing the session seals the chain into a signed `RuntimeClaim` (the TRACE Trust Record): which tools ran, in what order, what was denied - verifiable without trusting the agent process.
17
22
18
-
**4. Two demo paths**
19
-
Run without flags for the happy path (all three calls allowed). Run with `--trigger-hitl` to see the Art. 14 block fire with the advice payload.
23
+
**5. Three demo scenarios**
24
+
`--scenario standard`(all four calls allowed), `--scenario high-risk` (Art. 14 block on a high-risk patient), `--scenario contraindication` (a proposed drug that the patient is allergic to blocks the write).
20
25
21
26
---
22
27
@@ -44,6 +49,7 @@ Run without flags for the happy path (all three calls allowed). Run with `--trig
Scenario: standard | Patient: P-2024-008471 | Risk category: standard
99
+
100
+
[1/4] ehr.patient_record_lookup ...
101
+
-> decision: allow active dx: E11.9, I10, E78.5
102
+
[2/4] ehr.clinical_decision_support ...
103
+
-> decision: allow Type 2 diabetes mellitus, suboptimal glycaemic control
104
+
[3/4] ehr.drug_interaction_check ...
105
+
-> decision: allow highest_severity=none
106
+
[4/4] ehr.treatment_plan_writer ...
107
+
-> decision: allow
104
108
```
105
109
110
+
Contraindication scenario (the patient has a documented sulfonamide allergy, so proposing co-trimoxazole trips a severe contraindication):
111
+
106
112
```
107
-
[3/3] Calling ehr.treatment_plan_writer ...
113
+
[3/4] ehr.drug_interaction_check ...
114
+
-> decision: allow highest_severity=severe
115
+
[4/4] ehr.treatment_plan_writer ...
108
116
-> decision: deny (POLICY_DENY)
109
117
advice from policy:
110
-
id: hitl-high-risk
111
-
reason: human-review-required
118
+
id: medication-contraindication
119
+
reason: severe-contraindication-detected
112
120
regulation: eu-ai-act-art-14
113
121
reviewer_role: attending-physician
114
122
@@ -133,7 +141,7 @@ permit (
133
141
};
134
142
```
135
143
136
-
On top of the workflow-scoped permits sit two forbid rules. Annotations on a `forbid` are returned to the caller as structured advice when that rule causes a deny:
144
+
On top of the workflow-scoped permits sit three forbid rules (high-risk human oversight, severe medication contraindication, and the HIPAA attestation gate). Annotations on a `forbid` are returned to the caller as structured advice when that rule causes a deny:
137
145
138
146
```cedar
139
147
@id("hitl-high-risk")
@@ -150,17 +158,34 @@ forbid (
150
158
};
151
159
```
152
160
161
+
The second forbid blocks the write when the drug-interaction check returned a severe contraindication:
162
+
163
+
```cedar
164
+
@id("medication-contraindication")
165
+
@reason("severe-contraindication-detected")
166
+
@regulation("eu-ai-act-art-14")
167
+
@reviewer_role("attending-physician")
168
+
forbid (
169
+
principal,
170
+
action == Action::"Ehr.treatmentPlanWriter",
171
+
resource
172
+
) when {
173
+
context.arguments has has_severe_contraindication &&
Action names follow the cMCP convention: `ehr.treatment_plan_writer` becomes `Action::"Ehr.treatmentPlanWriter"` (PascalCase per underscore segment). Tool arguments are available under `context.arguments`.
154
179
155
180
---
156
181
157
182
## The TRACE Trust Record
158
183
159
-
See `trace-output/example-trust-record.json` - captured from a real run of this demo. Key fields:
184
+
`trace-output/` holds one signed record per scenario (`standard-trust-record.json`, `high-risk-trust-record.json`, `contraindication-trust-record.json`), captured from real runs. Verify one with `cmcp verify trace-output/high-risk-trust-record.json` (schema, signature and audit chain pass; hardware attestation fails in software-only dev mode). Key fields:
160
185
161
186
| Field | Meaning |
162
187
|---|---|
163
-
|`trace.policy.bundle_hash` / `version`| Exactly which Cedar bundle was enforced (`clinical-hipaa-v2.1`) |
188
+
|`trace.policy.bundle_hash` / `version`| Exactly which Cedar bundle was enforced (`clinical-safety-v3.0`) |
164
189
|`trace.data_class`| Highest sensitivity touched in the session (`confidential`) |
165
190
|`trace.tool_transcript.hash`| Hash of the audit chain tip covering all calls |
166
191
|`trace.cnf.jwk`| The runtime's Ed25519 signing key (verifies `signature`) |
`tests/test_clinical_engine.py` checks that diagnoses carry ICD-10 codes, that the differential matches the record, that an appropriate second-line agent is safe, and that a sulfonamide allergy and a drug-drug interaction are both detected.
227
+
228
+
```bash
229
+
python -m unittest discover -s tests -v
230
+
```
231
+
232
+
---
233
+
199
234
## Regulatory Variants
200
235
201
236
This demo uses EU AI Act Art. 14 and HIPAA as its primary policy example. Additional
0 commit comments