Mental health assessment AI · Crisis support AI · Teletherapy session AI · Clinical documentation AI

Prompt injection in mental health and digital health AI

Mental health and digital health AI has become the operational backbone of behavioural health assessment, crisis intervention triage, teletherapy session monitoring, and clinical documentation management across employer-sponsored mental health benefit programmes, digital therapeutic platforms, and integrated behavioural health networks at a scale that concentrates HIPAA 45 CFR Part 164 protected health information obligations, APA Ethics Code professional duty-to-warn requirements, Tarasoff v. Regents of the University of California duty-to-warn liability, Mental Health Parity and Addiction Equity Act MHPAEA 29 USC §1185a parity compliance obligations, and Joint Commission NPSG.15.01.01 suicide risk reduction National Patient Safety Goal requirements in AI systems that process patient mental health assessment images and crisis support interaction data at operational throughputs that make individual clinician review of every assessment frame impracticable: Spring Health AI has deployed AI-assisted mental health assessment and care navigation tools to more than 1,000 employer customers covering millions of employees globally — processing patient-submitted affect and mental state photographs and PHQ-9 depression severity assessment response images through AI-assisted severity classification, care pathway matching, and clinical escalation determination tools that determine whether a patient’s depression severity rating meets the threshold for urgent clinical outreach or crisis intervention under employer mental health benefit protocols and Joint Commission NPSG.15.01.01 suicide risk reduction standards; Lyra Health AI has deployed AI-assisted mental health assessment and therapist matching tools to employer benefit programmes covering millions of employees including global enterprise customers across financial services, technology, and healthcare sectors, processing patient mental state and therapeutic progress assessment images through AI-assisted clinical severity classification, therapist-patient matching, and care intensity escalation tools with HIPAA, APA Ethics Code, and MHPAEA clinical necessity determination dimensions; Ginger AI (now Headspace Health) deploys AI-assisted mental health coaching and crisis support tools at employer benefit programmes and health plan coverage customers, processing patient-submitted affect assessment images and crisis support interaction screenshots through AI-assisted mental health severity classification and crisis escalation determination tools; Woebot Health AI deploys conversational AI-assisted cognitive behavioural therapy and mental health support tools at consumer and employer benefit deployments, processing user interaction and mood assessment images through AI-assisted mood severity classification and clinical escalation determination tools with Joint Commission and clinical safety dimensions; Talkspace AI deploys AI-assisted teletherapy matching and session support tools at consumer and employer benefit programme deployments, processing teletherapy session interface images and patient clinical documentation photographs through AI-assisted therapist-patient matching and clinical documentation management tools with HIPAA and APA Ethics Code dimensions; BetterHelp AI deploys AI-assisted therapist matching and teletherapy support at consumer deployments, processing patient intake and session management interface images through AI-assisted clinical matching tools; and Crisis Text Line AI deploys AI-assisted crisis text support and suicidal ideation risk classification tools at national crisis intervention service operations, processing crisis support conversation interface screenshots through AI-assisted crisis severity classification, suicidal ideation risk scoring, and 988 Lifeline escalation determination tools with Tarasoff duty-to-warn, Joint Commission NPSG.15.01.01, and 988 Lifeline response protocol dimensions of exceptional patient safety severity. Each of these mental health and digital health AI platform shares a structural vulnerability that creates adversarial image injection exposure with direct patient safety, duty-to-warn liability, HIPAA compliance, and clinical crisis intervention consequence severity: they depend on patient affect photographs, assessment response images, and crisis support interface screenshots that pass through AI processing layers before their output governs clinical severity determinations, crisis escalation decisions, therapist intervention triggers, and suicidal ideation risk classifications — and they operate under regulatory and clinical frameworks where AI output manipulation creates Tarasoff duty-to-warn liability, HIPAA PHI breach exposure, Joint Commission NPSG.15.01.01 non-compliance, and MHPAEA clinical necessity parity obligation consequences of exceptional safety severity.

TL;DR

Mental health and digital health AI platforms — Spring Health AI, Lyra Health AI, Ginger AI (Headspace Health), Woebot AI, Talkspace AI, BetterHelp AI, Crisis Text Line AI, SilverCloud Health AI (Amwell) — process patient affect and mental state assessment photographs, teletherapy session video frames, crisis support conversation interface screenshots, and clinical documentation images through AI-assisted PHQ-9 severity classification, suicidal ideation risk scoring, therapist clinical escalation, and crisis intervention triage pipelines. Adversarially crafted images submitted through Spring Health or Lyra Health patient assessment photograph interfaces, Woebot or Ginger mood assessment image channels, Crisis Text Line crisis support session screenshot streams, and Talkspace teletherapy session interfaces can cause AI systems to suppress PHQ-9 depression severity indicators, conceal suicidal ideation risk classifications, hide clinical deterioration markers that would trigger therapist escalation, and mask crisis severity assessments that would initiate 988 Lifeline emergency response — triggering HIPAA 45 CFR Part 164 PHI breach exposure, APA Ethics Code 3.06 duty-to-warn obligations, Tarasoff v. Regents common law duty-to-warn liability, MHPAEA 29 USC §1185a parity compliance consequences, and Joint Commission NPSG.15.01.01 suicide risk reduction standard violations. Glyphward scans each image at the ingestion boundary with a threshold of ≥ 50 for crisis support and suicidal ideation risk AI and ≥ 50 for mental health assessment AI. Free tier — 10 scans/day, no card required.

