Sovereign Chat Safety Protocol

Source-available, sovereign safety infrastructure for AI chat — for apps, workplaces, education, and communities. It monitors both the user and the AI's own responses for crisis, hate, and threats, and escalates to the human in charge. Zero tracking, local by design.

34
Countries
67
Resources
647
Tests
0
Permissions
Get Help Now Open Full Demo Partner Overview View on GitHub Donate via PayPal Buy Me a Coffee

What is SafeChat?

An all-round, sovereign safety layer that watches both sides of an AI conversation — the user and the model — for crisis, hate, and threats, and connects a human when it matters. Built around privacy, ethics, and local control.

Free Forever

Crisis Detection

Regex-based detection runs locally on the device. No API calls. No data leaves the user. Catches misspellings, text-speak, negation variants, indirect warning signs, passive suicidality, and source-linked reviewed signal families. False-positive guards filter figurative language.

New Direction

AI Output Oversight

The same local detection runs on any text — including the model's own responses, not just the user's messages. Monitor your chatbot's output for unsafe, harmful, or off-policy content and escalate it to the human in charge. Sovereign oversight for any LLM you deploy.

v1.3

Reviewed Signal Pack

Evidence-linked local trigger families informed by C-SSRS, CLPsych, eRisk, VERA-MH, MindGuard, MentalLLaMA, and MentalChat16K. VERA-MH's public risk presentations inform regression design, not a claim that it validates SafeChat.

Free Forever

Geo-Location (No GPS)

Finds the user's country from timezone and locale alone. No permissions needed. 7-layer cascade ensures a match. Works offline from cached data.

Free Forever

Maintained Helpline Database

67 resource records across 34 countries, providing 94 phone, text, chat, email, WhatsApp, and web contact methods. Automated structural and chat-link checks are scheduled twice monthly; service details require human verification. CC0 public domain data.

v1.1

Subtle Signal Accumulation

Tracks 45 patterns across 17 categories. Each contextual signal contributes a transparent routing weight of 1-3; combined weight 4 triggers LOW routing and 8 triggers HIGH. These are deterministic thresholds, not a clinical risk score. Message text is never stored.

Developer Tool

Configurable Shield

Drop-in safety layer with 6 response modes (interrupt, inject, flag, log, callback, none) and 6 presets (companion, chatbot, moderation, strict, shadow, museum). Route to a verified helpline, human moderator, teacher, workplace support, or your own escalation path. One line of code.

Developer Tool

AI Prompt Override

Generates system prompt injections that tell your LLM to stop normal behavior and show crisis resources. Works with any AI provider.

Moderation

Hate Speech and Threat Routing

Flags hate, targeted abuse, threats, and harassment separately from crisis support, so a platform can manage harmful chat without treating every safety issue as a mental-health event.

Sovereign

Privacy by Design

SafeChat can run locally, offline, or inside an organisation's own environment. The default posture is data minimisation: act on safety signals without centralising private conversations.

Developer Tool

Drop-in UI Components

Modal, banner, and full-page popup. One script tag. Auto-monitors inputs. Offline-capable PWA. Native device links for call, text, WhatsApp, email.

v1.2

Cross-Classifier (ML Layer)

Optional second-opinion layer using local ML models (MindGuard, MentalLLaMA) alongside the regex engine. Catches nuanced distress that keyword matching can miss. Everything runs locally. Never downgrades a regex detection.

v1.3

Semantic Layer (Embedding Tier)

Optional embedding-similarity tier light enough for phones and offline PWAs (~25 MB models). Catches metaphorical distress like "I just want the noise to stop" by comparing messages to curated exemplar phrases. Confirms or escalates, never downgrades.

Standard

Safety-Oriented

Designed to support crisis-routing implementations and informed by VERA-MH and Samaritans guidance. SafeChat is not itself a compliance certification or clinical validation.


How the Evidence Was Applied

SafeChat converts published risk concepts into transparent, source-attributed software controls. It does not copy sensitive research datasets into the product.

1. Review

Identify observable signal families

Published methods, risk taxonomies, and permitted public examples from C-SSRS, CLPsych, eRisk, VERA-MH, MindGuard, MentalLLaMA, and MentalChat16K were reviewed for observable language and multi-turn context.

2. Translate

Build auditable local rules

Relevant concepts were translated into source-linked trigger families, false-positive guards, and transparent session categories. Every reviewed rule records its source, family, rationale, and routing level.

3. Challenge

Run engineering regression tests

Rules are tested against direct examples, paraphrases, misspellings, indirect wording, multi-turn accumulation, and benign controls. The current suite contains 647 automated tests across server and browser paths.

4. Audit

Inspect public VERA-MH coverage

All 100 public final VERA-MH seed phrases were inspected to identify missing observable families and contextual categories. This was a coverage audit, not a sensitivity, specificity, or clinical-validation study.


International Chat Safety Registry

Verified frameworks, standards, and tools for AI chat safety. Open for submissions from developers and health professionals.

