Source profileQuality 90/100Review permissions

aks129/HealthClawGuardrails/skills/fhir-r6-guardrails/SKILL.md

fhir-r6-guardrails

HealthClaw 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 hea

Source repository stars
27
Declared platforms
0
Static risk flags
1
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

A healthclaw.io open source project. Reference implementation of security and compliance patterns for AI agent access to FHIR data via MCP.

Best for

  • You need to read, search, or write FHIR clinical resources through MCP
  • You need PHI to be automatically redacted before the agent sees it
  • You need an immutable audit trail of all agent access

Not for

  • Local mode uses SQLite JSON blob storage (not indexed search)
  • Structural validation only (no StructureDefinition or terminology binding)

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/aks129/HealthClawGuardrails --skill "skills/fhir-r6-guardrails"
Safe inspection promptEditorial

Inspect the Agent Skill "fhir-r6-guardrails" from https://github.com/aks129/HealthClawGuardrails/blob/b94ae9ea95695d5755e22b02ef7b7385f0e3aee7/skills/fhir-r6-guardrails/SKILL.md at commit b94ae9ea95695d5755e22b02ef7b7385f0e3aee7. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Read Tools (no step-up required)

    Review the “Read Tools (no step-up required)” section in the pinned source before continuing.

    Review and apply the “Read Tools (no step-up required)” source section.
  2. 02

    Write Tools (require step-up token)

    Review the “Write Tools (require step-up token)” section in the pinned source before continuing.

    Review and apply the “Write Tools (require step-up token)” source section.
  3. 03

    Two-Phase Write Pattern

    Writes always follow propose-then-commit:

    Propose: Call fhir.proposewrite with the resource and operation (create/update).Review: Check the proposal response:proposalstatus: "ready" means validation passed
  4. 04

    Step-Up Authorization

    HMAC-SHA256 tokens with 128-bit nonce, 5-minute TTL, tenant binding. Required for all write operations.

    HMAC-SHA256 tokens with 128-bit nonce, 5-minute TTL, tenant binding. Required for all write operations.
  5. 05

    Setup

    Review the “Setup” section in the pinned source before continuing.

    Review and apply the “Setup” source section.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 117

The documentation asks the agent to run terminal commands or scripts.

# Docker Compose (recommended)

Runs scripts

medium · line 118

The documentation asks the agent to run terminal commands or scripts.

docker-compose up -d --build

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score90/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars27SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
aks129/HealthClawGuardrails
Skill path
skills/fhir-r6-guardrails/SKILL.md
Commit
b94ae9ea95695d5755e22b02ef7b7385f0e3aee7
License
MIT
Collected
2026-08-04
Default branch
main
View the original SKILL.md

HealthClaw Guardrails

A healthclaw.io open source project. Reference implementation of security and compliance patterns for AI agent access to FHIR data via MCP.

Supports FHIR R4 US Core v9 (stable) and FHIR R6 v6.0.0-ballot3 (experimental).

This is a runtime guardrail layer, not a knowledge skill. It sits between any AI agent and FHIR data (local or upstream), enforcing PHI redaction, audit trails, step-up authorization, and tenant isolation on every request.

When to Use This Skill

  • You need to read, search, or write FHIR clinical resources through MCP
  • You need PHI to be automatically redacted before the agent sees it
  • You need an immutable audit trail of all agent access
  • You need step-up authorization gates on write operations
  • You need to evaluate R6 Permission resources for access control

MCP Tools Available (12)

Read Tools (no step-up required)

ToolPurpose
context.getRetrieve a pre-built context envelope with patient-centric resources
fhir.readRead a single FHIR resource by type and ID (auto-redacted)
fhir.searchSearch resources with patient, code, status, date filters
fhir.validateStructural validation of a proposed resource
fhir.statsObservation statistics: count, min, max, mean over valueQuantity
fhir.lastnMost recent N observations per code
fhir.permission_evaluateEvaluate R6 Permission for permit/deny with reasoning
fhir.subscription_topicsList available SubscriptionTopics
curatr.evaluateEvaluate a FHIR resource for data quality issues