Four adversarial injection surfaces in mental health and digital health AI

1. Mental health assessment photograph injection (Spring Health AI, Lyra Health AI)

Mental health assessment photograph AI processes patient affect and mental state self-assessment photographs from Spring Health AI at more than 1,000 employer customers covering millions of employees globally, Lyra Health AI employer benefit programme deployments at global enterprise customers across financial services, technology, and healthcare sectors, Ginger AI (Headspace Health) employer benefit and health plan coverage programme deployments, and SilverCloud Health AI (Amwell) digital therapeutic platform deployments, extracting depression and mental health severity classifications — PHQ-9 symptom severity score indicators, anxiety severity assessment ratings, emotional distress presentation markers, clinical deterioration risk flags — from patient-submitted affect and mental state photograph inputs in AI-assisted mental health assessment pipelines, generating clinical care pathway recommendations, therapist escalation triggers, urgent outreach notifications, and MHPAEA-compliant clinical necessity determinations that employer benefit programme administrators and clinician care teams depend upon for timely mental health crisis intervention and HIPAA-compliant patient care management. Spring Health AI’s assessment photograph AI is a primary AI-assisted severity classification mechanism for employer benefit programme mental health care navigation at scale; its patient assessment photograph AI processes PHQ-9 and GAD-7 equivalent symptom severity assessment inputs through AI-assisted severity classification tools that determine whether a patient’s current symptom presentation meets the threshold for urgent clinical outreach, crisis intervention referral, or standard care pathway assignment under MHPAEA-compliant clinical necessity criteria and employer benefit programme mental health care escalation protocols. Joint Commission NPSG.15.01.01 (Suicide Risk Reduction) specifies that accredited healthcare organisations implement evidence-based processes for identifying patients at risk for suicide; AI-assisted mental health assessment photograph severity classification that feeds clinical escalation decisions in Joint Commission-accredited employer health programme contexts creates NPSG.15.01.01 compliance dimensions when AI severity output governs whether patients presenting with PHQ-9 severe depression indicators receive timely crisis intervention.

The adversarial injection surface is the patient mental health assessment photograph submission pathway: Spring Health AI or Lyra Health AI patient affect and mental state assessment photographs submitted through AI-assisted PHQ-9 severity classification, emotional distress presentation assessment, and clinical care pathway escalation tools for AI depression severity identification and clinical intervention trigger determination. An adversarially crafted Spring Health AI mental health assessment photograph — in which pixel perturbations applied to the patient affect presentation visual markers, the emotional distress expression region, or the clinical deterioration indicator display in a patient self-assessment photograph cause the AI to classify a patient presenting with PHQ-9 severe depression symptom indicators as meeting only mild symptom severity criteria falling below the clinical escalation threshold when the actual photograph documents a patient affect presentation meeting PHQ-9 severe depression criteria requiring urgent clinical outreach — can suppress a clinical escalation trigger that would otherwise generate an urgent care team notification, a crisis intervention referral, and a MHPAEA-compliant clinical necessity documentation record. In employer benefit programme deployments where Spring Health AI or Lyra Health AI processes thousands of patient self-assessment photograph submissions per day across large enterprise employer benefit populations without individual clinician review of each AI severity classification, adversarial suppression of PHQ-9 severe depression severity classifications allows patients in clinical crisis to be routed to standard care pathways without the urgent clinical intervention that their actual presentation requires, with Tarasoff duty-to-warn and Joint Commission NPSG.15.01.01 consequences when the suppressed crisis assessment delays clinical intervention.

The regulatory and duty-to-warn consequences of adversarially suppressed mental health severity classification in assessment photograph AI span HIPAA, APA Ethics Code, Tarasoff common law, MHPAEA, and Joint Commission NPSG dimensions. HIPAA 45 CFR §164.530(c) requires covered entities to implement policies and procedures that protect PHI and ensure the accuracy of clinical information used for treatment decisions; adversarially manipulated mental health assessment photograph AI that generates inaccurate PHQ-9 severity classifications used in patient care pathway determination creates HIPAA §164.530(c) clinical information accuracy obligation exposure when the adversarially corrupted assessment record becomes part of the patient’s HIPAA-protected treatment record. APA Ethics Code 4.05(b) permits psychologists to disclose confidential information to protect an identified third party from a serious and imminent threat; Tarasoff v. Regents of the University of California (1976) 17 Cal. 3d 425 established a common law duty for mental health clinicians to warn identified potential victims when a patient presents a serious and credible threat of harm. Adversarial suppression of Spring Health AI or Lyra Health AI mental health severity classification that prevents the AI-assisted assessment tool from generating the crisis severity indicator that would trigger a clinician Tarasoff review creates a duty-to-warn liability exposure when the suppressed severity classification delays clinician awareness of a patient risk presentation that, if accurately classified, would have triggered a duty-to-warn evaluation. Threshold: 50 for mental health assessment photograph AI — reflecting the Tarasoff duty-to-warn liability, HIPAA PHI clinical accuracy, MHPAEA clinical necessity, and Joint Commission NPSG.15.01.01 suicide risk reduction dimensions of suppressed mental health severity classification.

