Open governance framework · v1.3 · Practitioner-led · not an accredited standard, certification, or regulatory requirement · seeking shadow-evaluation partners
Home/Developers

Technical Reference · v1.3 · Open Source

Technical Reference

Last updated: June 2026

Reference implementation artifacts for the NHID-Clinical v1.3 specification. These tools demonstrate that the specification can be implemented, replayed, and evaluated through deterministic trace artifacts and conformance testing.

Pre‑standardization draft. The artifacts linked below are a reference implementation of the NHID‑Clinical v1.3 specification. They demonstrate that the specification can be implemented, replayed, and evaluated through deterministic trace artifacts and conformance testing. These tools are not a certification program, and there is no external certification authority. Conformance testing is self‑administered. All artifacts are open for community review and feedback.

Staged Integration — Stop at Any Rung

Integration is a ladder, not an all-or-nothing commitment. Tier 0 needs nothing but curl; Tier 2's cryptographic identity layer (NHID-Auth v2) is optional. Full walkthrough: v2-integration-guide.md.

The integration ladder, and what each rung produces Three tiers, each stating the work, the capability gained and the evidence produced. Tier 0, paste a payload, takes about fifteen minutes: POST a transcript to the hosted demo endpoint or a vendor payload to an adapter route. It changes nothing in the call path and produces a conformance verdict and CAS score per call. Tier 1, wire into the call pipeline, takes about two hours: one HTTP call from your existing end-of-call handler, storing the score and alerting on non-conformance. It gives continuous monitoring and produces a stored, alertable CAS score per call. Tier 2, cryptographic agent identity, takes about a day: add NHID-Auth v2 with NPI-bound agent passports and scoped, short-lived delegation. It gives verified authorization and produces a signed passport and verification record. Each rung is a stopping point; none requires the next. 0 Tier 0 · Paste a payload POST a transcript to the hosted demo endpoint, or a vendor payload to an adapter route. effort ~15 minutes · capability No call-path change · evidence Conformance verdict + CAS score per call 1 Tier 1 · Wire into the call pipeline One HTTP call from your existing end-of-call handler; store the score, alert on non-conformance. effort ~2 hours · capability Continuous monitoring · evidence Stored CAS score per call, alertable 2 Tier 2 · Cryptographic agent identity Add NHID-Auth v2: NPI-bound agent passports with scoped, short-lived delegation. effort ~1 day · capability Verified authorization · evidence Signed passport + verification record

Reference Each rung is a stopping point. Nothing above Tier 0 is required to get a conformance verdict, and Tier 2 is optional. Full walkthrough: v2-integration-guide.md.

See the Controls Run: The Front-Desk Walkthrough

Before the schemas and YAML below, here's what IDG‑01, PDX‑01, DBC‑01, and EIT‑01 actually enforce on a call, staged as a doctor's-office check-in desk. Run the conformant pass, then the failure and escalation scenarios; open any brass plaque for that control's rule_engine.config. ATR‑01 is the ledger on the right — it is not a checkpoint anyone walks through.

Every action, reason code and violation in the scene is the output of src/nhid_policy_engine_v1.py :: evaluate_all, recorded by scripts/build_walkthrough_fixture.py replaying five real scenarios from tests/evaluation_corpus_v1.json; the same script's --check mode runs in CI, so the scene cannot drift from the engine. The room, the walking order and the artwork are staging — the verdicts are not.

What the Reference Implementation Actually Is

One path, drawn end to end, with each part labelled by what it actually is today. Three of the pieces a production deployment would need are not in this picture as built components, because they are not built — they are shown where they would go.

The NHID-Clinical reference implementation, end to end A vendor platform sends a call event to one of eight adapter modules, five of which are wired to hosted routes. The adapter normalises the event and passes it to the policy engine, which evaluates the five controls deterministically and returns a policy decision carrying a reason code and any violations. The decision is written to an append-only event store and emitted as a FHIR R4 AuditEvent. The conformance test suite replays recorded events through the same engine, which is what makes the published figures reproducible. Three further components a production deployment would require are shown separately as not built: durable key custody and rotation, an NPI-to-public-key registry, and multi-hop federation. Their absence is the difference between a reference implementation and deployable infrastructure. BUILT, AND COVERED BY THE SUITE Vendor platform Twilio, VAPI, Vonage, Retell, Amazon Connect Adapter 8 modules; 5 wired to hosted routes Policy engine Five controls, evaluated deterministically PolicyDecision Action, reason code, violations Event store Append-only, hash-chained FHIR AuditEvent R4, CI-validated Conformance test suite Replays recorded events through the same engine. This is what makes the published figures reproducible. NOT BUILT — WHERE THEY WOULD GO Key custody & rotation Documented production path Registry: NPI → public key Requires a neutral operator Multi-hop federation Open problem, not a shipped capability The gap between the two halves is the difference between a reference implementation and deployable infrastructure.
Standings: the built path is Implemented and its figures are Verified. Key custody is Conceptual; the registry and federation are Future. Each follows claim-boundaries.md.

