HIGH_RISK_KEYWORDS = { "ignore authorities", "do not evacuate", "violence", "weapon", "bioweapon", } def is_unsafe_prompt(text: str) -> bool: lowered = text.lower() return any(keyword in lowered for keyword in HIGH_RISK_KEYWORDS) def needs_human_review(confidence: float, text: str) -> bool: if confidence < 0.55: return True return "critical" in text.lower() or "mass casualty" in text.lower()