2. Crisis support interface screenshot injection (Crisis Text Line AI, Woebot AI)

Crisis support interface screenshot AI processes crisis text support conversation interface screenshots from Crisis Text Line AI at national crisis intervention service operations providing 24/7 crisis text-based support under the 988 Suicide and Crisis Lifeline national network, Woebot Health AI conversational AI mental health and crisis support platform at consumer and employer benefit deployments, Ginger AI (Headspace Health) crisis escalation tool at employer benefit and health plan programme deployments, and integrated digital mental health platform crisis support AI tools, extracting crisis severity classifications — suicidal ideation risk scores, self-harm intent probability assessments, crisis severity level determinations, emergency response protocol trigger indicators — from crisis support conversation interface screenshot inputs in AI-assisted crisis triage and escalation pipelines, generating crisis counsellor intervention alerts, 988 Lifeline emergency response escalation triggers, emergency services dispatch notifications, and joint crisis intervention team coordination records that crisis intervention organisations and clinical teams depend upon for timely suicidal crisis intervention and Joint Commission NPSG.15.01.01 suicide risk reduction standard compliance. Crisis Text Line AI’s crisis support AI processes more than 6 million crisis text conversations through AI-assisted crisis severity classification and counsellor matching tools that determine which conversations receive priority counsellor assignment, crisis severity escalation, and emergency services notification under 988 Lifeline response protocols and Joint Commission NPSG.15.01.01 suicide risk assessment requirements. The 988 Suicide and Crisis Lifeline national network established by SAMHSA under 34 USC §290bb-36b specifies crisis intervention response protocols that include suicidal ideation risk triage, active rescue protocol implementation, and emergency services coordination; AI-assisted crisis support interface screenshot severity classification tools that feed 988 Lifeline counsellor triage and emergency response escalation decisions operate within the federal crisis intervention framework where AI output accuracy directly affects whether individuals in suicidal crisis receive timely emergency response.

The adversarial injection surface is the crisis support conversation interface screenshot submission pathway: Crisis Text Line AI or Woebot AI crisis support conversation session interface screenshots submitted through AI-assisted suicidal ideation risk classification, crisis severity level determination, and 988 Lifeline emergency response protocol trigger tools for AI crisis severity identification and crisis counsellor intervention assignment. An adversarially crafted Crisis Text Line AI crisis support interface screenshot — in which pixel perturbations applied to the suicidal ideation risk indicator display region, the crisis severity level marker, or the emergency response protocol trigger condition visual in a crisis support conversation interface screenshot cause the AI to classify a crisis conversation exhibiting suicidal ideation risk indicators meeting the 988 Lifeline active rescue protocol threshold as a standard-severity conversation meeting only routine counsellor support criteria when the actual screenshot documents crisis content meeting Joint Commission NPSG.15.01.01 high-risk classification criteria — can suppress a crisis severity escalation trigger that would otherwise generate a priority counsellor assignment, an emergency services dispatch notification, and a 988 Lifeline active rescue protocol implementation record. In high-volume crisis text support operations where Crisis Text Line AI processes thousands of concurrent crisis conversations per day across the national 988 Lifeline network without individual counsellor review of every AI severity triage result before priority assignment decisions, adversarial suppression of suicidal ideation risk severity classifications in crisis conversation screenshots allows individuals in acute suicidal crisis to be routed to standard counsellor queues without the priority crisis intervention response that their actual risk presentation requires, with catastrophic patient safety and 988 Lifeline protocol compliance consequences.

The patient safety and regulatory consequences of adversarially suppressed crisis severity classification in crisis support interface screenshot AI span Joint Commission NPSG.15.01.01, 988 Lifeline federal network response protocol, SAMHSA emergency services coordination, and Tarasoff common law duty-to-warn dimensions. Joint Commission NPSG.15.01.01 requires accredited hospitals and behavioural health organisations to implement evidence-based suicide risk assessment processes using validated suicide risk assessment tools; Crisis Text Line and integrated employer mental health benefit programme crisis support AI tools deployed in Joint Commission-accredited programme contexts create NPSG.15.01.01 compliance dimensions when AI-assisted crisis severity classification governs whether patients assessed through accredited programme crisis support interfaces receive timely suicide risk response. SAMHSA 988 Lifeline network participation requirements specify that network member crisis centre operations maintain crisis response capacity standards including suicidal ideation risk assessment and active rescue protocol implementation capability; adversarial manipulation of Crisis Text Line AI that suppresses suicidal ideation risk severity classifications in crisis conversation screenshots creates 988 Lifeline network participation standard compliance exposure when manipulated AI triage results systematically reduce active rescue protocol implementation rates. 42 USC §290bb-36b federal crisis intervention programme requirements specify federal funding compliance obligations for 988 Lifeline network member crisis centres; adversarially compromised crisis AI triage that reduces emergency response effectiveness creates federal programme participation obligation exposure with SAMHSA funding compliance dimensions. Threshold: 50 for crisis support interface screenshot AI — reflecting the patient life safety, Joint Commission NPSG.15.01.01, 988 Lifeline emergency response protocol, and Tarasoff duty-to-warn dimensions of suppressed crisis severity classification.