Name Type Org Focus Status
SafeChat Toolkit FAMTEC Crisis detection, geo-routing, helpline DB Active
VERA-MH Evaluation Spring Health AI safety evaluation for mental health, suicide risk detection validation Active
EmoAgent Framework Research Multi-agent safeguard for AI-human mental health interaction Active
MindGuard Toolkit Sword Health Open-source 4B/8B safety classifiers for mental health AI conversations Active
MentalLLaMA Toolkit Research Open-source LLMs for interpretable mental health analysis (7B/13B) Active
MentalChat16K Dataset Research Benchmark dataset for conversational mental health assistance (KDD 2025) Active
Find A Helpline Directory ThroughLine Global helpline directory, 175+ countries, API available Active
IASP Crisis Centres Directory IASP / WHO International crisis centre and helpline registry Active
International Council for Helplines Standards ICH Quality standards and best practices for helpline services Active
Lifeline International Network Lifeline Intl Global network of crisis centres and suicide prevention Active
Samaritans Guidelines Standards Samaritans Safe messaging guidelines for media and technology Active

Know a framework, standard, or tool that should be listed? Submit via GitHub Discussions or email rob@fineartmedia.tech.


Full Demo

The Detection Inspector is the main demo. It shows crisis signals, hate-speech and threat moderation, subtle multi-turn accumulation, source-linked rationale, and the live routing state. Detection runs locally in your browser.

Try different scenarios and watch the routing state change. The inspector makes SafeChat transparent: what it matched, why it matched, whether the signal is crisis support or moderation, and whether the system should stay quiet, show resources, alert a human, or follow a custom policy.

Choose SafeChat's Job

SafeChat is not locked to one use case. You choose what job it performs by selecting the scenario, trigger families, response mode, escalation path, and privacy boundary.

Crisis Support

Route distress to help

Use this when the priority is self-harm, suicidal ideation, acute distress, or repeated subtle signals over time.

Job: detect distress and show local resources. Route: crisis popup, helpline, trusted human, or clinical pathway. Privacy: do not store message text by default.
Moderation

Manage hate, abuse, and threats

Use this when the platform needs to identify harmful chat without confusing abuse moderation with mental-health support.

Job: flag hate speech, harassment, and targeted threats. Route: moderator queue, warning, block, callback, or audit flag. Privacy: store only the minimum evidence your policy requires.
Education

Support students without spying

Use this for schools, universities, and learning tools where private student conversations should not become surveillance data.

Job: detect support needs, bullying risk, or escalation points. Route: student wellbeing, safeguarding, or crisis support. Privacy: keep routine conversation private; escalate only clear triggers.
Workplace

Duty of care without surveillance

Use this for employee tools, internal copilots, and workplace chat where trust matters as much as risk management.

Job: recognise distress, threats, or harmful conduct. Route: EAP, HR policy, manager escalation, or anonymous support. Privacy: local or sovereign deployment with transparent retention rules.
AI Companion

Interrupt unsafe AI behaviour

Use this when a chatbot must stop normal replies and move into a safer support flow when risk appears.

Job: override unsafe continuation and inject safer instructions. Route: resources, human support, custom callback, or no automated reply. Privacy: run on-device or inside the host app boundary.
Sovereign

Run under local control

Use this when the organisation cannot or should not send sensitive chat to external safety APIs.

Job: local safety classification and routing. Route: internal support systems, local helplines, or offline PWA. Privacy: no routine central collection of private conversation text.

Download Pack

Everything you need to add crisis safety to your app. Free. No account required.

Install as App (PWA)

iPhone/iPad: Open popup.html in Safari → tap Share → "Add to Home Screen"

Android: Open in Chrome → tap menu → "Install App" or "Add to Home Screen"

Desktop: Open in Chrome/Edge → click install icon in address bar

Open Crisis Popup

Browser Bundle

Single JS file. Drop into any page. Auto-monitors inputs.

Download browser.js

Embed Script

One-line script tag. Auto-detects and shows crisis modal.

Download embed.js

Crisis Popup (PWA)

Offline-capable popup. Installable. Native device links.

Open PWA

Helpline Database

34 countries, 67 resource records, 94 contact methods. JSON format. CC0 public domain.

Download JSON

Community

A space for developers, health professionals, and researchers to discuss AI chat safety.


Why This Matters Now

The regulatory landscape is changing. AI chat safety is no longer optional.

Law

New York AI Companion Law

First US law mandating crisis-response protocols for AI companions. Requires detection of suicidal ideation, referrals to crisis services, and disclosure of AI's non-human nature.

Regulation

FTC Chatbot Inquiry

FTC formally investigating AI companion safety measures across Alphabet, Meta, OpenAI, Snap, xAI, and Character Technologies. Duty of care standards for emotionally responsive AI.

Research

VERA-MH Findings (2026)

Clinically grounded, open-source evaluation for AI mental health safety. SafeChat provides local detection and human-care routing relevant to parts of its rubric, but has not yet been evaluated or scored with VERA-MH.


Ongoing Development

SafeChat is under continuous, active development. Every change is tested, timestamped, and publicly documented.

False negatives are treated as critical defects. Automated resource checks are scheduled twice monthly, with human verification still required for service details. The test suite (currently 647 automated tests) must pass before every release. Detection patterns are reviewed against published clinical literature. A public CHANGELOG and full git history document every improvement.

Expert guidance being incorporated. SafeChat is incorporating feedback from Professor Stevie Chancellor and public work such as VERA-MH, MindGuard, MentalLLaMA, and MentalChat16K. The cross-classifier module integrates local ML models like MindGuard and MentalLLaMA alongside the regex engine to catch nuanced distress that keyword matching can miss, without presenting this as a research partnership or clinical validation.