Reference Artifacts

Canonical Event Schema

schema/nhid_trace_schema_v1.json

JSON Schema (Draft 2020‑12) for a single NHID‑Trace event. Includes schema annotations referencing disclosure, identity, and auditability considerations associated with TCPA, HIPAA, CA AB 489, and NY S7263.

Policy Engine

src/nhid_policy_engine_v1.py

Pure Python reference implementation of the five canonical controls (IDG-01, PDX-01, DBC-01, EIT-01, ATR-01) plus the supplemental bot‑to‑bot rule. No external dependencies; fully deterministic.

Conformance Test Suite

tests/nhid_conformance_test_suite_v1.yaml

18 machine‑readable test cases covering every pass/fail/edge scenario in the v1.3 spec. Vendors can use this YAML file to self‑validate their implementations.

Failure Injection Harness

tests/failure_injection_harness.py

pytest‑based test suite. Unit tests run with no server required. Integration tests validate a live FastAPI endpoint against malformed inputs and replay determinism.

Trace Generator & Example Traces

tests/trace_generator.py

CLI script that produces canonical NHID‑Clinical trace files. Ten pre‑generated failure traces are available in the /traces directory.

Payer-Initiated Call Guidance

docs/payer-initiated-calls.md

Policy-extension guide for the reversed call direction — a payer's AI agent calling a provider — covering how IDG‑01, PDX‑01, and DBC‑01 apply when NHID‑Clinical's controls were originally framed around inbound calls.

SIP Header Integration Feedback

docs/sip-header-integration-feedback.md

Standards-feedback position paper proposing an Identity-Disclosure SIP header convention for AI voice agents, referencing the IETF AgentID Protocol draft.

Policy Engine Playground experimental

Browser-based interactive demo of the disclosure policy rules. Paste or select a canonical event JSON, run the engine, and inspect the deterministic trace output. Identical input always produces identical output.

Quick Start

git clone https://github.com/NHID-Clinical/NHID-Clinical.git
cd NHID-Clinical
pip install -r requirements.txt
python -m pytest tests/ -v
python -m jsonschema schema/nhid_trace_schema_v1.json
python tests/trace_generator.py --offline

Unit tests run without a server. Integration tests require a FastAPI instance at https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod and will be automatically skipped if the server is not reachable.

Hosted API

A public conformance endpoint is available for integration testing without self-hosting. Send any NHID-Clinical v1.3 event and receive a structured policy decision.

Endpoint

POST https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod/v1/conformance/check

Requests require an x-api-key header. The uses a rate-limited demo key automatically. To obtain a key for your integration, contact contact@nhid-clinical.org.

curl -s -X POST \
  https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod/v1/conformance/check \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"session":{"turn_count":1,"escalation_path_available":true},"event":{...}}'

Returns: {"conformant": true/false, "action": "...", "violations": [...], "next_state": "...", "cas": {"score": ..., "tier": ...}}. See sample_request.json for a complete example.

Delegated Authority (DLG-01) — opt-in

Pass a DelegationContext to evaluate_all() and put the agent’s passport on the session. The engine verifies the provider and agent signatures, expiry, revocation, call binding, and — for a delegation chain — that scope narrows monotonically at every hop. The verified scope then constrains PDX-01: a delegation for eligibility causes a request for a claim number to be denied.

Pass nothing and the control is not evaluated at all, so existing integrations are unaffected. Verification resolves the provider key through a trust anchor you configure; there is no directory, no discovery service, and no NPPES check. An NPI you have not configured is refused, not accepted.

from src.nhid_policy_engine_v1 import DelegationContext, evaluate_all
from src.trust_anchor import StaticTrustAnchorResolver

resolver = StaticTrustAnchorResolver({"1234567890": provider_public_key_b64})
session["agent_passport"] = passport          # or a list, for a chain
decision = evaluate_all(session, event, DelegationContext(resolver=resolver))
# decision.reason_code == "PDX01_SCOPE_NOT_AUTHORIZED" when out of scope

Vendor Quick-Start

POST your platform's native call payload — no NHID schema required. The adapter translates and evaluates automatically.

