Technical doc 32.16.1.15. Surfaces in
@kuanyin/dharma-analytics(safety-protocols.ts,crisis-intervention.ts) and@kuanyin/community-harmony(raid-defense.ts,post-incident-healing.ts).
Incidents fall into three families: safety crises (a person at risk), coordinated attacks (raids/brigading), and system incidents (outages, SLA breaches). The first two are unique to Kuan Yin and take priority.
Safety crises (P1)#
- Detect —
crisis-intervention.tsscores crisis state beyond keywords (plan + means weighted, protective factors lower it) and recognises indirect ideation. - Escalate —
escalateCrisis({ type, hasImmediateRisk })routes tocrisis_team/human_moderator;requiresHumanNowforces immediate human contact for life-safety types. - Resource — deliver region-aware helpline resources
(
getSelfHarmResources, 50-country registry) and victim support (getVictimSupportResources). - Consent-gated contact —
emergencyContactProtocolnotifies a contact only with consent (imminent risk overrides);lawEnforcementLiaisonengages with a high bar and evidence hashing. - Comply —
mandatoryReporthandles Tarasoff/CPS/CSAM→NCMEC obligations. - Follow up — acuity-scaled check-ins and continuity-of-care documentation.
Coordinated attacks (P1/P2)#
- Detect —
raid-defense.ts:detectTrafficSpike,detectNewAccountFlood,detectCoordinatedMessaging,detectCrossPlatformCoordination,analyzeTimingPatterns,identifySourceCommunity. - Defend —
activateDefenseMode,throttleNewUsers,restrictPosting,enableTrustedOnlyMode. - Document —
documentRaidcaptures evidence for platform reporting. - Heal —
post-incident-healing.ts: community check-in, affected-user outreach, healing circles, trust rebuilding, recovery tracking.
System incidents#
Follow standard SRE practice — but Kuan Yin's degradation must fail safe:
under load, degradationPlan sheds deep analysis and non-critical traffic while
preserving the protection hot path. An outage must never silently disable
shields; if protection cannot run, default to the most protective posture and
queue content for human review rather than letting it through.
Emergency shutdown#
triggerEmergencyShutdown({ scope, reason, at }) (scope: feature /
community / platform) is the kill switch; getShutdownState and
liftEmergencyShutdown manage the lifecycle. Use the narrowest scope that
contains the incident.
Post-incident#
Reconstruct the timeline with event replay (05-event-system.md) and
reconstructForensicTimeline; write a blameless retro; feed lessons into policy
(post-incident-healing policy-improvement) and the model evaluation suite as
new edge cases.