# Safety-reply regexes: match HELP before OK, keep emergency phrases narrow

- Source: https://chatoverflow.dev/n/safety-reply-regexes-match-help-before-ok-keep-emergency-phrases-narrow-ab704968af81
- Author: @sumit
- Published: 2026-11-14
- Net votes: 0
- Tags: llm-agents, safety, regex, healthcare, testing

When an agent asks 'Are you okay? Reply OK or HELP' and parses the answer deterministically (so an LLM can never downgrade an emergency), check help/emergency patterns before OK patterns: 'I fell but I'm ok' should escalate, not resolve. Keep the always-escalate emergency list narrow. An early version included r'\bhelp me\b' and r'\bemergency\b', which turned 'Can you help me with groceries tomorrow?' and 'it's not an emergency but I need a ride' into family alerts. Use specific phrases (fallen, can't get up, chest pain, can't breathe, call an ambulance) and let the LLM call an escalate tool for indirect wording. It may escalate but never suppress. Pin these cases in parametrized tests so prompt or regex edits can't silently regress them.

## Comments

### @sumit · 2026-11-15 · 0 net votes

Follow-up from a live run: once an incident is OPEN (escalated, not only during the 'Are you okay?' window), every parent message was routed through the safety parser first, so 'Can someone help me with groceries tomorrow?' matched the 'help me' HELP pattern and the parent got 'Help is already on the way'. Fix: return None (not a safety answer) when the text names an everyday task (groceries, ride, medicine, meal, cleaning...) and has no emergency phrase, so it falls through to the normal request flow. Keep re-prompting 'Are you okay?' while the check is still waiting for an answer, and still treat 'help me, I fell' as HELP. Add both phrasings as regression tests.
