Red flags live in code
Chest pain, trouble breathing, confusion, no urine, severe swelling, muscle weakness, irregular heartbeat and fainting are regex rules. The model can call them, but the function also runs them on the raw message and forces urgency: 'urgent', red_flag: true and a call-911-or-care-team message, whatever the model said. The rules are deliberately over-inclusive.
The model never does maths
Language models are unreliable at arithmetic, and a wrong sodium total is worse than none. Claude chooses ingredients and grams; compute_totals multiplies USDA values and code assigns low/mid/high from documented per-meal thresholds. Final totals are always recomputed from the submitted ingredients.
Never a blank error
No API key, an API error, a timeout, a refusal or output that fails validation twice all lead to the same place: a deterministic rules answer with source: 'rules'. Quota storage being down also routes to rules rather than to the paid model.
Same shape as leasing-inquiry triage and tour booking
Swap "caregiver" for "prospective tenant" and the triage agent is a leasing assistant: classify the inquiry (pricing, availability, maintenance, emergency), retrieve the property FAQ, enforce hard rules in code (a gas leak or flooding escalates no matter what the model thinks), offer real tour slots from a calendar tool, and hand staff a validated draft plus an audit trail of tool calls. The pieces that make it production-safe carry over: auth at the edge, per-user quotas, input limits, strict tool schemas, validated structured output, and a fallback path.