3. Teletherapy session video frame injection (Talkspace AI, BetterHelp AI)

Teletherapy session video frame AI processes therapist-patient teletherapy video session interface images and session monitoring frames from Talkspace AI at consumer and employer benefit programme teletherapy deployments covering millions of patients across the United States and international markets, BetterHelp AI at consumer teletherapy deployments representing the world’s largest online therapy platform with more than 3 million patients, SilverCloud Health AI (Amwell) digital therapeutic and teletherapy support programme tools, and integrated telehealth platform teletherapy AI session support tools, extracting session quality and clinical engagement classifications — therapeutic alliance indicator assessments, patient engagement and distress signal detections, session crisis emergence risk flags, and clinical note-assist content accuracy verifications — from teletherapy video session interface image inputs in AI-assisted teletherapy quality management and clinical support pipelines, generating therapist clinical alert notifications, supervisor escalation flags, session quality review triggers, and HIPAA-compliant clinical note documentation records that teletherapy platform clinical quality teams and therapist supervisors depend upon for AI-assisted teletherapy quality management and patient safety monitoring. Talkspace AI’s session monitoring AI processes teletherapy session quality indicators through AI-assisted therapeutic engagement and patient distress signal classification tools that generate therapist clinical support alerts and clinical supervisor escalation flags for sessions where AI-detected signals indicate patient safety risk or therapeutic quality concerns requiring clinical review. BetterHelp AI’s session management platform processes patient intake and teletherapy session matching interface images through AI-assisted clinical matching and session support tools at the world’s largest consumer teletherapy platform, where AI-assisted session quality monitoring and clinical note documentation support tools generate the clinical records that HIPAA-covered teletherapy providers maintain as treatment records with APA Ethics Code professional responsibility dimensions.

The adversarial injection surface is the teletherapy session video interface frame submission pathway: Talkspace AI or BetterHelp AI teletherapy video session interface screenshots and session monitoring frames submitted through AI-assisted patient engagement classification, crisis emergence detection, and clinical note documentation tools for AI therapeutic alliance assessment and patient safety signal identification. An adversarially crafted Talkspace AI teletherapy session video frame — in which pixel perturbations applied to the patient distress signal visual marker, the therapeutic engagement level indicator region, or the crisis emergence risk indicator display in a teletherapy session video interface frame cause the AI to classify a session exhibiting patient distress and crisis emergence signals meeting the clinical escalation threshold as a standard engagement session below the clinical alert threshold when the actual session frame documents patient distress indicators requiring therapist supervisor notification — can suppress a clinical alert that would otherwise generate a therapist supervisor escalation notification and a HIPAA-compliant clinical record entry documenting the patient distress signal and clinical response. In high-volume teletherapy session management environments where Talkspace AI or BetterHelp AI processes thousands of concurrent teletherapy session monitoring frames without individual clinical supervisor review of every AI session quality classification, adversarial suppression of patient distress signal detections and crisis emergence risk flags allows sessions with emerging patient safety risks to proceed without the clinical supervisor escalation that the patient’s actual session presentation requires.

The HIPAA and APA Ethics Code consequences of adversarially suppressed patient distress signal detection in teletherapy session video frame AI span HIPAA treatment record accuracy, APA Ethics Code professional supervision, Tarasoff duty-to-warn, and state telehealth practice standard dimensions. HIPAA 45 CFR §164.526 provides patients the right to amend PHI they believe to be inaccurate or incomplete; teletherapy session AI clinical note records that fail to document patient distress signals and clinical escalation events because adversarial image manipulation suppressed the AI detection that would have generated clinical note entries create HIPAA §164.526 PHI accuracy obligations when the adversarially incomplete session record is later accessed by the patient or a subsequent treating clinician. APA Ethics Code 2.05 requires licensed psychologists who delegate professional responsibilities to ensure that delegated functions are performed competently; teletherapy platform AI session monitoring tools that clinician supervisors rely upon for quality oversight of supervised therapist sessions create APA professional supervision responsibility dimensions when adversarial manipulation of session AI suppresses patient distress signals that responsible clinical supervision should have detected. State telehealth practice standards established by state licensing boards — including state-specific telehealth regulations for psychologists, licensed clinical social workers, and licensed professional counsellors — specify documentation standards for teletherapy session clinical records; adversarial suppression of Talkspace or BetterHelp AI session monitoring outputs that creates incomplete clinical documentation creates state telehealth practice standard compliance exposure with professional licensing consequences. Threshold: 50 for teletherapy session video frame AI — reflecting the HIPAA treatment record accuracy, APA Ethics Code professional supervision, Tarasoff duty-to-warn, and state telehealth practice standard dimensions of suppressed patient distress signal detection.