Vendor Endpoint Auth Status
VAPI /v1/adapters/vapi/check None ✅ Live
Twilio /v1/adapters/twilio/check None ✅ Live
Vonage /v1/adapters/vonage/check None ✅ Live
Retell AI /v1/adapters/retell/check None ✅ Live
Amazon Connect /v1/adapters/connect/check None ✅ Live

Example — VAPI non-compliant call (bot requests PHI before disclosing identity):

curl -s -X POST \
  https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod/v1/adapters/vapi/check \
  -H "Content-Type: application/json" \
  -d '{
    "call": {"id": "call_demo", "startedAt": "2026-06-09T10:00:00Z"},
    "messages": [
      {"role": "bot",  "message": "Hi, can I get the member ID and NPI?", "secondsFromStart": 0.3},
      {"role": "user", "message": "NPI is 1234567890.", "secondsFromStart": 3.1},
      {"role": "bot",  "message": "Thanks. I am an automated system.", "secondsFromStart": 5.8}
    ]
  }'

Returns "conformant": false with an IDG-01 violation. Move the disclosure to the first message and re-run — result flips to "conformant": true. See interoperability demo → for full examples.

Vendor Interoperability

The adapters/ directory contains format adapters that convert vendor-specific call transcripts to NHID-Clinical event traces. Available: VAPI, Twilio Voice Intelligence, Vonage, Retell AI, Amazon Connect Contact Lens. See the interoperability demo →

Important

These tools are experimental and not for production use. NHID‑Clinical does not issue certifications, conduct audits, or provide legal advice. Conformance testing is self‑administered. No external authority validates results. Adoption of these artifacts does not confer HIPAA compliance, TCPA compliance, or any regulatory approval.

Open for feedback

Questions or suggestions?

Run a shadow evaluation, or reach out directly.

Read the evaluation guide →

Reference implementation

A working implementation of every control in the specification — so “conformant” means something you can run, not something you can claim.

What ships

ENGINE

Policy engine

Pure Python with zero runtime dependencies. Evaluates each control against a session and event and returns a deterministic verdict.

MIDDLEWARE

TypeScript middleware

Request-path enforcement for Node services, mirroring the Python engine’s verdicts.

ADAPTERS

VAPI & Twilio adapters

Accept native call payloads from either platform and normalize them into the evaluation format — no transcript reformatting required.

AUTH

NHID-Auth v2

Ed25519 agent passports, provider-signed delegation, and offline verification. Details →

SCHEMA

Trace schema

The machine-readable audit envelope every event validates against, published as JSON Schema.

TOOLING

OpenAPI, Postman, PowerShell

An OpenAPI description, a Postman collection, and a PowerShell module for teams whose operations tooling lives there.

Determinism is the point

The engine contains no model calls and no scoring heuristics in the control path. The same session and event produce the same verdict on every machine, every run. That is what makes a conformance claim checkable by someone who does not trust you — including a regulator, an auditor, or a competitor.

It is also what lets the same control logic run in three places without drift: in the test suite, in the simulator, and in production enforcement.

Getting started

1

Clone and run the tests

The repository ships with its full test suite. Run it before you write a line of integration code.

Get the repository →
2

Try the live API

Demo routes require no key. Send a VAPI or Twilio payload and read the verdict.

3

Wire it into your stack

The developer guide covers architecture, the event schema, and the failure-injection harness.

Read the developer guide →

Build on it

Everything here is CC BY 4.0. Fork it, vendor it, or replace it with your own engine and test against the same suite.

NHID-Clinical is a voluntary open framework — not an accredited standard, certification, or regulatory requirement. Everything on this page is published under CC BY 4.0.

Interoperability

This page shows how a real vendor's call transcript format can be mapped to an NHID-Clinical v1.3 event trace and evaluated for conformance. The adapter is open source — replace the sample input with real logs to test your own vendor.

Simulation only. These examples use synthetic Twilio-format transcripts to demonstrate the mapping. No real call data is shown. The adapter source is at adapters/twilio_adapter.py.

How It Works

Vendors who use Twilio produce call transcripts with text, timestamps, and speaker labels. The NHID-Clinical Twilio adapter reads that format and produces a structured event trace showing when disclosure happened, when data was first requested, and whether the call passes IDG-01.

The same pattern applies to other voice platforms — each needs its own adapter, but the output schema is identical. Five adapters are wired to live routes today: POST /v1/adapters/{twilio|vapi|vonage|retell|connect}/check. An ElevenLabs post-call adapter exists in the repository without a hosted route.

Case 1: Compliant Call

Agent discloses before requesting any operational data.

Input — Twilio transcript

