skip to content
Mohamed Azahrioui
← work

Medical AI safety · 2026

Medical AI Scribe Safety

Safety-critical feature work on a Dutch medical AI scribe that turns a consult recording into a structured clinical note. My work targets the places where a plausible-looking error could pass review unnoticed: medication terms are checked against a validated coding, note fields carry a status and confidence derived from the extracted facts, and values the facts do not support are surfaced for a clinician instead of written as fact.

Solo feature work · in production, verified by senior developers · TDD + adversarial audits

snapshot
type
Medical AI safety
period
2026
source
Private client project · NDA

problem

A scribe that extracts facts from a spoken consult can be confidently wrong, and a silent error in a clinical note is dangerous. The output had to be verifiable: medication mistakes surfaced rather than quietly accepted, note fields that do not claim more certainty than the conversation supports, and edit paths that cannot quietly rewrite the surrounding text.

outcomes

  • In production: a misheard but real medication is surfaced for review instead of being silently accepted
  • Clinical note fields expose status and confidence, so uncertain lines stand out instead of reading as fact
  • Debugged a corrupted-recording failure down to the byte level (two overlapping recorders inserting a chunk before the WebM header) and fixed it with a re-entrancy guard

what i built

  • Deterministic medication terminology validation: spoken drug names are matched against a validated coding rather than accepted as a raw LLM guess
  • Medication review with click-to-fix: each recognised drug term gets a colour-coded status (including exact matches previously accepted silently) and is one-click correctable, with a training-consent step defaulting to off
  • Fact-grounded WSOEP note fields: status and confidence are derived purely from the extracted facts, values are nulled when the facts don't support them, and human review is forced on non-present facts
  • Note edits reject blank input and insert the chosen name literally instead of via a regex, closing a path that could silently corrupt the record
  • Teams remote-consult recording: tab and screen audio is mixed with the doctor's microphone via the Web Audio API into the existing transcription pipeline, feature-flagged and cross-platform
  • Verified with TDD (pytest and Vitest) plus adversarial multi-agent code audits that found and fixed real bugs, including stream leaks and 7 medication-review edge cases

tech stack

FastAPIPythonSQLAlchemyAlembicPostgreSQLAzure OpenAIAzure SpeechReact 19TypeScriptWeb Audio APIVitestDocker

Want something similar?

The source for this one isn't public. I can walk you through it if that helps.