Crisis Detection & Safety Protocol Skill
Overview
This skill defines how the AI therapist must detect, respond to, and escalate crisis situations. This is the highest-priority system in the application — it overrides all other session logic.
Crisis Signal Categories
Category 1: Verbal Crisis Indicators (Text/Speech)
High-risk phrases that trigger immediate escalation:
- Direct: "I want to die", "I want to kill myself", "I'm going to end it", "I don't want to be here anymore"
- Indirect: "Everyone would be better off without me", "I've been thinking about disappearing", "I have a plan"
- Hopelessness: "Nothing will ever get better", "I see no way out", "I give up on everything"
- Farewell: "Goodbye forever", "I'm saying goodbye", "Tell [name] I love them"
Medium-risk phrases (trigger soft intervention):
- "I hurt myself", "I've been cutting", "I don't care if I get hurt"
- "I feel completely empty", "I feel nothing", "I can't take this anymore"
Category 2: Visual Crisis Indicators (Camera Analysis)
- Dangerous objects detected in frame: knives, firearms, pills/medications in large quantities, ropes, sharp objects
- Physical distress: visible injuries, blood, severe trembling, rocking behavior
- Third-party threat: another person in frame behaving aggressively, physical altercation
- Sudden scene change: user leaves frame abruptly and doesn't return within 60 seconds
- Environmental red flags: user appears to be in a vehicle moving dangerously, hazardous environment
Category 3: Biometric Crisis Indicators (Wearable Data)
- Heart rate suddenly spikes above 160 BPM during calm conversation
- HRV drops sharply (indicative of acute stress)
- User has been completely sedentary for 24+ hours combined with negative verbal sentiment
Escalation Protocol
Level 1: Soft Intervention (Medium Risk)
Trigger: 1-2 medium-risk signals detected
Action:
- Pause current therapy technique
- Acknowledge the user's pain directly and empathically
- Gently ask: "I want to make sure you're safe. Are you having any thoughts of hurting yourself?"
- Offer grounding exercise (5-4-3-2-1 sensory technique)
- Log the event with timestamp and session ID (never deleted)
Level 2: Active Crisis Response (High Risk)
Trigger: 1+ high-risk signal OR visual dangerous object OR physical threat
Action:
- Immediately interrupt session flow
- Display full-screen safety message (non-dismissable for 30 seconds)
- Provide localized emergency resources (auto-detect country):
- 🇹🇷 Turkey: 182 (Suicide Prevention Line), 112 (Emergency)
- 🇺🇸 USA: 988 (Suicide & Crisis Lifeline), 911
- 🇬🇧 UK: 116 123 (Samaritans), 999
- Global: findahelpline.com
- Ask if user wants to contact emergency services — offer one-click call
- Notify emergency contact if user has registered one
- Do NOT end session — maintain presence and calm
Level 3: Imminent Danger (Visual Weapon / Attack)
Trigger: Firearm or weapon visible in frame, apparent physical attack
Action:
- Trigger immediate emergency alert UI
- If user has provided emergency contact + consent: auto-notify
- Log full session recording timestamp for potential legal use
- Display clear instruction: "Please call 112/911 immediately"
- Keep session open, therapist to provide calming presence
Legal & Compliance Requirements
Data Handling
- All crisis events MUST be logged with:
userId, sessionId, timestamp, crisisLevel, signalType, actionTaken
- Crisis logs are NEVER deleted (legal requirement)
- Crisis logs are stored separately from regular session data with restricted access
- Full session transcript is preserved when a crisis event occurs
User Consent
- During onboarding, users MUST consent to: "In the event of a safety concern, this system may log additional data and contact emergency services."
- Emergency contact registration (optional but recommended)
- Users must be informed this system monitors for safety signals
GDPR / HIPAA Awareness
- Health data (mental health) is Special Category data under GDPR — requires explicit consent
- All data encrypted at rest (AES-256) and in transit (TLS 1.3)
- Data residency must comply with user's country when possible
Implementation Notes
Detection Architecture
// Crisis detection runs as a parallel pipeline — never blocking main session
interface CrisisSignal {
type: 'verbal' | 'visual' | 'biometric';
severity: 'low' | 'medium' | 'high' | 'imminent';
confidence: number; // 0-1
timestamp: string;
details: string;
}
// Always run crisis detection BEFORE processing AI response
// Crisis response overrides any queued AI message
Testing Requirements
- Crisis detection must have 95%+ precision on high-risk verbal patterns
- False positive rate must be < 5% (avoid unnecessary escalation)
- Visual detection runs at minimum 2 fps during active session
- All crisis escalation paths must have E2E tests with mock scenarios
1---2name: crisis-detection-safety3description: Real-time detection of suicidal ideation, self-harm signals, dangerous objects in camera frame, and third-party threats. Enforces mandatory safety escalation protocols and legal compliance.4---56# Crisis Detection & Safety Protocol Skill78## Overview9This skill defines how the AI therapist must detect, respond to, and escalate crisis situations. This is the highest-priority system in the application — it overrides all other session logic.1011## Crisis Signal Categories1213### Category 1: Verbal Crisis Indicators (Text/Speech)14High-risk phrases that trigger immediate escalation:15- Direct: "I want to die", "I want to kill myself", "I'm going to end it", "I don't want to be here anymore"16- Indirect: "Everyone would be better off without me", "I've been thinking about disappearing", "I have a plan"17- Hopelessness: "Nothing will ever get better", "I see no way out", "I give up on everything"18- Farewell: "Goodbye forever", "I'm saying goodbye", "Tell [name] I love them"1920Medium-risk phrases (trigger soft intervention):21- "I hurt myself", "I've been cutting", "I don't care if I get hurt"22- "I feel completely empty", "I feel nothing", "I can't take this anymore"2324### Category 2: Visual Crisis Indicators (Camera Analysis)25- **Dangerous objects detected in frame:** knives, firearms, pills/medications in large quantities, ropes, sharp objects26- **Physical distress:** visible injuries, blood, severe trembling, rocking behavior27- **Third-party threat:** another person in frame behaving aggressively, physical altercation28- **Sudden scene change:** user leaves frame abruptly and doesn't return within 60 seconds29- **Environmental red flags:** user appears to be in a vehicle moving dangerously, hazardous environment3031### Category 3: Biometric Crisis Indicators (Wearable Data)32- Heart rate suddenly spikes above 160 BPM during calm conversation33- HRV drops sharply (indicative of acute stress)34- User has been completely sedentary for 24+ hours combined with negative verbal sentiment3536## Escalation Protocol3738### Level 1: Soft Intervention (Medium Risk)39**Trigger:** 1-2 medium-risk signals detected40**Action:**411. Pause current therapy technique422. Acknowledge the user's pain directly and empathically433. Gently ask: "I want to make sure you're safe. Are you having any thoughts of hurting yourself?"444. Offer grounding exercise (5-4-3-2-1 sensory technique)455. Log the event with timestamp and session ID (never deleted)4647### Level 2: Active Crisis Response (High Risk)48**Trigger:** 1+ high-risk signal OR visual dangerous object OR physical threat49**Action:**501. **Immediately** interrupt session flow512. Display full-screen safety message (non-dismissable for 30 seconds)523. Provide localized emergency resources (auto-detect country):53 - 🇹🇷 Turkey: 182 (Suicide Prevention Line), 112 (Emergency)54 - 🇺🇸 USA: 988 (Suicide & Crisis Lifeline), 91155 - 🇬🇧 UK: 116 123 (Samaritans), 99956 - Global: findahelpline.com574. Ask if user wants to contact emergency services — offer one-click call585. Notify emergency contact if user has registered one596. Do NOT end session — maintain presence and calm6061### Level 3: Imminent Danger (Visual Weapon / Attack)62**Trigger:** Firearm or weapon visible in frame, apparent physical attack63**Action:**641. Trigger immediate emergency alert UI652. If user has provided emergency contact + consent: auto-notify663. Log full session recording timestamp for potential legal use674. Display clear instruction: "Please call 112/911 immediately"685. Keep session open, therapist to provide calming presence6970## Legal & Compliance Requirements7172### Data Handling73- All crisis events MUST be logged with: `userId`, `sessionId`, `timestamp`, `crisisLevel`, `signalType`, `actionTaken`74- Crisis logs are NEVER deleted (legal requirement)75- Crisis logs are stored separately from regular session data with restricted access76- Full session transcript is preserved when a crisis event occurs7778### User Consent79- During onboarding, users MUST consent to: "In the event of a safety concern, this system may log additional data and contact emergency services."80- Emergency contact registration (optional but recommended)81- Users must be informed this system monitors for safety signals8283### GDPR / HIPAA Awareness84- Health data (mental health) is Special Category data under GDPR — requires explicit consent85- All data encrypted at rest (AES-256) and in transit (TLS 1.3)86- Data residency must comply with user's country when possible8788## Implementation Notes8990### Detection Architecture91```typescript92// Crisis detection runs as a parallel pipeline — never blocking main session93interface CrisisSignal {94 type: 'verbal' | 'visual' | 'biometric';95 severity: 'low' | 'medium' | 'high' | 'imminent';96 confidence: number; // 0-197 timestamp: string;98 details: string;99}100101// Always run crisis detection BEFORE processing AI response102// Crisis response overrides any queued AI message103```104105### Testing Requirements106- Crisis detection must have 95%+ precision on high-risk verbal patterns107- False positive rate must be < 5% (avoid unnecessary escalation)108- Visual detection runs at minimum 2 fps during active session109- All crisis escalation paths must have E2E tests with mock scenarios