{
  "call_sid": "CA123456789",
  "start_time": "2026-05-27T14:00:00Z",
  "transcript": [
    {"text": "Hello, this is an automated system calling on behalf of Dr. Smith's office.",
     "timestamp": 0.5, "speaker": "agent"},
    {"text": "Can I get the NPI number please?",
     "timestamp": 3.2, "speaker": "agent"},
    {"text": "Sure, it's 1234567890.",
     "timestamp": 5.8, "speaker": "human"}
  ]
}

Output — NHID-Clinical trace

{
  "trace_id": "twilio_CA123456789",
  "source_format": "twilio_transcript",
  "policy_version": "1.3",
  "events": [
    {"event_type": "DISCLOSURE",    "timestamp_offset_s": 0.5, "nhid_rule": "IDG-01"},
    {"event_type": "DATA_REQUEST",  "timestamp_offset_s": 3.2, "nhid_rule": "PDX-01"}
  ],
  "compliance": {
    "IDG-01": "PASS",
    "disclosure_timestamp_offset_s": 0.5,
    "first_data_request_offset_s": 3.2,
    "disclosure_made": true
  }
}

IDG-01: PASS — disclosure at 0.5s, data request at 3.2s. Disclosure preceded data exchange.

Case 2: Non-Compliant Call (Late Disclosure)

Agent requests data before identifying as automated — impersonation latency.

Input — Twilio transcript

{
  "call_sid": "CA999888777",
  "start_time": "2026-05-27T14:05:00Z",
  "transcript": [
    {"text": "Hi, can I get the member ID and NPI?",
     "timestamp": 0.3, "speaker": "agent"},
    {"text": "Sure — NPI is 1234567890.",
     "timestamp": 2.1, "speaker": "human"},
    {"text": "Thank you. By the way, I'm an automated system.",
     "timestamp": 4.0, "speaker": "agent"}
  ]
}

Output — NHID-Clinical trace

{
  "trace_id": "twilio_CA999888777",
  "source_format": "twilio_transcript",
  "policy_version": "1.3",
  "events": [
    {"event_type": "DATA_REQUEST",  "timestamp_offset_s": 2.1, "nhid_rule": "PDX-01"},
    {"event_type": "DISCLOSURE",    "timestamp_offset_s": 4.0, "nhid_rule": "IDG-01"}
  ],
  "compliance": {
    "IDG-01": "FAIL – disclosure occurred after data request (impersonation latency)",
    "disclosure_timestamp_offset_s": 4.0,
    "first_data_request_offset_s": 2.1,
    "disclosure_made": true
  }
}

IDG-01: FAIL — data requested at 2.1s, disclosure not until 4.0s. 1.9 seconds of impersonation latency.

Run It Yourself

git clone https://github.com/NHID-Clinical/NHID-Clinical.git
cd NHID-Clinical
pip install -r requirements.txt
python -m pytest tests/ -v

Replace SAMPLE_TWILIO_COMPLIANT or SAMPLE_TWILIO_NONCOMPLIANT in the adapter with your own call transcript to test your vendor's output.

Other Vendor Formats

The adapters/ directory contains format adapters that convert vendor-specific call transcripts to NHID-Clinical event traces. Available: Twilio Voice Intelligence, VAPI, Vonage, Retell AI, and Amazon Connect, each behind a hosted /v1/adapters/…/check route, plus an ElevenLabs post-call adapter in the repository.

Open for feedback

Questions or suggestions?

Run a shadow evaluation, or reach out directly.

Read the evaluation guide →

Implementation registry

A self-attestation list of NHID-Clinical implementations. NHID-Clinical does not score, rate, certify, or verify the entries.

This is a self-attestation list, not a certification. NHID-Clinical does not certify, audit, or warrant any vendor's implementation. A listing means the vendor ran the public conformance test suite (CTS) against their own integration and chose to publish the result. NHID-Clinical assigns no score, grade, tier, or badge to any listed entry, and publishing an entry involves no review by this project. Verify a vendor's claims independently — by running the conformance suite against their integration yourself — before relying on any listing for a procurement decision.

Listed Implementations

Loading…

How to Get Listed

Run the conformance test suite against your integration, then complete the vendor trust questionnaire and open a pull request adding your entry to content/registry_entries.json. Each entry needs a vendor_id. Listing publishes what you attest to; it does not add any assessment by this project.

Vendor Trust Questionnaire → Adapter Reference →

Going further: Part IV of the NHID-Clinical Playbook covers reference architecture, maturity labels, security boundaries and the implementation checklist.

Architecture, visualized

The interactive five-layer trust stack on the homepage shows where adapters, the policy engine, NHID-Auth v2, and the audit ledger sit relative to each other.

View the Trust Stack →     

Where to go next

Four ways into NHID-Clinical, whatever you came to do.