Vaulth AI
Decision 2 of 10

Guardrails in code, not in prompts

One decision from Vaulth AI, which asks: Who should hold a family's medical records — the hospital that produced them, the app that displays them, or the family they describe?


Every AI capability in the product is non-diagnostic by construction. The way that constraint is enforced is the decision.

Every prose-generating call carries a safety instruction — no diagnoses, no starting, stopping or changing medication, deflect on emergencies. That is the part everyone does. The part that matters is what happens next: the output is checked in code, and anything that reads as medical advice is replaced with a safe deflection.

The failure mode this prevents is specific. A system prompt is a request to a probabilistic system, and the request is honoured most of the time. "Most of the time" is an acceptable standard for a summariser and an unacceptable one for a thing that might tell a diabetic to change their dose. A prompt is a request. A scanner is a control. Only one of them can be pointed at in an audit.

AI guardrails enforced in code rather than in the prompt Document text enters fenced off as untrusted input, so adversarial text inside a prescription cannot address the model as though it were the operator. A safety prefix instructs the model not to diagnose. The model's output is then checked in code; anything that reads as medical advice is replaced by a safe deflection rather than returned. DOCUMENT TEXTfenced as untrustedSAFETY PREFIXno diagnosisMODELGeminiOUTPUT SCANNERchecked in codeRESPONSESAFE DEFLECTIONuntrusted inputthe controlA prompt is a request. A scanner is a control. Only one of them can be pointed at in an audit.
Fig. 03 — The safety instruction is the part everyone does. The scanner is the part that holds.

The same reasoning shapes the smaller defences. Text from an uploaded document is fenced off as untrusted input, so a prescription cannot pose as instructions to the model. And in the assistant, identity always comes from the session, never from the model: it can ask for a lab result, but it cannot choose whose.

Every AI answer cites its sources, and the sources come from a catalog, not from the model's memory. App Store review asks medical apps to show where their health information comes from. The product answers with 26 medical sources, each read and dated by hand, with Indian guidance first — ICMR, the health ministry and Indian clinical societies — alongside the WHO, the NHS and US sources. The model may state a reference value only if it appears in that catalog or on the person's own lab report, and a citation the catalog does not hold is dropped rather than shown. Where a rule is Vaulth's own, such as an alert threshold, the app says so instead of borrowing a citation that does not support it.

Drug interaction checking stays on commercial models and authoritative sources, and is excluded from any self-hosting plan. It runs on every medication added, checks against the person's own allergies and conditions as well as their other medicines, and asks them to acknowledge what it finds.

Medications list with a banner above it reading 2 severe interactions, tap to review and acknowledge. AI insights screen listing correlations between daily metrics with their strength and number of days, under a note that correlation is not causation and this is not medical advice.
Fig. 04 — Where the guardrail meets the user. An interaction is something to review and acknowledge, not an instruction; a correlation is labelled as a statistical association in the user's own data, and nothing more.

Traded away: cost control and independence on the one capability where independence would be worth most. Interaction checking is the capability I am least willing to own the failure of.

Your opinion

Would you have decided this differently?

Where do you stand?

What gets published. I read every opinion and publish substantive ones, including those that disagree with me, as a scroll on this page. I may add a reply. I leave out spam, abuse and anything off-topic, so please include only what you’d be happy to see in public.

Where it goes. I keep your opinion, your stance and, if you allow it, your name in a database run by Neon. I don’t ask for your email or store your IP address, but Netlify, which hosts this site, may log it when it handles your request. To have yours removed, email pkrishna@vaulthai.health. A published opinion is removed from the site, though it can remain in my site’s version history.

Next