4. Clinical documentation photograph injection (SilverCloud AI, Quartet Health AI)

Clinical documentation photograph AI processes patient clinical documentation photographs, intake assessment form images, and treatment progress documentation photographs from SilverCloud Health AI (Amwell) at digital therapeutic and integrated behavioural health programme deployments, Quartet Health AI at integrated behavioural health and primary care coordination programme deployments, and integrated digital behavioural health platform clinical documentation management AI tools, extracting clinical documentation accuracy and completeness classifications — clinical assessment completion indicator verifications, treatment goal progress documentation accuracy flags, medication adherence documentation completeness markers, and HIPAA-compliant clinical record integrity verifications — from patient clinical documentation photograph and form image inputs in AI-assisted clinical documentation management pipelines, generating clinical record accuracy alerts, documentation completeness flags, and HIPAA-compliant clinical information management records that behavioural health programme administrators and compliance teams depend upon for HIPAA-compliant clinical record management and integrated care coordination quality assurance. SilverCloud Health AI’s clinical documentation AI processes patient intake assessment and treatment progress documentation photographs through AI-assisted clinical record completeness verification and documentation accuracy tools at integrated employer benefit and health plan digital therapeutic programme deployments where HIPAA-compliant clinical record management is required for covered entity and business associate agreement compliance. Quartet Health AI deploys integrated behavioural health and primary care coordination AI at health plan and provider organisation deployments, processing patient clinical documentation and integrated care coordination records through AI-assisted care gap identification and referral management tools with HIPAA, MHPAEA, and integrated care quality standard dimensions.

The adversarial injection surface is the patient clinical documentation photograph and form image submission pathway: SilverCloud AI or Quartet Health AI patient clinical intake, assessment, and treatment progress documentation photographs submitted through AI-assisted clinical record completeness verification, documentation accuracy assessment, and HIPAA-compliant clinical record management tools for AI clinical documentation integrity classification and integrated care coordination quality determination. An adversarially crafted SilverCloud AI clinical documentation photograph — in which pixel perturbations applied to the clinical assessment completion indicator display, the medication adherence documentation record, or the treatment progress milestone marker in a patient clinical documentation form photograph cause the AI to classify an incomplete or inaccurate clinical record as a complete and accurate HIPAA-compliant clinical documentation record when the actual photograph documents clinical record gaps requiring clinical staff follow-up and documentation completion — can suppress a documentation completeness flag that would otherwise generate a clinical staff follow-up notification and a HIPAA clinical record accuracy audit entry. In integrated digital behavioural health programme environments where SilverCloud AI or Quartet Health AI processes patient clinical documentation photographs across large employer benefit and health plan programme populations without individual clinician review of every AI documentation accuracy classification, adversarial suppression of clinical record completeness flags and documentation accuracy alerts allows incomplete or inaccurate clinical records to be accepted as HIPAA-compliant clinical documentation with integrated care coordination and MHPAEA parity audit consequences.

The HIPAA and MHPAEA consequences of adversarially suppressed clinical documentation accuracy classification in clinical documentation photograph AI span HIPAA PHI accuracy, MHPAEA parity audit, integrated care coordination quality, and state behavioural health programme licensing dimensions. HIPAA 45 CFR §164.310(d)(2)(iii) requires covered entities to implement procedures to ensure the accuracy of PHI stored in electronic information systems; adversarially manipulated SilverCloud AI or Quartet Health AI clinical documentation photograph AI that accepts incomplete or inaccurate clinical records as complete creates HIPAA §164.310(d)(2)(iii) PHI accuracy obligation exposure when adversarially accepted documentation inaccuracies affect patient treatment continuity in integrated care coordination programmes. MHPAEA 29 USC §1185a requires group health plans providing mental health or substance use disorder benefits to ensure that the financial requirements and treatment limitations applied to those benefits are no more restrictive than those applied to medical and surgical benefits; MHPAEA parity compliance audits by DOL and state insurance regulators examine clinical documentation of medical necessity determinations and treatment limitation application — adversarially corrupted Quartet Health AI clinical documentation that suppresses clinical record completeness flags creates MHPAEA parity audit record integrity exposure when documentation gaps affect the evidence base for MHPAEA parity compliance demonstration. State behavioural health programme licensing requirements specify clinical documentation standards for licensed behavioural health programmes; adversarially manipulated clinical documentation AI that accepts incomplete clinical records as compliant creates state behavioural health programme licensing inspection findings with programme licence renewal consequences. Threshold: 50 for clinical documentation photograph AI — reflecting the HIPAA PHI accuracy, MHPAEA parity audit, integrated care coordination quality, and state behavioural health programme licensing dimensions of suppressed clinical documentation accuracy classification.

Integration: mental health and digital health AI image ingestion with Glyphward pre-scan

Mental health and digital health AI image ingestion flows from Spring Health and Lyra Health patient mental health assessment photograph APIs, Crisis Text Line and Woebot crisis support conversation interface screenshot channels, Talkspace and BetterHelp teletherapy session video frame interfaces, and SilverCloud and Quartet Health clinical documentation photograph platforms into PHQ-9 severity and mental health assessment AI, suicidal ideation risk and crisis triage AI, teletherapy session quality and patient distress signal AI, and clinical documentation accuracy and HIPAA compliance AI pipelines. Insert Glyphward’s pre-scan at the ingestion boundary before AI-generated output is committed to mental health severity escalation triggers, crisis counsellor intervention assignments, teletherapy session clinical alerts, or clinical documentation accuracy records:

