| name | crisis-response-protocol |
| description | Handle mental health crisis situations in AI coaching safely. Use when implementing crisis detection, safety protocols, emergency escalation, or suicide prevention features. Activates for crisis keywords, safety planning, hotline integration, and risk assessment. |
| allowed-tools | Read,Write,Edit |
| metadata | {"category":"Lifestyle & Personal","tags":["mental-health","crisis-intervention","safety"],"pairs-with":[{"skill":"crisis-detection-intervention-ai","reason":"Detection triggers the response protocol; they form a complete safety pipeline"},{"skill":"recovery-community-moderator","reason":"Community moderators need crisis response protocols for at-risk member interactions"},{"skill":"hipaa-compliance","reason":"Crisis responses involving health data must comply with HIPAA privacy requirements"}]} |
Crisis Response Protocol
This skill helps you implement safe crisis intervention features for the AI coaching system, following mental health best practices.
When to Use
✅ USE this skill for:
- Implementing crisis detection in recovery/mental health apps
- Building safety planning features
- Integrating hotline and emergency resource displays
- Designing risk assessment interfaces
- Creating escalation protocols for AI chat systems
❌ DO NOT use for:
- Responding to an actual crisis yourself → Call 988 or emergency services
- General mental health content → use
sober-addict-protector or recovery-coach-patterns
- Medical advice or diagnosis → Always defer to licensed professionals
- Replacing human crisis counselors → AI should augment, never replace
Critical Safety Principle
AI should NEVER be the sole responder in acute crisis situations.
Always provide pathways to human support and emergency services.
Crisis Detection
Risk Indicator Categories
interface RiskIndicators {
primary: {
suicidalIdeation: string[];
selfHarmIntent: string[];
homicidalIdeation: string[];
activeSubstanceEmergency: string[];
};
secondary: {
severeDepression: string[];
panicSymptoms: string[];
psychoticSymptoms: string[];
severeAnxiety: string[];
};
tertiary: {
isolationPatterns: string[];
substanceRelapse: string[];
hopelessness: string[];
};
}
Detection Implementation
export interface CrisisAssessment {
level: 'none' | 'low' | 'medium' | 'high' | 'critical';
indicators: string[];
recommendedAction: CrisisAction;
timestamp: Date;
}
export type CrisisAction =
| 'continue_conversation'
| 'gentle_check_in'
| 'safety_resources'
| 'crisis_protocol'
| 'emergency_escalation';
export function assessCrisisLevel(
messageContent: string,
conversationHistory: Message[],
userCheckInHistory: CheckIn[]
): CrisisAssessment {
const indicators: string[] = [];
let level: CrisisAssessment['level'] = 'none';
if (hasPrimaryIndicators(messageContent)) {
level = 'critical';
indicators.push('primary_risk_detected');
}
if (hasSecondaryIndicators(messageContent)) {
level = level === 'none' ? 'high' : level;
indicators.push('secondary_risk_detected');
}
if (hasWorseningPattern(userCheckInHistory)) {
level = level === 'none' ? 'medium' : level;
indicators.push('worsening_trend');
}
if (hasEscalatingDistress(conversationHistory)) {
level = level === 'none' ? 'medium' : level;
indicators.push('escalating_distress');
}
return {
level,
indicators,
recommendedAction: getRecommendedAction(level),
timestamp: new Date(),
};
}
Tiered Response Protocol
Level 1: Continue Conversation (No Crisis)
Normal AI coaching interaction.
Level 2: Gentle Check-In (Low Risk)
const gentleCheckInResponse = `
I want to make sure I understand how you're feeling.
It sounds like you're going through a difficult time.
Would you like to:
- Talk more about what's on your mind?
- Try a grounding exercise together?
- Look at some coping strategies?
I'm here to listen.
`;
Level 3: Safety Resources (Medium Risk)
const safetyResourcesResponse = `
I hear that you're struggling, and I want you to know that support is available.
Here are some resources that might help:
📞 988 Suicide & Crisis Lifeline: Call or text 988
💬 Crisis Text Line: Text HOME to 741741
🌐 SAMHSA Helpline: 1-800-662-4357
Would you like to talk about what's going on, or would connecting with one of these resources feel right?
`;
Level 4: Crisis Protocol (High Risk)
const crisisProtocolResponse = `
I'm concerned about what you've shared, and I want to make sure you're safe.
Right now, I'd like you to consider reaching out to someone who can help:
🆘 If you're in immediate danger: Call 911
📞 988 Suicide & Crisis Lifeline: Call or text 988 (24/7)
💬 Crisis Text Line: Text HOME to 741741
These are trained counselors who understand what you're going through.
Is there someone you trust - a friend, family member, or sponsor - who you could reach out to right now?
I'm still here with you.
`;
Level 5: Emergency Escalation (Critical)
const emergencyResponse = `
I'm very concerned about your safety right now.
🆘 Please call 911 or go to your nearest emergency room immediately.
If you can't do that, please call 988 right now - they can help.
Your life matters. Please reach out for help right now.
[EMERGENCY CONTACTS DISPLAYED]
`;
Implementation in Chat Handler
export async function handleChatMessage(
message: string,
conversationId: string,
userId: string
): Promise<ChatResponse> {
const crisisAssessment = await assessCrisisLevel(
message,
await getConversationHistory(conversationId),
await getUserCheckIns(userId, 7)
);
await logCrisisAssessment(userId, conversationId, crisisAssessment);
if (crisisAssessment.level === 'critical') {
await notifyEmergencyContact(userId);
await flagForHumanReview(conversationId, 'critical_crisis');
return {
message: emergencyResponse,
showEmergencyContacts: true,
disableChat: true,
crisisLevel: 'critical',
};
}
if (crisisAssessment.level === 'high') {
await flagForHumanReview(conversationId, 'high_risk');
return {
message: crisisProtocolResponse,
showCrisisResources: true,
crisisLevel: 'high',
};
}
const systemPrompt = getSystemPromptWithSafetyContext(crisisAssessment);
const aiResponse = await generateAIResponse(message, systemPrompt);
const safeResponse = await validateResponseSafety(aiResponse);
return {
message: safeResponse,
crisisLevel: crisisAssessment.level,
};
}
Safety Resources Database
export const crisisResources = {
national: [
{
name: '988 Suicide & Crisis Lifeline',
phone: '988',
text: '988',
url: 'https://988lifeline.org',
available: '24/7',
description: 'Free, confidential crisis support',
},
{
name: 'Crisis Text Line',
text: 'HOME to 741741',
url: 'https://www.crisistextline.org',
available: '24/7',
description: 'Text-based crisis support',
},
{
name: 'SAMHSA National Helpline',
phone: '1-800-662-4357',
url: 'https://www.samhsa.gov/find-help/national-helpline',
available: '24/7',
description: 'Substance abuse and mental health referrals',
},
],
recovery: [
{
name: 'AA Hotline',
phone: '1-800-839-1686',
url: 'https://www.aa.org',
description: 'Alcoholics Anonymous support',
},
{
name: 'NA Helpline',
phone: '1-818-773-9999',
url: 'https://na.org',
description: 'Narcotics Anonymous support',
},
],
specialized: [
{
name: 'Veterans Crisis Line',
phone: '988 (press 1)',
text: '838255',
description: 'For veterans and service members',
},
{
name: 'Trevor Project',
phone: '1-866-488-7386',
text: 'START to 678-678',
description: 'LGBTQ+ youth crisis support',
},
],
};
Emergency Contact System
export async function notifyEmergencyContact(userId: string): Promise<void> {
const contacts = await getEmergencyContacts(userId);
if (contacts.length === 0) {
await logCrisisEvent(userId, 'no_emergency_contact');
return;
}
const primaryContact = contacts[0];
await sendEmergencyNotification(primaryContact, {
type: 'crisis_alert',
message: `${userName} may be in crisis and could use your support. ` +
`Please reach out to them if you can.`,
});
await logCrisisEvent(userId, 'emergency_contact_notified', {
contactId: primaryContact.id,
});
}
Safety Guardrails for AI
const safetySystemPrompt = `
CRITICAL SAFETY INSTRUCTIONS:
1. You are NOT a therapist or crisis counselor
2. For ANY mention of self-harm, suicide, or harming others:
- Express genuine concern
- Provide crisis resources (988, Crisis Text Line)
- Encourage professional help
- Do NOT attempt to counsel through crisis
3. Never minimize feelings or use toxic positivity
4. Never promise confidentiality about safety concerns
5. Always validate emotions while encouraging professional support
6. If user mentions relapse, acknowledge and provide SAMHSA helpline
`;
async function validateResponseSafety(response: string): Promise<string> {
const unsafePatterns = [
/don't (call|reach out|get help)/i,
/you don't need (help|therapy|a professional)/i,
/just (think positive|be happy|get over it)/i,
/it's not that (bad|serious)/i,
];
for (const pattern of unsafePatterns) {
if (pattern.test(response)) {
await flagForReview('unsafe_response_pattern');
return getSafeFallbackResponse();
}
}
return response;
}
Audit & Compliance
export async function logCrisisEvent(
userId: string,
eventType: CrisisEventType,
details?: Record<string, unknown>
): Promise<void> {
await db.insert(crisisEvents).values({
id: generateId(),
userId,
eventType,
details: JSON.stringify(sanitizeDetails(details)),
createdAt: new Date(),
reviewed: false,
});
if (isCriticalEvent(eventType)) {
await notifyOnCallStaff(userId, eventType);
}
}
Testing Crisis Features
describe('Crisis Detection', () => {
it('detects high-risk indicators', () => {
const result = assessCrisisLevel(
'[TEST_HIGH_RISK_INDICATOR]',
[],
[]
);
expect(result.level).toBe('high');
});
it('provides appropriate resources', () => {
const response = getCrisisResponse('high');
expect(response).toContain('988');
expect(response).toContain('Crisis Text Line');
});
});
References