Write Tools (require step-up token)

ToolPurpose
fhir.propose_writeValidate and preview a write without committing
fhir.commit_writeCommit a proposed write (requires X-Step-Up-Token)
curatr.apply_fixApply patient-approved data quality fixes with Provenance

Two-Phase Write Pattern

Writes always follow propose-then-commit:

  1. Propose: Call fhir.propose_write with the resource and operation (create/update). This validates the resource and returns a preview. No data is changed.

  2. Review: Check the proposal response:

    • proposal_status: "ready" means validation passed
    • requires_human_confirmation: true for clinical resource types
    • requires_step_up: true always for commits
  3. Commit: Call fhir.commit_write with the same resource. Include:

    • X-Step-Up-Token header (HMAC-SHA256 signed, 5-minute TTL)
    • X-Human-Confirmed: true header for clinical resources

Clinical Resource Types (require human-in-the-loop)

Observation, Condition, MedicationRequest, DiagnosticReport, AllergyIntolerance, Procedure, CarePlan, Immunization, NutritionIntake, DeviceAlert.

Supported FHIR Resource Types

FHIR R4 US Core v9 (Stable)

Patient, Encounter, Observation, AuditEvent, Consent, Condition, Provenance, AllergyIntolerance, Immunization, MedicationRequest, Medication, MedicationDispense, Procedure, DiagnosticReport, CarePlan, CareTeam, Goal, DocumentReference, Location, Organization, Practitioner, PractitionerRole, RelatedPerson, Coverage, ServiceRequest, Specimen, FamilyMemberHistory.

FHIR R6 ballot3 (Experimental)

Permission, SubscriptionTopic, Subscription, NutritionIntake, NutritionProduct, DeviceAlert, DeviceAssociation, Requirements, ActorDefinition.

  • Permission — Access control (separate from Consent). $evaluate operation.
  • DeviceAlert — ISO/IEEE 11073 device alarms.
  • NutritionIntake — Dietary consumption tracking.
  • DeviceAssociation, NutritionProduct, Requirements, ActorDefinition — CRUD only.

Security Guardrails (Always Active)

PHI Redaction

Applied on every read path. Names truncated to initials, identifiers masked to last 4 characters, addresses stripped to city/state/country, birth dates truncated to year, photos removed, notes replaced with [Redacted].

Audit Trail

Append-only AuditEvent records for every resource access. Database-level immutability. Logs agent ID, tenant ID, resource accessed, and outcome.

Step-Up Authorization

HMAC-SHA256 tokens with 128-bit nonce, 5-minute TTL, tenant binding. Required for all write operations.

Tenant Isolation

X-Tenant-Id header enforced on every query at the database layer.

Search Parameters (Local Mode)

Supported: patient (reference), code (token), status (token), _lastUpdated (date with ge/le/gt/lt prefix), _count (1-200), _sort (_lastUpdated/-_lastUpdated), _summary (count).

Not supported in local mode: chaining, _include, _revinclude, modifiers.

In upstream proxy mode, all query parameters are forwarded to the upstream server.

Setup

# Docker Compose (recommended)
docker-compose up -d --build

# Manual
uv sync && python main.py &
cd services/agent-orchestrator && npm ci && npm start

Required environment variables:

  • STEP_UP_SECRET — HMAC secret for step-up tokens

Optional:

Known Limitations

  • Local mode uses SQLite JSON blob storage (not indexed search)
  • Structural validation only (no StructureDefinition or terminology binding)
  • SubscriptionTopic stored but notifications not dispatched
  • Human-in-the-loop is header-based, not cryptographic
  • No historical versioning (version_id increments but old versions not retrievable)
  • Upstream proxy: no response caching, no cross-version translation