import asyncio
import base64
import hashlib
import os
import uuid
from enum import Enum
from pathlib import Path

import httpx

GLYPHWARD_API_KEY = os.environ["GLYPHWARD_API_KEY"]
GLYPHWARD_SCAN_URL = "https://glyphward.com/v1/scan"

# Mental health & digital health AI — HIPAA 45 CFR Part 164; APA Ethics
# Code 4.05(b) duty-to-warn; Tarasoff v. Regents common law duty-to-warn;
# MHPAEA 29 USC §1185a; Joint Commission NPSG.15.01.01; 34 USC §290bb-36b
# 988 Lifeline. Suppression of severity classification and crisis escalation
# creates duty-to-warn liability and patient life safety consequences.
THRESHOLD_ASSESSMENT_AI       = 50  # Spring Health/Lyra; PHQ-9; duty-to-warn
THRESHOLD_CRISIS_AI           = 50  # Crisis Text Line/Woebot; NPSG.15.01.01; 988
THRESHOLD_TELETHERAPY_AI      = 50  # Talkspace/BetterHelp; APA supervision; HIPAA
THRESHOLD_CLINICAL_DOCS_AI    = 50  # SilverCloud/Quartet; HIPAA §164.310; MHPAEA


class MentalHealthAIContext(str, Enum):
    ASSESSMENT_AI     = "assessment_ai"      # Spring Health, Lyra — PHQ-9 severity
    CRISIS_AI         = "crisis_ai"          # Crisis Text Line, Woebot — ideation risk
    TELETHERAPY_AI    = "teletherapy_ai"     # Talkspace, BetterHelp — session quality
    CLINICAL_DOCS_AI  = "clinical_docs_ai"  # SilverCloud, Quartet — record accuracy


def threshold_for(context: MentalHealthAIContext) -> int:
    return 50  # all surfaces: patient life safety


async def scan_mental_health_ai_image(
    image_path: str | Path,
    context: MentalHealthAIContext,
    programme_id_hash: str,     # SHA-256 of employer benefit programme or org ID
    patient_session_ref: str,   # e.g. "SPH-SESS-2026-88841", "CTL-CONV-44928"
    assessment_id: str,         # assessment or clinical session identifier
    client: httpx.AsyncClient,
) -> dict:
    """
    Scan a mental health or digital health AI image for adversarial injection
    payloads before forwarding to PHQ-9 severity assessment, crisis suicidal
    ideation risk classification, teletherapy session quality monitoring, or
    clinical documentation accuracy AI systems.

    Raises AdversarialMentalHealthAIImageError if score meets threshold:
      - ASSESSMENT_AI:    threshold 50; HIPAA §164.530(c); Tarasoff; MHPAEA
      - CRISIS_AI:        threshold 50; NPSG.15.01.01; 988 Lifeline; §290bb-36b
      - TELETHERAPY_AI:   threshold 50; HIPAA §164.526; APA Ethics 2.05; state
      - CLINICAL_DOCS_AI: threshold 50; HIPAA §164.310; MHPAEA parity audit
    """
    image_bytes      = Path(image_path).read_bytes()
    image_b64        = base64.b64encode(image_bytes).decode()
    image_sha256     = hashlib.sha256(image_bytes).hexdigest()
    client_scan_id   = str(uuid.uuid4())
    threshold        = threshold_for(context)

    resp = await client.post(
        GLYPHWARD_SCAN_URL,
        headers={"Authorization": f"Bearer {GLYPHWARD_API_KEY}"},
        json={
            "image": image_b64,
            "source": context.value,
            "metadata": {
                "mental_health_context":  context.value,
                "programme_id_hash":      programme_id_hash,
                "patient_session_ref":    patient_session_ref,
                "assessment_id":          assessment_id,
                "client_scan_id":         client_scan_id,
                "image_sha256":           image_sha256,
            },
        },
        timeout=8.0,
    )
    resp.raise_for_status()
    result = resp.json()

    audit_record = {
        "programme_id_hash":    programme_id_hash,
        "patient_session_ref":  patient_session_ref,
        "assessment_id":        assessment_id,
        "mental_health_context": context.value,
        "scan_id":              result["scan_id"],
        "client_scan_id":       client_scan_id,
        "image_sha256":         image_sha256,
        "score":                result["score"],
        "flagged_region":       result.get("flagged_region"),
        "threshold":            threshold,
        "action":               "blocked" if result["score"] >= threshold else "allowed",
    }
    await write_mental_health_audit_record(audit_record)

    if result["score"] >= threshold:
        raise AdversarialMentalHealthAIImageError(
            f"Mental health AI image blocked [{context.value}]: "
            f"scan_id={result['scan_id']} score={result['score']} "
            f"programme={programme_id_hash} session={patient_session_ref}"
        )
    return result


