/healthclaw-guardrails:fasten-connectfrom healthclaw-guardrails
Ingests patient-authorized EHR data from Epic, Cerner, Athena, and TEFCA into HealthClaw Guardrails. Covers Fasten Stitch widget embed, org_connection_id registration, EHI export job tracking, NDJSON ingestion status, TEFCA IAS identity-verified multi-provider retrieval, and post-import Curatr quality scan workflow.
Ships in healthclaw-guardrails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Connects patient-authorized real EHR data into HealthClaw Guardrails via Fasten Connect. Once ingested, all records flow through the full guardrail stack: PHI redaction, audit trail, step-up authorization, and tenant isolation.
Two modes:
| Variable | Required | Description |
|---|---|---|
FASTEN_PUBLIC_KEY | Yes | Fasten API public key (public_test_* or public_live_*) |
FASTEN_PRIVATE_KEY | Yes | Fasten API private key — never expose client-side |
FASTEN_WEBHOOK_SECRET | Recommended | Standard-Webhooks HMAC secret from Fasten portal |
FASTEN_CURATR_SCAN | No | Set true to run Curatr quality scan after each import |
FASTEN_TEFCA_MODE | No | Default false. Set true only when Fasten has enabled TEFCA IAS for the account; the /connect page then adds tefca-mode=true to the widget |
<!-- Standard mode -->
<fasten-stitch-element public-id="your_public_test_key"></fasten-stitch-element>
<!-- TEFCA IAS mode — identity-verified, multi-provider -->
<fasten-stitch-element public-id="your_public_test_key" tefca-mode="true"></fasten-stitch-element>
<link rel="stylesheet" href="https://stitch.fastenhealth.com/v0.4/bundle.css">
<script src="https://stitch.fastenhealth.com/v0.4/bundle.js"></script>
document.querySelector('fasten-stitch-element')
.addEventListener('widget.complete', async (event) => {
const { org_connection_id, endpoint_id, tefca_directory_id,
platform_type, connection_status } = event.detail;
// Register connection with HealthClaw Guardrails
await fetch('/fasten/connections', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Tenant-Id': YOUR_TENANT_ID,
},
body: JSON.stringify({
org_connection_id,
endpoint_id,
tefca_directory_id, // use this as stable ID in TEFCA mode
platform_type,
connection_status,
}),
});
});
In the Fasten Developer Portal, set your webhook URL:
https://your-domain.com/fasten/webhook
The webhook fires patient.ehi_export_success when the export is ready.
HealthClaw automatically downloads and ingests the FHIR NDJSON files.
curl -X POST https://api.connect.fastenhealth.com/v1/bridge/fhir/ehi-export \
-u "public_test_XXX:private_test_XXX" \
-H "Content-Type: application/json" \
-d '{"org_connection_id": "your-org-connection-id"}'
# List jobs for your tenant
curl /fasten/jobs -H "X-Tenant-Id: tenant-001"
# Poll a specific job
curl /fasten/jobs/<task_id> -H "X-Tenant-Id: tenant-001"
Job status lifecycle: pending → downloading → ingesting → complete | failed
| Method | Path | Auth | Description |
|---|---|---|---|
POST | /fasten/webhook | HMAC (Fasten-signed) | Receive Fasten events |
POST | /fasten/connections | X-Tenant-Id | Register connection after Stitch widget |
GET | /fasten/connections/<id> | X-Tenant-Id | Connection status |
GET | /fasten/jobs | X-Tenant-Id | List ingestion jobs |
GET | /fasten/jobs/<task_id> | X-Tenant-Id | Single job status |
Fasten imports pass through the full HealthClaw guardrail stack. Once a resource is ingested, all existing guardrails apply automatically:
| Guardrail | Behavior |
|---|---|
| PHI redaction | Applied on every read — names to initials, identifiers masked, addresses stripped |
| Audit trail | Every resource write creates an immutable AuditEvent |
| Tenant isolation | org_connection_id is bound to one tenant_id at registration |
| Curatr scan | Optional: runs quality evaluation post-import (FASTEN_CURATR_SCAN=true) |
tefca-mode="true" on the Stitch widget. HealthClaw's /connect page sends it only when FASTEN_TEFCA_MODE=true; live mode needs Fasten to enable TEFCA IAS for the account, and the embed needs third-party cookiestefca_directory_id (not endpoint_id) as the stable identifierpatient/*.read — no narrower scope negotiationtefca_no_documents_found when health systems have no records# CLEAR verification (test mode)
Phone: (from Fasten test patient credentials page)
Email: (from Fasten test patient credentials page)
# ID.me verification (test mode)
Username: (test patient email)
Password: IDme2026!!
# CCDA fixture override (API-mode testing)
POST /v1/bridge/fhir/ehi-export
{"org_connection_id": "...", "fixtures": {"tefca_ccda": "myra-jones.xml"}}
After ingestion completes, run Curatr evaluation on clinical resources:
1. GET /fasten/jobs/<task_id> → wait for status: "complete"
2. fhir.search(patient, Condition) → list ingested Conditions
3. curatr.evaluate(Condition, id) → check each for coding issues
4. Present issues to patient in plain language
5. Patient approves fixes
6. curatr.apply_fix(resource, fixes) → apply with Provenance trail
Curatr checks ingested resources for:
| Event | Trigger | Action |
|---|---|---|
patient.ehi_export_success | Export ready | Auto-download + ingest |
patient.ehi_export_failed | Export failed | Record failure reason |
patient.authorization_revoked | Consent expired | Mark connection revoked |
patient.connection_success | Widget complete | Optional auto-register |
webhook.test | Config test | Accepted silently |
Note: Never log raw webhook payloads — patient.request_support events
explicitly may contain PHI per Fasten documentation.
Fasten exports range from ~30MB to 3GB+. HealthClaw uses HTTP streaming
(httpx stream()) to handle large files without loading them into memory.
Progress is committed to the database every 50 resources.
Vercel limitation: Serverless functions timeout before large downloads complete.
Railway or any persistent server deployment is required for production use with
Fasten Connect. See railway.toml for Railway deployment config.
# Local development
export FASTEN_PUBLIC_KEY=public_test_XXX
export FASTEN_PRIVATE_KEY=private_test_XXX
export FASTEN_WEBHOOK_SECRET=whsec_XXX # from Fasten Developer Portal
export FASTEN_CURATR_SCAN=true
docker-compose up -d --build
# Test webhook locally (use Fasten webhook simulator or ngrok)
# Fasten Webhook Simulator: https://docs.connect.fastenhealth.com/guides/webhook-debugging-simulator.md
downloading status (re-trigger by calling the Fasten API again)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aks129/healthclawguardrails --plugin healthclaw-guardrails14 skills in this plugin
/check-sourcesSurvey ALL connected health data sources at once. Use when the patient asks: (1) "what's connected" or "what services are linked", (2) "check all my services / all my data", (3) "do you have my records" or "what records do you have", (4) "did my data come through from <Fasten/MEDENT/HealthEx/Health Bank One/Flexpa/Epic/wearables>". Calls fhir_get_token (for protected tenants) then sources_check, and presents connection status + record counts by type. Connection status and counts only — never clinical values.
/curatrHealthClaw Curatr (healthclaw.io) — patient-facing FHIR data quality evaluation and correction. Use when: (1) Evaluating a patient's health record for coding issues (deprecated code systems, invalid codes, missing required fields), (2) Presenting issues in plain language with clinical impact, (3) Applying patient-approved corrections with full Provenance tracking, (4) Preparing a structured correction request for the patient's healthcare provider. Supports FHIR R4 US Core v9 resources: Condition, AllergyIntolerance, MedicationRequest, Immunization, Procedure, DiagnosticReport — with ICD-10-CM, SNOMED CT, LOINC, CVX, and RxNorm validation via public terminology APIs.
/fhir-r6-guardrailsHealthClaw Guardrails (healthclaw.io) — FHIR agent guardrails for clinical data access via MCP. Supports FHIR R4 US Core v9 (stable) and FHIR R6 ballot3 (experimental). Use when: (1) Reading patient data through MCP tools with automatic PHI redaction, (2) Writing clinical resources with two-phase propose/commit and step-up authorization, (3) Querying observation statistics or recent lab results, (4) Evaluating R6 Permission resources for access control decisions, (5) Auditing agent access to healthcare data. 14 MCP tools.
/fhir-upstream-proxyConnect to real FHIR servers through the MCP guardrail proxy. Use when: (1) Connecting to HAPI FHIR, SMART Health IT, or Epic sandbox servers, (2) Proxying AI agent requests to production EHR systems with guardrails, (3) Ensuring upstream server URLs never leak to clients, (4) Understanding how redaction, audit, and step-up auth apply to upstream data.
/getting-startedEnd-to-end onboarding for the HealthClaw + OpenClaw personal-health-agent stack. Walks anyone — not just developers — through (1) installing OpenClaw as the local AI gateway, (2) standing up an open-source FHIR server (HAPI or Medplum) on their machine, (3) connecting their EHR records via HealthEx, Josh Mandel's fhir-skills, Flexpa, or any patient-right-of-access / TEFCA IAS service, (4) installing HealthClaw Guardrails with the OpenClaw personas pre-wired, and (5) pulling + reviewing health data end-to-end. Triggers when a user asks "how do I get started", "how do I set this up", "what do I need to use HealthClaw", "first time setup", "install everything", or any first-run question. Use this before any other HealthClaw skill when the user hasn't yet built their stack.
/healthbankonePull verified medical records and digital-identity context from Health Bank One (https://www.healthbankone.com) via their MCP server. HBO uses OAuth 2.x with per-consumer authorization, so this skill drives an authorization-code grant first, then runs the MCP pull, then ingests the redacted bundle into a HealthClaw tenant. Use when the user wants to add HBO as a source alongside HealthEx and Fasten Connect. Triggers on prompts like "connect Health Bank One", "pull from HBO", "verify identity through Health Bank One".
Other plugins' skills for the same job