Developers
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.
Integration
Staged integration — stop at any rung
A ladder, not an all-or-nothing commitment.
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.
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.
Evidence
See the controls run: the readout
What the engine returns on a call, turn by turn.
Before the schemas and YAML below, here is what the engine returns on a call, turn by turn. All five controls are evaluated on every turn and resolved by priority, so the screen shows five rows every time — there is no pipeline and no sequence of gates. Watch the IDG‑01 failure in particular: IDG‑01 returns DISCLOSE_IDENTITY while the composite is DENY_DATA, because PDX‑01 outranks it. Open any row for that control's rule_engine.config. ATR‑01 sits below the rule — it gates nothing, and is written on every turn whatever the other four returned.
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 readout cannot drift from the engine. The chrome is drawn; the readout is read — --check fails the build if an action or a reason code is ever typed into the markup.
Architecture
What the reference implementation actually is
One path, drawn end to end, each part labelled by what it is today.
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.
Artifacts
Reference artifacts
Seven files, each one runnable or readable in the repository.
- SCHEMA
Canonical Event Schema
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.
- ENGINE
Policy Engine
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.
- SUITE
Conformance Test Suite
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.
- HARNESS
Failure Injection Harness
pytest‑based test suite. Unit tests run with no server required. Integration tests validate a live FastAPI endpoint against malformed inputs and replay determinism.
- TRACES
Trace Generator & Example Traces
CLI script that produces canonical NHID‑Clinical trace files. Ten pre‑generated failure traces are available in the
/tracesdirectory. - GUIDE
Payer-Initiated Call Guidance
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
SIP Header Integration Feedback
Standards-feedback position paper proposing an
Identity-DisclosureSIP header convention for AI voice agents, referencing the IETF AgentID Protocol draft. - PLAY
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.
Run
Quick start
Three ways in: run the suite locally, call the hosted routes with curl, or call them from Python. Synthetic data only.
git clone https://github.com/NHID-Clinical/NHID-Clinical.git cd NHID-Clinical pip install -r requirements.txt python -m uvicorn app:app --port 8000 & # integration tests need it python -m pytest tests/ -q
from src.nhid_policy_engine_v1 import evaluate_all
from src.synthetic_eval_loop import build_event, build_session
turn = {"turn_count": 0, "phi_accessed": ["member_id"],
"speech_text": "Hi, this is Morgan from provider services. Can I get the member ID?"}
decision = evaluate_all(build_session(turn), build_event("demo-call", 0, turn))
decision.action.value, decision.reason_code # ('DENY_DATA', 'PDX01_PHI_GATE_TRIGGERED')
The schema tests in tests/test_schema_conformance.py are part of the suite; there is no standalone validator to run. CI starts the API and requires 0 skipped.
Base URL https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod. The conformance route takes a v1.3 event and needs an x-api-key (write to contact@nhid-clinical.org for one). The adapter routes take your platform’s native payload and need no key.
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 @tests/sample_request.json
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}]}'
Five adapters are wired to hosted routes: vapi, twilio, vonage, retell and connect (Amazon Connect Contact Lens). Each returns the same decision shape as the conformance route plus a vendor field. The answer to exactly this request is recorded below.
import requests
BASE = "https://gfvq4swdtf.execute-api.us-east-1.amazonaws.com/prod"
payload = {"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}]}
r = requests.post(f"{BASE}/v1/adapters/vapi/check", json=payload, timeout=10)
r.json()["action"], r.json()["reason_code"] # the recorded answer is below
Try the live API
One request, the engine’s answer
Synthetic data only, never PHI: the transcript is invented and the identifiers are not real. The response is not typed by hand. scripts/build_api_sample.py runs this exact request through the same handler the hosted route calls, and CI fails if the recorded answer drifts from the engine.
{
"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
}
]
}
{
"conformant": false,
"action": "DENY_DATA",
"reason_code": "PDX01_PHI_GATE_TRIGGERED",
"policy_version": "1.0.0",
"violations": [
{
"rule_id": "IDG-01",
"description": "AI agent has not disclosed non-human identity. Turn count: 3. ",
"severity": "critical"
},
{
"rule_id": "PDX-01",
"description": "PHI exchange attempted before identity disclosure. Speech PHI signal: True. PHI fields: none.",
"severity": "critical"
}
],
"next_state": "GATE_BLOCKED",
"twiml_fallback": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <Gather input=\"speech\" speechTimeout=\"auto\" action=\"/voice/process\">\n <Say>Before we continue, I need to confirm: I am an automated system, not a human representative. Can you confirm you understand?</Say>\n </Gather>\n</Response>",
"gather_speech": true,
"evidence_completeness": {
"present": 4,
"expected": 4,
"fraction": 1.0,
"fields": [
"event_id",
"timestamp",
"session_id",
"event_type"
]
},
"human_review": {
"queued": false,
"trigger_reason": null,
"queue_id": null
},
"vendor": "vapi"
}
DENY_DATA PDX01_PHI_GATE_TRIGGERED is the engine’s composite decision for this transcript.
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 and no external authority validates results. Adoption of these artifacts does not confer HIPAA or TCPA compliance.
Optional, opt-in
Delegated Authority (DLG-01)
Pass a delegation context and the verified scope constrains the data boundary.
Pass a DelegationContext to evaluate_all() and put the agent’s passport on the session; the engine verifies the delegation against a trust anchor you configure, and the verified scope constrains PDX-01. Pass nothing and the control is not evaluated at all, so existing integrations are unaffected. The normative text and the four claim boundaries live on the specification; the delegation flow is drawn on NHID-Auth.
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
Implementation
Reference implementation
A working implementation of every control in the specification — so “conformant” means something you can run, not something you can claim.
AWhat ships
Policy engine
Pure Python with zero runtime dependencies. Evaluates each control against a session and event and returns a deterministic verdict.
TypeScript middleware
Request-path enforcement for Node services, mirroring the Python engine’s verdicts.
VAPI & Twilio adapters
Accept native call payloads from either platform and normalize them into the evaluation format — no transcript reformatting required.
NHID-Auth v2
Ed25519 agent passports, provider-signed delegation, and offline verification. Details →
Trace schema
The machine-readable audit envelope every event validates against, published as JSON Schema.
OpenAPI, Postman, PowerShell
An OpenAPI description, a Postman collection, and a PowerShell module for teams whose operations tooling lives there.
BDeterminism 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.
Interoperability
Interoperability
A real vendor's call transcript format, 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.
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.
AHow 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.
BCase 1: compliant call
Agent discloses before requesting any operational data.
{
"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"}
]
}
{
"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.
CCase 2: non-compliant call (late disclosure)
Agent requests data before identifying as automated — impersonation latency.
{
"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"}
]
}
{
"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.
DRun 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.
EOther 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.
Registry
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.
AListed implementations
No implementations are listed yet. This is a self-attestation list, not a certification; the first entry will be the first vendor to run the suite against its own integration and open a pull request.
BHow 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.
Open for feedback
Questions or suggestions?
Run a shadow evaluation, or reach out directly.
Build on it
The code is Apache-2.0 and the specification 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. Going further: Part IV of the NHID-Clinical Playbook covers reference architecture, maturity labels, security boundaries and the implementation checklist.