async def write_mental_health_audit_record(record: dict) -> None:
    """Persist audit record to HIPAA-compliant clinical safety documentation store (stub)."""
    import json, sys
    print(json.dumps(record), file=sys.stderr)


class AdversarialMentalHealthAIImageError(Exception):
    """Raised when a mental health or digital health AI image exceeds the adversarial injection threshold."""
    pass

Call scan_mental_health_ai_image() with MentalHealthAIContext.ASSESSMENT_AI before forwarding Spring Health AI or Lyra Health AI patient mental state assessment photographs to PHQ-9 severity classification and clinical escalation determination AI — the integration point where adversarial suppression of severe depression severity creates Tarasoff duty-to-warn liability and MHPAEA clinical necessity parity compliance exposure, with patient_session_ref linking the Glyphward scan to the patient session record for HIPAA-compliant clinical audit trail documentation. Call with MentalHealthAIContext.CRISIS_AI for Crisis Text Line AI or Woebot crisis support conversation interface screenshots before AI suicidal ideation risk classification and 988 Lifeline emergency response protocol trigger determination, with assessment_id as the crisis triage session identifier for Joint Commission NPSG.15.01.01 suicide risk assessment documentation. Call with MentalHealthAIContext.TELETHERAPY_AI for Talkspace or BetterHelp teletherapy session video interface frames before AI patient distress signal detection and therapist supervisor escalation, with patient_session_ref for HIPAA-compliant teletherapy session clinical record and APA Ethics Code professional supervision documentation. Call with MentalHealthAIContext.CLINICAL_DOCS_AI for SilverCloud or Quartet Health clinical documentation photographs before AI clinical record completeness and HIPAA documentation accuracy assessment, with programme_id_hash for MHPAEA parity audit and HIPAA §164.310 PHI accuracy compliance documentation. Get early access

Coverage matrix

Control Mental health assessment AI injection (Spring Health, Lyra) Crisis support AI injection (Crisis Text Line, Woebot) Teletherapy session AI injection (Talkspace, BetterHelp) Clinical documentation AI injection (SilverCloud, Quartet)
Text-only PI scanners (Lakera, LLM Guard) No — adversarial pixel perturbations in patient affect photographs suppressing PHQ-9 severity classification are invisible to text-based analysis No — crisis support interface screenshot pixel manipulation suppressing suicidal ideation risk classification is not caught by text-only scanning No — teletherapy session video frame pixel manipulation suppressing patient distress signal detection is not detected by text analysis No — clinical documentation photograph pixel perturbations suppressing documentation accuracy classification are not visible to text scanners
Clinician and care team review Care navigators review AI-flagged cases escalated from Spring Health or Lyra severity tools; do not inspect individual patient photograph pixels for adversarial manipulation before AI severity classifications are generated Crisis counsellors review priority conversations escalated from Crisis Text Line AI triage; do not inspect individual crisis interface screenshot pixels for adversarial manipulation before AI risk classifications are generated Therapist supervisors review session quality alerts from Talkspace or BetterHelp AI; do not inspect individual teletherapy session frame pixels for adversarial manipulation before AI distress signal detections are generated Clinical staff review documentation completeness alerts from SilverCloud or Quartet AI; do not inspect individual clinical form photograph pixels for adversarial manipulation before AI accuracy classifications are generated
HIPAA compliance and Joint Commission audit HIPAA compliance officers review PHI accuracy and clinical record obligations; do not detect adversarial manipulation of Spring Health/Lyra assessment AI inputs between HIPAA audit cycles Joint Commission surveyors assess NPSG.15.01.01 suicide risk process documentation; do not detect adversarial manipulation of crisis AI inputs that affected emergency response triggers between survey visits State telehealth licensing reviewers assess teletherapy clinical documentation standards; do not detect adversarial manipulation of Talkspace/BetterHelp session AI inputs between state review cycles MHPAEA parity auditors and HIPAA compliance reviewers assess clinical documentation accuracy; do not detect adversarial manipulation of SilverCloud/Quartet AI documentation inputs between audit cycles
Glyphward Yes — threshold 50; programme_id_hash and patient_session_ref audit trail; blocks adversarially crafted Spring Health/Lyra patient photographs before PHQ-9 severity AI for HIPAA and Tarasoff duty-to-warn documentation Yes — threshold 50; blocks adversarially crafted Crisis Text Line/Woebot screenshots before suicidal ideation risk AI, with assessment_id for NPSG.15.01.01 and 988 Lifeline emergency response audit Yes — threshold 50; blocks adversarially crafted Talkspace/BetterHelp session frames before patient distress AI, with patient_session_ref for HIPAA teletherapy record and APA supervision audit trail Yes — threshold 50; blocks adversarially crafted SilverCloud/Quartet documentation photos before record accuracy AI, with programme_id_hash for MHPAEA parity and HIPAA §164.310 compliance audit

Frequently asked questions

How does adversarial injection into Crisis Text Line AI suicidal ideation risk classification differ from ordinary crisis text conversation misclassification, and why does the 988 Lifeline emergency response protocol not detect adversarially manipulated crisis screenshots?

