A 72-year-old on warfarin walks into a clinic in São Paulo. Chronic AFib, two prior GI bleeds, INR drawn last Tuesday at 3.4. The clinician opens an "AI clinical assistant" pitched last quarter. It suggests increasing her warfarin dose, citing an INR of 2.1. That number does not exist in her record. The LLM hallucinated it.

The doctor catches it. This time. But the near-miss ends her trust forever. She will never paste a chart into that tool again, and neither will the seventeen colleagues she tells at lunch. One hallucination at the moment of decision is a product-ending event.

This is the failure mode we designed Cortex to make architecturally impossible.

The moment of clinical decision is not the whole encounter

There is a precise instant in every workflow where the doctor is being told what to do. Adjust the dose. Order the lab. Refer to cardiology. Hold the anticoagulant before the procedure. What governs that instant determines whether your software is a tool or a liability.

Everything around it is different. Before the moment, the doctor is gathering context: reviewing the chart, summarizing two years of notes. After the moment, she is documenting: writing the SOAP note, coding the bill, drafting the referral. We call these the bookends of the encounter.

The bookends are where LLMs are appropriate. The middle is not.

Why the bookend pattern is safe

At the bookends, no patient action is gated on what the LLM produces. If the pre-visit summary misses a detail, the doctor reads the chart and catches it. If the post-visit note has a phrasing error, the doctor edits before signing. The LLM accelerates work the doctor was going to verify anyway.

At the moment of decision, the calculus inverts. A clinician acting on a wrong recommendation harms a patient. There is no downstream verification step, because the doctor IS the loop, and the LLM has just contaminated her input with confident nonsense.

Doctor-in-the-loop only works if what the doctor is looping over is verifiable. LLM output, by construction, is not.

The deterministic core

At the moment of decision, Cortex runs a JSON-Logic rule engine. Rules are versioned, signed off by named clinicians on the ELENA review panel, and cite their source authority: LOINC for labs, SNOMED for findings, ICD-10 and CIE-10 for diagnoses, AHA for cardiovascular guidance, SPAQI for perioperative protocols. Every rule has a clinician of record and a defensible citation.

The engine is boring on purpose. Same input, same output, every time. A 72-year-old on warfarin with an INR of 3.4 and a planned endoscopy in 48 hours triggers the same SPAQI bridging guidance today, next Tuesday, or in front of a regulator three years from now. Output is reproducible, testable, and auditable down to the rule version that fired.

The engine does not need nuance. It needs reproducibility. Nuance lives in the bookends.

The natural objection is that rule engines are dumb and cannot match LLM nuance. The objection misreads where nuance belongs. The pre-visit LLM compresses fifteen years of notes into the three lines that matter today. The post-visit LLM turns a voice memo into a structured SOAP note. By the time the doctor reaches the moment of decision, the surface area is already narrow, and what she wants is the ECG-INR-warfarin interaction flagged the same way every time. Predictability is the feature.

The regulatory frame

ANVISA RDC 657/2022 categorizes software-as-medical-device by clinical risk. An LLM placed at the moment of decision, generating recommendations that gate clinician or patient action, sits in Class III. Class III in Brazil is a multi-year clinical evidence and post-market surveillance regime. For a startup, it is functionally unlaunchable.

A deterministic engine at the moment of decision, with LLMs at the bookends, sits in Class I. Class I is launchable now, expandable into Class II later, and survivable under audit because every recommendation has a versioned rule, a citation, and a clinician of record behind it.

This is not a compromise we made because we could not build the LLM-at-the-decision version. We could. We chose not to. Deterministic at the moment of decision is the only architecture that survives ANVISA Class I, that doctors trust after the third encounter, and that holds up when the regulator asks why the system told a clinician to do what it did.

In LATAM clinical software in 2026, that is the only architecture that ships.