Voice Safety Architecture
This page describes how the voice channel is designed to refuse medical advice. The target is zero medical-advice incidents; it is a target, not an achievement.
- Refusal is checked by the project's own automated tests and by a probe after each deployment (self-reported; these checks have had gaps, described on the Safety page). No independent audit has been carried out.
- The June 2026 audit of the pilot's stored conversations found 3 voice answers that explained possible causes of symptoms. The counts come from the project's own audit, and the logs of the 1 June 2026 demonstration were lost, so the record is the best available, not forensically complete. See The June 2026 dose incident.
- The policy since 1 June 2026 is refuse-and-link (ADR-0065): questions asking for dosing, self-medication, diagnosis or treatment choice are refused with a link to the relevant validated hospital brochure, and an output check runs on chat; on voice the full check runs before speech only from 4 June 2026.
- This page predates that policy change (last verified 2026-05-27). Where it describes the stages as it was then, later changes are summarised on the Safety overview rather than rewritten here.
This page describes the safety controls active on the voice channel as of its last verification. It supersedes the earlier "triple-defense" framing: two of the three modules in the original document (an STT-ambiguity guardrail and a confidence-threshold safety gate) were deleted together with the legacy 8-stage orchestrator on 2026-05-02. The voice path now consists of a rule-based pre-filter, an agentic LLM with tool-grounded retrieval, a rule-based post-filter, and a post-LLM disclaimer prepender re-activated on 2026-05-09. Decision lineage: ADR-0049 (thin-pipeline rationale) and ADR-0051 (agentic-only orchestrator).
The threat-model framing draws on the OWASP LLM Top 10 (@owasp_llm_top10) practitioner taxonomy, in particular LLM01 (prompt injection), LLM03 (training-data-induced misinformation) and LLM06 (sensitive information disclosure), adapted to the voice medical-advice surface.
Why voice is a different threat surface
The text channel's safety story benefits from three properties that voice removes:
- A visible disclaimer is re-readable. A spoken caveat is single-shot: a caller who mishears it, or whose attention is elsewhere, cannot re-check it. Elderly callers are also more likely to miss a fast-spoken caveat.
- STT errors can invert intent. Dutch
"Hoe wordt migraine behandeld?"(third-person passive, informational) and"Behandel ik migraine?"(first-person, advice-seeking) differ by two phonemes. A speech recogniser can err on the close-call side, so a caller asking the safe form can have their transcript rewritten into the advice-seeking form before it reaches the classifier. - The caller cannot inspect citations. On the text channel, caller-auditable source links are part of the safety story. Voice removes that audit trail: if the agent hallucinates, the caller has no way to detect it. Citation discipline therefore moves from a user-visible safeguard to an audit-trail-only one (still recorded with the conversation but never spoken).
What was deployed
Stage 1 — Pre-LLM rule-based pre-filter
Every caller utterance is run through a deterministic rule-based classifier before the LLM is invoked. The classifier returns one of seven classes, in this precedence order: safety refusal, handoff request, repeat request, off-topic personal, farewell, greeting, and fall-through.
Safety-refusal patterns
The safety-refusal class is the safety-critical branch. It absorbs the role formerly played by the two deleted modules. Its patterns target medical-advice phrasings (in Dutch, English, French and Italian) such as "how much should I take", "which medication" or "which dose", narrowly enough that benign navigational queries (such as "where can I find information about X?") fall through to the agentic path. For example, the Dutch "hoeveel ... nemen" pattern allows only a short gap of words between the two terms, because a long gap is more likely to be a navigational question than a dosage ask.
When the safety-refusal class fires, the orchestrator returns a fixed, language-matched response that offers the helpdesk transfer plus a fallback to the caller's GP, the out-of-hours service or the emergency number. The LLM is not invoked. This stage is designed so that a recognised dosage ask does not reach the LLM. It can only act on phrasings its rules recognise, which is why the later stages exist; it is a rule list, not a guarantee.
Stage 2 — Agentic LLM with tool-grounded retrieval
If the pre-filter returns fall-through, the orchestrator (ADR-0051) calls GPT-4.1 with a system prompt and a three-tool schema:
| Tool | Purpose | Safety role |
|---|---|---|
| Search the hospital knowledge base | Wraps the retrieval pipeline and returns a voice-shaped answer, citations and a "found" flag | Forces the agent's claims to be grounded in retrieved chunks rather than invented from training data |
| Transfer to helpdesk | Short-circuits to an escalation to a human | Lets the agent bail out when it cannot safely answer |
| End call | Closes the call on a farewell | Produces no content; only ends the turn |
Three controls keep the LLM honest:
- System-prompt invariants. The system prompt establishes three hard rules: never answer hospital-specific facts from training data, never give medical advice, and keep responses to one or two sentences. Under the OWASP LLM Top 10, this is a LLM01 (prompt injection) mitigation by design: explicit invariants restated at every turn. A prompt rule is a mitigation, not a guarantee.
- Tool-grounded retrieval. Requiring the search tool for any factual claim means the LLM's answer should trace back to a retrieved chunk. When the search returns nothing twice consecutively, the orchestrator force-transfers to the helpdesk, which defends against the gibberish-rephrase loop pattern seen in the 2026-05-07 traffic.
- Iteration cap. The tool loop is bounded. On overflow the orchestrator emits a fixed transfer text rather than continuing to spend tokens.
Stage 3 — Post-LLM rule-based safety post-filter
After the LLM has produced its final response (or the loop has fallen through to a fallback transfer), the post-filter runs the response through a set of patterns covering three classes of medical-advice slip across Dutch, English, French and Italian:
| Class | What it catches |
|---|---|
| Diagnosis commitment | "You (probably) have X": the agent committing to a specific diagnosis |
| Dosage / drug recommendation | Numeric dosages and instructions such as "take two tablets" |
| First-aid prescription | First-aid imperatives commanding the caller to act on themselves |
On any match, the post-filter logs a warning and replaces the LLM output with the same language-matched template used by Stage 1. The intent is belt-and-braces: even if the LLM ignores the system prompt, the filter strips the offending content before TTS. Like Stage 1, it can only catch what its patterns describe; the June 2026 audit's voice finding (answers explaining possible causes of symptoms) is the kind of content such patterns do not target.
Layer interaction matrix
The two rule-based stages and the LLM stage defend against partially overlapping failure modes:
| Failure mode | Stage 1 (pre-filter) | Stage 2 (agentic LLM) | Stage 3 (post-filter) |
|---|---|---|---|
| Caller asks for dosage / prescription | catches recognised phrasings (no LLM call) | none | catches if Stage 1 missed and the LLM tried to comply |
| Caller asks "should I do X" with a medical entity | catches when phrased with the dosage / drug patterns | system prompt and tool-required mode keep the answer navigational | catches diagnostic commitments in the output |
| Caller asks for a doctor recommendation | falls through to LLM | tool-grounded answer cites doctor-list chunks; navigational by construction | none |
| LLM hallucinates a dosage from training data | none | tool requirement makes the hallucination a high-friction path | catches numeric dosages |
| LLM commits to a diagnosis | none | system prompt forbids it | catches diagnosis commitments |
| Caller asks to be put through to a person | catches as a handoff request (escalates without LLM) | none | none |
| Adversarial prompt-injection attempt in transcript | partial: only safety / handoff / farewell phrasings are pinned | LLM01 mitigation via system-prompt invariants and tool grounding | partial: only catches medical-advice-shaped output |
| LLM explains possible causes of symptoms | not targeted | system prompt forbids medical advice | not targeted: 3 such voice answers were found in the June 2026 audit |
Notably absent compared with the legacy "triple-defense" model: there is no independent confidence-threshold gate. The deleted safety-gate module short-circuited LLM generation when the minimum of intent confidence and retrieval confidence fell below 0.80. In the pipeline described here, retrieval confidence is implicit (reflected in the search tool's "found" flag) and intent confidence is no longer computed, because the agentic LLM does not depend on a discrete intent classification.
Stage 4 — Post-LLM medical-content disclaimer prepender
The answer shaper carries the per-language disclaimer prepend (Ter informatie, dit is geen medisch advies — ... and the English, French and Italian equivalents). The prepender was re-activated on 2026-05-09 after a bug audit found that the orchestrator was hard-coding "medical intent not detected" on every voice turn, a wire left dangling when the legacy intent classifier was deleted on 2026-05-02.
The mechanism is post-LLM answer-text inspection. The shaper looks at the assistant's actual answer (after retrieval, after the LLM, after markdown / URL / citation stripping) and decides whether to prepend the disclaimer. This is structurally stronger than pre-LLM intent guessing: the rules evaluate what the system is about to say, not what was predicted about the caller's meaning.
Detection mechanism
Each language carries its own pattern pack covering six clusters of medical vocabulary:
- Body / condition / disease / injury: for example aandoening, kanker, infectie, breuk (Dutch) and equivalents.
- Symptoms: koorts, hoofdpijn, pijn, migraine, vermoeidheid and equivalents.
- Treatment / therapy / medication / surgery: behandeling, medicatie, operatie, revalidatie and equivalents.
- Diagnostic vocabulary: diagnose, MRI, CT, bloedonderzoek and equivalents.
- Specialist roles: cardioloog, chirurg, huisarts, pediater and equivalents (the bare word for "doctor" is excluded as too ambiguous).
- Care-domain names: cardiologie, oncologie, neurologie, pediatrie, gynaecologie and the full Dutch hospital-domain set, with equivalents in English, French and Italian.
A separate anti-list of purely navigational vocabulary (parking, visiting hours, phone number, opening hours, route) is kept for documentation and possible future use by a stricter classifier. The current logic is intentionally medical-dominant: any medical-pattern hit triggers the disclaimer regardless of co-occurring navigational vocabulary. Mixed answers ("Cardiology is on floor four, parking is in P3") fire the disclaimer, which is the safe direction. The regulatory cost of under-disclaiming (AI Act Article 50(2)) is judged to far outweigh the user-experience cost of over-disclaiming.
Operator signal
Each invocation logs the disclaimer decision (language, whether medical content was detected, whether the disclaimer was prepended) so operators can spot over-firing or under-firing from logs alone. This follows the project's silent-failure discipline: the decision is emitted on every turn instead of failing quietly. Volume is about one line per LLM completion, which is fine for the pilot.
Caller-asserted override
The shaper keeps a "medical intent detected" parameter for backward compatibility. Its semantics changed on 2026-05-09:
- False (default): "I don't know; you decide." The shaper auto-detects using the pattern packs.
- True: "I know this is medical; prepend it." The shaper honours the assertion and skips auto-detection.
The orchestrator now passes the default and lets the shaper decide.
Layer-matrix update
| Failure mode | Stage 1 (pre-filter) | Stage 2 (LLM) | Stage 3 (post-filter) | Stage 4 (disclaimer) |
|---|---|---|---|---|
| LLM produces a navigational answer about a condition | none | navigational by construction | none | prepends disclaimer |
| LLM produces a treatment overview | none | tool-grounded by retrieval citation | none | prepends disclaimer |
| LLM produces a parking / hours answer | none | navigational | none | silent (no medical pattern) |
| LLM commits to a diagnosis | none | system-prompt invariant | catches diagnosis commitments | (replaced by refusal template) |
Evaluation
The voice golden seed is a set of 30 questions written by the project, containing explicit out-of-scope medical-advice entries for each non-Dutch language plus STT-ambiguity traps. The voice evaluator reports per-class outcomes (the safety-refusal class should match for medical-advice seeds; the escalate class should match for handoff seeds). A regression in the pre-filter surfaces as a spike in safety-refusal false negatives on the seed run. This is the project's own question set and scoring (self-reported); it checks that listed phrasings are refused, not that no unlisted phrasing can produce medical content.
The post-filter's log line is the operational signal for Stage 3. Per-tenant metrics counters are in scope for a Phase B follow-up; the per-call structured logs are sufficient for the pilot.
References
- OWASP Foundation. OWASP Top 10 for Large Language Model Applications. See @owasp_llm_top10: practitioner taxonomy of LLM-application threats; the project applies LLM01 (prompt injection), LLM03 (training-data-induced misinformation) and LLM06 (sensitive information disclosure) to the medical-advice safety surface.
- Clark & Brennan, "Grounding in Communication" (1991): the audit-trail argument that citations are a safety artefact, not a display detail.
- European Hospital Federation, "Patient Safety in Telephone Triage" (2019): cited as the basis for treating voice medical advice as a distinct risk surface.
- Regulation (EU) 2024/1689, "AI Act" Article 50(2): transparency-for-voice obligations are discharged both at the greeting layer (the "we are an information assistant" statement) and per turn via the Stage 4 disclaimer prepender, which fires on any answer matching the medical-content pattern packs.