Ordinary crisis text conversation AI classification challenges — ambiguous crisis expression language that does not use explicit suicidal ideation vocabulary, indirect or coded communication patterns used by individuals in crisis who fear judgement, colloquial language variations and regional expression differences affecting AI natural language processing, and high message volume that creates queue processing latency affecting triage responsiveness — are addressed by Crisis Text Line AI through multi-signal triage architectures that combine natural language crisis signal detection with conversation context modelling, message sequence pattern analysis, and counsellor skill routing to optimise crisis response quality across the range of crisis communication styles. Crisis Text Line AI triage tools are designed with safety-biased classification thresholds that prioritise reducing false negative rates — missed high-risk conversations — over false positive rates, reflecting the asymmetric harm structure of crisis intervention where a missed high-risk conversation creates worse outcomes than an unnecessary counsellor priority assignment.

Adversarial injection into Crisis Text Line AI operates at the visual rendering layer of the crisis support interface screenshot processing pipeline rather than at the natural language content layer, targeting the AI vision and interface parsing components that extract conversation content features from interface screenshot image inputs before passing extracted features to crisis severity classification models. Crisis Text Line AI screenshot processing pipelines that extract conversation content from rendered interface screenshots are exposed to adversarial pixel manipulation that affects the AI vision feature extraction outputs for crisis severity signal indicators — such as manipulation of the visual rendering of specific crisis language tokens, sentiment intensity display markers, or crisis severity indicator UI elements — without altering the text content that human crisis counsellors read in the actual conversation interface. The 988 Lifeline emergency response protocol operates based on crisis centre AI triage outputs and counsellor severity assessments; it does not include a pixel-level forensic validation layer that inspects individual crisis interface screenshot pixels for adversarial manipulation before triage classification is generated, because the protocol assumes that AI triage tool inputs have not been adversarially manipulated at the visual rendering layer. Glyphward pre-scan at the crisis support interface screenshot ingestion boundary provides the only real-time technical control that operates at the adversarial image injection detection layer before Crisis Text Line AI or Woebot crisis triage tools generate the severity classifications that 988 Lifeline counsellor priority assignment and emergency response escalation depend upon.

What are an employer mental health benefit programme’s MHPAEA parity compliance obligations when adversarial injection into Spring Health AI suppresses PHQ-9 severe depression severity classification?

An employer mental health benefit programme’s MHPAEA parity compliance obligations when adversarial injection into Spring Health AI suppresses PHQ-9 severe depression severity classification operate on the non-quantitative treatment limitation (NQTL) parity framework of MHPAEA 29 USC §1185a and the 2024 Final MHPAEA Rules implementing regulations. MHPAEA requires that NQTL applied to mental health or substance use disorder benefits — including prior authorisation requirements, step therapy protocols, and care pathway escalation criteria — are no more stringent than the predominant NQTL applied to substantially all medical and surgical benefits in the same benefit classification. Spring Health AI’s clinical care pathway matching and escalation determination tools constitute an NQTL within the meaning of MHPAEA when they determine whether a patient’s PHQ-9 severity score meets the clinical necessity threshold for intensive outpatient programme access, crisis intervention services, or inpatient psychiatric benefit coverage under the employer group health plan’s mental health benefit design. Adversarial suppression of PHQ-9 severe depression severity classification in Spring Health AI that systematically routes patients with actual severe depression symptom presentations to lower-acuity care pathways creates a discriminatory NQTL effect — denying access to the level of mental health care benefits that MHPAEA requires to be available on terms no more restrictive than comparable medical and surgical benefits — with DOL Employee Benefits Security Administration enforcement exposure and MHPAEA private right of action civil liability dimensions under ERISA §502(a).

A DOL MHPAEA comparative analysis review of an employer group health plan’s mental health benefit clinical necessity determination process examines whether the plan’s NQTL — including AI-assisted care pathway escalation criteria — are applied in a manner that is no more stringent for mental health benefits than for comparable medical and surgical benefits; adversarial corruption of Spring Health AI severity classification that creates systematic severity underclassification for mental health benefit claims creates a MHPAEA comparative analysis documentation failure when the employer plan cannot demonstrate that its AI-assisted mental health care pathway determination process produces outcomes equivalent to the standard applied for comparable medical benefit determinations. Plan sponsors who self-insure mental health benefits or whose insured plans incorporate AI-assisted clinical necessity determination tools face plan administrator fiduciary obligations under ERISA §404 that require prudent processes for benefit determination; adversarial compromise of Spring Health AI severity classification used in plan benefit determination creates ERISA §404 plan administrator liability exposure when manipulated AI severity outputs cause plan participants to be denied mental health benefits they are entitled to receive under MHPAEA. Glyphward pre-scan audit records — including programme_id_hash employer benefit programme identification, patient_session_ref patient assessment linkage, and adversarial image block evidence with image_sha256 chain-of-custody — provide the MHPAEA comparative analysis documentation and ERISA plan administration audit trail that plan sponsors need to demonstrate that their Spring Health AI-assisted mental health benefit determination processes were not adversarially manipulated during the MHPAEA review period.

Further reading