
Healthclaw Guardrails
io.github.aks129由 GitHub 帳號 aks129 發布v1.6.0更新於 Nov 2, 2026
Guardrailed FHIR access for AI agents: PHI redaction, audit trail, step-up auth, tenant isolation
概覽
帶防護欄的 FHIR 代理,讓 AI 助理在 PHI 去識別化、稽核紀錄、步進驗證與租戶隔離下讀寫健康紀錄。
- 可以做什麼
- 讀取與搜尋 FHIR 資源,包含去識別化、結構驗證、統計、最近 N 筆觀測與 Compiled Truth 時間軸
- 解讀檢驗結果、列出預防保健缺口、評估 R6 權限並列出訂閱主題
- 預填與擷取 HL7 SDC 問卷,評估並修正資料品質問題
- 在步進權杖保護下預覽與提交 FHIR 寫入,並提出或提交真實世界的電話與簡訊動作
- 簽發步進權杖、為示範租戶灌入資料,並執行防護欄一致性自我測試
- 適用情境
- 適合助理需要處理 FHIR 臨床資料、但不應看到原始識別碼,且每次存取都要被稽核並依租戶隔離的情境。也適合先用合成示範資料驗證這套防護欄模式,再接到真實 FHIR 伺服器。
- 執行需求
- 遠端 streamable HTTP 端點;公開示範租戶不需憑證。寫入類工具與非公開租戶的讀取需要 X-Step-Up-Token 標頭,請求以 X-Tenant-Id 指定租戶。自行部署需要 Python、STEP_UP_SECRET,可選上游 FHIR 位址與資料庫。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Healthclaw Guardrails,將其新增到工作區。
- 連接 Custom headers 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.aks129%2Fhealthclaw-guardrails/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"healthclaw-guardrails": {
"type": "http",
"url": "https://mcp-server-production-5112.up.railway.app/mcp",
"headers": {
"X-Tenant-Id": "<VALUE>",
"X-Step-Up-Token": "<VALUE>"
}
}
}
}README
HealthClaw Guardrails
The open-source security layer between AI agents and clinical data.
FHIR standardized how health data is structured. MCP standardized how AI connects to tools. Nobody standardized the guardrails in between. This project does.
[HealthClaw 2.0 demo video preview]
▶ Watch the 90-second demo
All records are synthetic. The chat ran on a third-party model, best of four takes. No clinician has signed off yet. How it was made.
[Release] [License] [CI] [Code size]
[Stars] [Forks] [Issues] [Contributors] [Last commit]
[Tests] [MCP tools] [FHIR] [Guardrail conformance] [Glama score] [Python] [Docker]
Quick Start · MCP Tools · Recipes · Roadmap · Claude Plugin · Architecture · healthclaw.io · Contributing · Dev Guide
What it is: an open reference implementation of the FHIR × MCP guardrail layer — PHI redaction, immutable audit, step-up auth, and tenant isolation — that sits between any AI agent and any FHIR server. Built in the open as a community project, MIT-licensed. Not a product, not a pitch: if the pattern is useful, take it; if it's wrong, tell us or fix it.
This is a community effort. It's most useful when implementers, clinicians, and standards folks poke holes in it. Issues, PRs, and "you got the SDC extraction wrong" critiques are all welcome — start with CONTRIBUTING.md and the Code of Conduct.
At a glance: v2.1.0, with 4,000+ Python and 200+ Node tests across 29 MCP tools.
CareAgents is the hosted consumer app: passkey sign-in, advisors, and chat on the web. iMessage works where it's offered; Telegram is not open in the beta.
Two rails run end to end — real-world actions behind a provably out-of-band gate, and forms ($populate → human review → provenance PDF).
Standards: FHIR R4 US Core v9 and R6 v6.0.0-ballot3, HL7 SDC forms, NQF 0018.
Operations: lab interpreter ($interpret), care-gaps reminders ($care-gaps) with an embedded MCP-App view, and ChatGPT-connector search/fetch.
Connectors: Fasten TEFCA, HealthEx, HBO, Flexpa, Epic, MEDENT, Open Wearables, SMART Health Links.
Also a Claude Code plugin and OpenAI/Gemini adapters.
Try it in 60 seconds — no clone, no keys
The hosted demo runs synthetic data behind the full guardrail stack:
Point any MCP client at the public demo server — URL https://mcp-demo-production-ee2c.up.railway.app/mcp,
no key required — then ask: "Search my health records for lab results and explain them in plain
language." The demo server is unauthenticated but hard-pinned to a synthetic demo tenant, so it can
only ever serve fake data. A separate production endpoint (mcp-server-production-5112) requires a
deployment-scoped Authorization: Bearer <token> — real records stay behind auth, always. Hosted
connectors cannot attach that header, so the demo URL above is the one to paste.
One-command installs:
gemini extensions install https://github.com/aks129/HealthClawGuardrails ·
claude plugin marketplace add aks129/HealthClawGuardrails ·
skills on ClawHub
Non-developer? Step-by-step guides for Claude (web/desktop/phone), Perplexity, ChatGPT, Grok, Meta Muse and Telegram — plus a 10-minute demo script — in docs/quickstarts/.
Listed in: Official MCP Registry (io.github.aks129/healthclaw-guardrails) ·
Glama (hosted connector) ·
ClawHub (14 skills) ·
Gemini CLI Extensions · agent-skills discovery at /.well-known/agent-skills/
Release highlights
Full notes live in Releases.
What It Does
This is a vendor-neutral guardrail proxy that sits between any AI agent and any FHIR server. Every request passes through:
- PHI redaction — Names truncated to initials, identifier values removed (system and type kept), addresses stripped, birth dates truncated to year
- Immutable audit trail — Every read/write logged with tenant, agent, timestamp
- Step-up authorization — HMAC-SHA256 tokens required for writes
- Human-in-the-loop — real-world actions (calls, SMS, forms):
commitonly submits. Execution requires a provably out-of-band single-use approval bound to the action, which the agent's own toolchain cannot satisfy. Direct clinical FHIR writes answer HTTP 428 until anX-Human-Confirmedheader is present. The caller sets that header, so it is not a human gate: a known gap tracked in #214 - Tenant isolation — Every query scoped to tenant, cross-tenant access blocked
- Medical disclaimers — Injected on all clinical resource reads
- Compiled Truth — Current state + append-only evidence trail for every resource
How it differs from a plain FHIR MCP server
Direct clinical FHIR writes are the exception to the approval row: they still gate on a header the caller sets (#214).
Prove it: guardrail conformance
The guardrails are verifiable, not marketing. A runnable harness probes any deployment with synthetic data and emits a scorecard across all seven properties — run it against your own instance (or ours):
Or hit the one-URL self-test on any running deployment — no token needed, it self-tenants internally and returns 200 at Grade A (503 otherwise):
The local FHIR profile is Grade A: unsupported local-search inputs are rejected
or reported according to Prefer: handling, and every failure path is audited.
The same harness runs against the Flask test client as a CI baseline
(tests/test_guardrail_conformance.py). --json emits a machine-readable
report; --mcp-url additionally grades MCP tools/call error signaling as a
separate profile. For an authenticated MCP deployment, set MCP_AUTH_TOKEN or
pass --mcp-auth-token. Library API:
from r6.conformance import LiveProbeClient, ProbeContext, run_conformance.
What this grade means (and what it doesn't)
The grade covers the HealthClaw guardrail layer only — a self-test of the seven properties against synthetic data it just created. It is not a HIPAA Security Rule assessment, a third-party audit, or a penetration test of your deployment: infrastructure, BAAs, encryption at rest/in transit, and access controls remain the deployer's responsibility (see Known Limitations). Because the harness is deployment-agnostic, a third party can run it against any instance as one input to a real assessment — it does not substitute for one. The report states this scope itself in every output format.
Install as a Claude Plugin
HealthClaw ships as a Claude Code plugin marketplace. Two plugins are available:
Each skill is auto-discoverable — Claude loads it when your prompt matches the skill's trigger phrases (e.g. "check my care gaps", "redact this bundle", "run Curatr on my conditions").
Not on Claude/MCP? The same 28 guardrailed tools run on OpenAI, Gemini, LangChain, or plain HTTP via the framework-neutral bridge in adapters/ — see Recipe: run HealthClaw tools on any agent framework. Guardrails stay server-side, so no framework can bypass them.
Quick Start
Docker
MCP Tools (29)
Tool names use underscores (not dots) for Claude Desktop / MCP client compatibility.
Read tools (no step-up for public tenants):
Write tools (require step-up token):
Utility tools:
All tools add _mcp_summary with reasoning, clinical context, and limitations.
Guardrail Demo
The 6-step demo at /r6/fhir/demo/agent-loop shows the full guardrail sequence:
- PHI Redaction — Agent reads a patient, receives redacted data
- $validate Gate — Agent proposes an Observation, validated before write
- Permission Deny — No Permission rule exists, access denied with reasoning
- Permission Permit — Permit rule created, re-evaluation succeeds
- Step-up + Human-in-the-loop — Write requires both token and human confirmation
- Commit + Audit — Write succeeds, full audit trail generated
Comparison
FHIR Version Support
Both R4 and R6 resources flow through the same guardrail stack (PHI redaction, audit, step-up auth, tenant isolation). R6 ballot resources may change before final release.
Testing
API Endpoints
Local search accepts the parameters advertised by /r6/fhir/metadata.
Unknown parameters default to lenient handling (a bounded
search.mode="outcome" warning); Prefer: handling=strict returns a 400
OperationOutcome. Unsupported modifiers and malformed supported values always
return 400. _count=0 and _summary=count are count-only searches. Self links
contain exactly the applied, URL-encoded parameters, and audit output never
echoes submitted filter values or arbitrary parameter names.
Upstream Proxy
Connect to real FHIR servers while keeping all guardrails active:
- Reads: Fetched from upstream, then redacted + audited + disclaimers added
- Searches: Forwarded with all query params, results redacted per entry
- Writes: Validated locally first, then forwarded with step-up auth check
- URL rewriting: Upstream URLs never leak to clients
Tested with: HAPI FHIR R4/R5, SMART Health IT, Epic Sandbox.
Put the guardrails in front of your FHIR server — recipe for running the
redaction + audit + step-up + human-in-the-loop stack in front of Medplum
(the same pattern works for Aidbox, Google Cloud Healthcare, or any FHIR R4
server): docs/recipes/healthclaw-in-front-of-medplum.md.
A repeatable integration test (tests/test_medplum_in_front.py) proves a
Medplum-returned Patient comes back redacted + audited and writes are step-up
gated before reaching Medplum.
Curatr — Patient-Owned Data Quality
Curatr is a patient-facing data quality skill that evaluates FHIR health records for coding issues and lets the patient decide how to resolve them.
What Curatr checks on a Condition:
Every fix creates a linked Provenance resource recording patient intent, field changes, and agent attribution. All changes are audited in the immutable trail.
OpenClaw skill: skills/curatr/SKILL.md
SMART Health Links (Kill the Clipboard)
Patient-controlled encrypted record sharing via QR code, implemented on top of
jmandel/kill-the-clipboard-skill
(MIT, pinned fa0020d) — credit Josh Mandel. HealthClaw governs what enters the
bundle (step-up auth, profiles, guardrails, audit trail); KTC governs sharing
(zero-knowledge server-side storage, SHL STU 1 protocol, revocation, in-browser
viewer).
Off by default. shl_generate is withheld from tools/list and a call is
refused unless the operator sets MCP_ENABLE_SHL_GENERATE=true. Patient-initiated
sharing is being rebuilt behind a consent page.
What it does: The shl_generate MCP tool (Write group, step-up required)
fetches the patient's guardrailed FHIR bundle, encrypts it client-side in the MCP
server (the SHL server never sees plaintext), uploads ciphertext, and returns:
shlink— theshlink:/URI to encode in a QR (an encrypted pointer, not data)viewer_link— browser URL for clinic staffmanage_link— patient-only revocation + access-log URL
Security: The QR encodes only the encrypted pointer. PHI never appears in the
QR image. The SHL server stores only ciphertext + sha256(auth_token). Persona
hard rule: see skills/share-health-qr/SKILL.md — never direct-encode PHI into
QR images (incident 2026-06-12).
Quick Start (local)
Without SHL_SERVER_URL, shl_generate returns an explicit simulation stub
(simulated: true) — never a fake link.
Railway Deploy
Caveat 1 — deploy from the right directory: The repo-root
railway.tomltargets the Flask Dockerfile. If you runrailway up --service shl-serverfrom the repo root, Railway uses the wrong Dockerfile and the deploy fails. Alwayscd services/shl-serverfirst — that directory has its ownrailway.tomlthat points to the correct image.Caveat 2 — watchPatterns skip: A service that inherited
watchPatternsfrom the root config may silently skip Dockerfile-only deploys (no source file changes detected). The per-servicerailway.tomlinservices/shl-server/overrides this after the first successful build. If deploys are skipped, force one withrailway up --service shl-serverfrom the shl-server directory.Caveat 3 — simulation mode: Without
SHL_SERVER_URLon the MCP server,shl_generatereturns{ simulated: true, note: "SHL_SERVER_URL not configured — returned stub." }. Personas surface this note verbatim and never improvise an alternative.
OpenClaw skill: skills/share-health-qr/SKILL.md
R6-Specific Resources (Experimental)
These resources are part of the FHIR R6 ballot3 specification and may change before final release.
US Core v9 R4 Resources (Stable)
Standard FHIR R4 resources conforming to US Core Implementation Guide v9. These are widely deployed in US healthcare and stable for production use.
AllergyIntolerance, Immunization, MedicationRequest, Medication, MedicationDispense, Procedure, DiagnosticReport, CarePlan, CareTeam, Goal, DocumentReference, Location, Organization, Practitioner, PractitionerRole, RelatedPerson, Coverage, ServiceRequest, Specimen, FamilyMemberHistory
Environment Variables
Database DDL is never run during WSGI import. Run flask --app main init-db
before each release; it applies the locked Alembic revisions. Operators adopting
Alembic on an existing v1.8.0 Postgres deployment must follow the
database migration runbook to verify and
stamp the compatibility baseline before upgrading.
Project Structure
Personal FHIR data store — patient import flow
This walkthrough shows how to go from a raw HealthEx export to querying your own records through Claude Code's MCP tools.
1. Start the stack
2. Import your HealthEx / Flexpa / generic FHIR bundle
3. Connect Claude Code via MCP
.mcp.json in this repo auto-configures Claude Code when you open the project.
Update X-Tenant-ID to match your --tenant-id:
Then in Claude Code:
4. Set up Fasten Connect (optional)
Records arrive via webhook at /r6/fasten/webhook and are stored under the
patient's canonical tenant ID.
5. Deidentify for sharing
6. Telegram bot (optional)
Commands: /health, /conditions, /labs, /curatr, /curatr fix, /approve.
Or via Docker Compose:
7. Use Medplum as the backing FHIR store (optional)
Set in .env (leave FHIR_UPSTREAM_URL empty):
All guardrails apply to Medplum responses identically to local SQLite mode.
Access tokens are cached in Redis (key medplum:access_token; falls back to
in-process cache when Redis is unavailable).
Known Limitations
- The conformance grade is a self-test of the guardrail layer, not a HIPAA assessment or third-party audit — see What this grade means
- Local mode: JSON blob storage with table-scan search (no indexed fields)
- Redaction is HIPAA Safe-Harbor-style field redaction (demographics), not Expert Determination. It's a compensating control that removes identifier-class fields (identifier values are removed outright, not truncated); it is not a legal de-identification determination. Production de-id rigor (profile-specific recursive allowlists, an Expert-Determination path) is on the roadmap (#112).
- Validation is structural, not full StructureDefinition/profile conformance or terminology binding. What's demonstrated is the guardrail contract (redact + audit + step-up + human-confirm + tenant isolation + error fidelity), not production validation depth — that's tracked in #112.
- SubscriptionTopic stored but notifications not dispatched
- Direct clinical FHIR writes have no real human gate. They answer HTTP 428 until the caller sends
X-Human-Confirmed, and the caller sets that header about itself, so it proves nothing about a human. This is a known gap (#214); do not build on it. The real human gate is the action rail, used by real-world actions (phone/SMS/forms), and it does not accept that header.commitonly submits the action for out-of-band approval (202awaiting_confirmation). The patient's Approve tap consumes a single-useActionConfirmationcredential server-side before anything executes. - OAuth endpoints are for discovery/SMART advertisement; route enforcement is via step-up + read-auth tokens, and the auto-approve authorize flow is limited to public/demo tenants (no per-user consent screen)
- No historical versioning (version_id increments but old versions not retrievable)
- Upstream proxy: no response caching, no cross-version translation
- Security is config-dependent — production requires
READ_AUTH_ENABLED=true(authenticate non-public reads),INTERNAL_TOKEN_MINT_SECRET(gate token mint/seed for non-public tenants; fail-closed in prod when unset),PUBLIC_TENANTSlimited to synthetic demo tenants, a realSESSION_SECRET/STEP_UP_SECRET, and https-only upstreams - Step-up tokens are valid for multiple writes within their 5-min TTL (not single-use); irreversible actions rely on state-machine idempotency (guarded
WHERE status='proposed'claim) rather than nonce consumption
Contributing — this is a community effort
HealthClaw Guardrails is developed in the open as a shared reference, not a commercial product. The guardrail layer between AI agents and clinical data only gets trustworthy if a lot of people with different vantage points pressure-test it. We especially want:
- Implementers building FHIR × MCP integrations — tell us where the patterns break in the real world.
- Clinicians & compliance folks — challenge the redaction profiles, audit model, and the documented HIPAA postures.
- Standards people (HL7 / SDC / SMART) — tell us where we've diverged from the spec, especially on
$populate/$extract. - Anyone — open an issue, file a "you got this wrong," or send a PR.
Start here: CONTRIBUTING.md · Roadmap · Dev Guide · Code of Conduct · CHANGELOG.md · Security policy
Good first contributions are labeled in the issue tracker. Contributions are DCO-signed (git commit -s) under the MIT license — see LICENSING.md for the project's licensing posture going forward.
Community
- GitHub Discussions — questions, ideas, show-and-tell.
- good first issues — scoped, ~15-minute-to-start contributions.
- Building on OpenClaw or Hermes? The skills are on ClawHub; the MCP server is in the Hermes catalog.
License
MIT — free to use, fork, and build on. See LICENSE.
來源:README.md,提交 516a879
工具
0版本歷史
1- v1.6.0最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分