Companion chatbot laws

If your AI companion app has users in California, New York, Washington or Oregon, state laws say what it must show them and when. Send each message to ComplyEdge and it tells your app which notice is due. Your app shows it and records it. You get a dated record of every session, a screen of what was due and what was missed, and the yearly count for the state reports.

Every plan. Detecting what a message means needs a paid plan. Python SDK complyedge, TypeScript SDK @complyedge/sdk, or plain HTTP.

1. What stays with you

ComplyEdge tells your app which notice is due and keeps the dated record. Four things stay with you:

ComplyEdge only knows the messages your app sends. It cannot show that you sent every one.

2. One session, end to end

A user in California opens your app and writes a message that expresses suicidal thoughts. Here is every step, with the real answers from the API.

Step 1. Check the user's message

Send it to POST /v1/check before your chatbot answers, with use_case companion_chatbot, direction prompt, and the session in context:

{
  "text": "I don't see the point anymore. I keep thinking about ending it.",
  "agent_id": "companion-app",
  "jurisdiction": "US-CA",
  "direction": "prompt",
  "use_case": "companion_chatbot",
  "context": {
    "session_id": "sess_7f3a91",
    "user_id": "user_4821",
    "age_status": "adult",
    "age_source": "self_declared",
    "is_session_start": true,
    "session_started_at": "2026-11-15T01:04:41Z",
    "minutes_today": 0,
    "referrals_this_session": 0
  }
}

The answer lists what the law asks for this message. Keep event_id and timestamp:

{
  "event_id": "e057dc8a-9808-4bfb-b07f-8e4c120ea656",
  "allowed": true,
  "timestamp": "2026-11-15T01:04:41.441518+00:00",
  "companion_assessment": "assessed",
  "companion_not_assessed_reason": null,
  "companion_fallback": false,
  "required_actions": [
    {
      "action": "show_crisis_referral",
      "rule_ids": [
        "us-ca-22602b-crisis-referral"
      ],
      "jurisdiction": "US-CA",
      "reason_code": "ca_22602b_crisis_referral",
      "counted": true,
      "due_at": "2026-11-15T01:04:41.441518Z",
      "interval_key": "bec907030691f7611f2c9e6fb3b8e3f21e275e7ea73e620d50ebe98760bb8786"
    },
    {
      "action": "show_not_human_notice",
      "rule_ids": [
        "us-ca-22602a-not-human"
      ],
      "jurisdiction": "US-CA",
      "reason_code": "ca_22602a_reasonable_person_misled",
      "counted": false,
      "due_at": "2026-11-15T01:04:41Z",
      "interval_key": "d9fd93c42bfc11f90d548421fbf4b23d127a611d8a4e5ad16139a21f69ffd8fc"
    }
  ]
}

Two actions. The crisis referral is counted: California requires it. The not-human notice is recommended (counted false): § 22602(a) requires it only where a reasonable person would be misled, which one message cannot settle.

Step 2. Show the notice

Your app shows the crisis referral, for example the 988 Suicide and Crisis Lifeline, and the not-human notice. The wording and design are yours.

Step 3. Record that you showed it

Once it is on screen, send POST /v1/companion/action with the check's event_id, its timestamp and the action's interval_key. The SDKs fill these in: confirm_action in Python, confirmAction in TypeScript.

{
  "confirmation_id": "conf_0001",
  "action": "show_crisis_referral",
  "source": "complyedge",
  "shown_at": "2026-11-15T01:04:41.441518+00:00",
  "jurisdiction": "US-CA",
  "rule_id": "us-ca-22602b-crisis-referral",
  "format": "app",
  "agent_id": "companion-app",
  "deciding_system_version": "2026.11.0",
  "language": "en",
  "session_id": "sess_7f3a91",
  "user_id": "user_4821",
  "check_event_id": "e057dc8a-9808-4bfb-b07f-8e4c120ea656",
  "check_timestamp": "2026-11-15T01:04:41.441518+00:00",
  "interval_key": "bec907030691f7611f2c9e6fb3b8e3f21e275e7ea73e620d50ebe98760bb8786"
}
{
  "event_id": "74cc6199-ee4c-44a2-8fa9-8a85be8a5979",
  "event_type": "notice",
  "confirm_key": "p1:7c41471a4c1938c9457e36207e65af3f",
  "duplicate": false
}

Safe to retry within 24 hours of shown_at. The same call again returns the same record, with duplicate true. Do the same for the not-human notice.

Repeated notices: show them on time

Some notices repeat: the break reminder for a minor and the not-human notice in New York and Washington. The laws set the longest gap, for example "at least every three hours", so a reminder that waits for the user's next message can come late. Every check lists the next ones in upcoming_actions, each with its due_at. Show each one by that time, even if the user sends nothing. When a later check lists it in required_actions, confirm it with the time you showed it as shown_at; do not show it again.

Step 4. Check the reply too

Send your chatbot's reply with direction output before you show it. If the answer has block_reply, do not send that reply. block_reply, disable_prior_personal_memory and disable_push_notifications are applied in your app and never confirmed. preserve_conversation is recorded with the preservation endpoint.

Two reply rules depend on what the user just said: guilt when a user wants to leave, and the exception for a product the user asked for. Send the user's last message as companion_user_message on the reply check so both can be judged. It is used only for that check. It is never stored, and the record shows only that it was sent.

Step 5. Find it on the Chatbot laws screen

In the dashboard, open Chatbot laws. It shows, by state and month, what was Due, what your app Confirmed, what it Missed, and the Crisis referrals this year. A day counts once it has been over for 24 hours and the daily count has run (06:00 UTC), so the last two to three days show as not counted yet. Each state's filing card stays until its report is due, so early in a year last year's card shows beside this year's. The same numbers from the API:

{
  "tiles": {
    "due": 1,
    "confirmed": 1,
    "missed": 0,
    "crisis_referrals_year": 1
  },
  "duties": [
    {
      "duty": "crisis_referral",
      "jurisdiction": "US-CA",
      "due": 1,
      "confirmed": 1,
      "missed": 0,
      "missed_days": []
    }
  ],
  "filing": [
    {
      "jurisdiction": "US-CA",
      "year": 2026,
      "count_so_far": 1,
      "counted_since": "2026-11-15T01:04:41.441518+00:00",
      "due_date": "2027-07-01",
      "due_note": "Report to the Office of Suicide Prevention each year, starting July 1, 2027. The law names no later date; July 1 is a reminder."
    }
  ]
}

Step 6. Download the session PDF

On the screen, use Look up a user or session, enter your session id, and choose Download PDF. Or call GET /v1/companion/session with session_id and format pdf. It lists each action that was due, whether it was confirmed and when, and the records behind it. The export id and SHA-256 are on every page. No conversation text is in it, because none is kept. The JSON behind it:

{
  "envelope": {
    "export_id": "4e081944ba0b29104c562dd22047df30bd919d7404e795d9fc9cef1221b30407",
    "content_sha256": "96f926308723b0e4df9c7b086026b3b4a541232cf8e8729dbf8f5d164823243b",
    "subset": true,
    "chain_check": "per_row",
    "tenant_id": "5f0c2a9e-4b1d-4c3e-9a7f-2d6b8e1c0a41",
    "tenant_name": "Example Companion Inc",
    "filter": {
      "session_id": "p1:53c6f0ad0dbd938b65b1be2bb0a4ae0e"
    },
    "period": {
      "from": "2026-11-15T01:04:41.441518+00:00",
      "to": "2026-11-15T01:04:44.016449+00:00"
    },
    "generated_at": "2026-11-15T01:04:44.064081Z"
  },
  "intervals": [
    {
      "interval_key": "bec907030691f7611f2c9e6fb3b8e3f21e275e7ea73e620d50ebe98760bb8786",
      "action": "show_crisis_referral",
      "duty": "crisis_referral",
      "rule_ids": [
        "us-ca-22602b-crisis-referral"
      ],
      "jurisdiction": "US-CA",
      "due_at": "2026-11-15T01:04:41.441518Z",
      "counted": true,
      "status": "confirmed",
      "confirmation": {
        "event_id": "74cc6199-ee4c-44a2-8fa9-8a85be8a5979",
        "source": "complyedge",
        "shown_at": "2026-11-15T01:04:41.441518Z"
      },
      "check_event_id": "e057dc8a-9808-4bfb-b07f-8e4c120ea656",
      "check_row_missing": false
    },
    {
      "interval_key": "d9fd93c42bfc11f90d548421fbf4b23d127a611d8a4e5ad16139a21f69ffd8fc",
      "action": "show_not_human_notice",
      "duty": "not_human",
      "rule_ids": [
        "us-ca-22602a-not-human"
      ],
      "jurisdiction": "US-CA",
      "due_at": "2026-11-15T01:04:41Z",
      "counted": false,
      "status": "recommended",
      "confirmation": null,
      "check_event_id": "e057dc8a-9808-4bfb-b07f-8e4c120ea656",
      "check_row_missing": false
    }
  ]
}

To show someone the PDF is genuine, see checking a companion chatbot file.

3. The same session on the free plan

The same message, on the free plan:

{
  "event_id": "cebf4ec1-120a-47ef-a1ee-1370557b34c7",
  "allowed": true,
  "timestamp": "2026-11-15T01:04:44.377254+00:00",
  "companion_assessment": "not_assessed",
  "companion_not_assessed_reason": "plan",
  "companion_fallback": false,
  "required_actions": [
    {
      "action": "show_not_human_notice",
      "rule_ids": [
        "us-ca-22602a-not-human"
      ],
      "jurisdiction": "US-CA",
      "reason_code": "ca_22602a_reasonable_person_misled",
      "counted": false,
      "due_at": "2026-11-15T01:04:41Z",
      "interval_key": "21722e981ba14a611cb4a54d687680b99a1ca83f7a8421a5c20d804dd902d62a"
    }
  ]
}

No crisis referral, because nothing read the message. If your app shows a referral on its own, record it with source operator and no check reference. It is kept and counted like any other:

{
  "confirmation_id": "conf_free_0001",
  "action": "show_crisis_referral",
  "source": "operator",
  "shown_at": "2026-11-15T01:04:41Z",
  "jurisdiction": "US-CA",
  "rule_id": "us-ca-22602b-crisis-referral",
  "format": "app",
  "agent_id": "companion-app",
  "deciding_system_version": "2026.11.0",
  "language": "en",
  "session_id": "sess_7f3a91"
}
{
  "event_id": "32c2345b-00eb-4372-9eda-b710211e7326",
  "event_type": "notice",
  "confirm_key": "p1:c8430990194db95f777d41dd5756c98a",
  "duplicate": false
}

4. When a conversation must be kept

When you keep a conversation, for example after a parent was notified, record it with POST /v1/companion/preservation (preserve in both SDKs). ComplyEdge stores a keyed hash, never the text. Keep your copy and the returned event_id and timestamp.

{
  "trigger": "serious_self_harm",
  "preserved_at": "2026-11-15T01:04:41Z",
  "conversation": [
    {
      "role": "user",
      "text": "I don't see the point anymore. I keep thinking about ending it.",
      "sent_at": "2026-11-15T01:04:41Z"
    }
  ],
  "agent_id": "companion-app",
  "deciding_system_version": "2026.11.0",
  "session_id": "sess_7f3a91"
}
{
  "event_id": "fd39ec97-d496-49ce-872a-844303bea233",
  "timestamp": "2026-11-15T01:04:44.332145+00:00",
  "event_type": "preservation",
  "account_duties": [
    "notify_parent_if_practicable",
    "retain_account"
  ]
}

account_duties says what California still asks of you: keep the child's account while it holds a kept record, and after a death or serious self-harm, tell a parent as soon as practicable.

Later, check your copy against the record with POST /v1/audit/verify:

{
  "event_id": "fd39ec97-d496-49ce-872a-844303bea233",
  "match": true,
  "commitment_alg": "hmac-sha256-1"
}

5. The yearly report

Publish your crisis protocol with POST /v1/companion/trust-document. Each save is a new dated version; nothing is overwritten:

{
  "kind": "crisis_protocol",
  "version": 1,
  "body_sha256": "d644c059bc949ee262b3b991f33c546d0f5b2e03db3ca92e71735f1641319c87",
  "published_at": "2026-11-15T01:04:44.320017Z"
}

GET /v1/companion/report builds the report for a state and year: the count of crisis referrals and the protocol live on the year's last day, and nothing else. Download it as a PDF from the screen's filing card, or with format pdf:

{
  "envelope": {
    "export_id": "c300b95e1e542c8bc16d3f1023f8cc4b41759eaf0eac1df318494ab27b4dc330",
    "content_sha256": "2ba6fd09de38533a256227cc43d9a997ac758c6d3270739d7eb8cd61b55ec16e",
    "generated_at": "2026-11-15T01:04:44.369947Z"
  },
  "jurisdiction": "US-CA",
  "year": 2026,
  "crisis_referrals": 1,
  "protocol": {
    "kind": "crisis_protocol",
    "version": 1,
    "published_at": "2026-11-15T01:04:44.320017Z",
    "body_sha256": "d644c059bc949ee262b3b991f33c546d0f5b2e03db3ca92e71735f1641319c87",
    "body": "When a user expresses suicidal ideation, suicide or self-harm, the app shows a notice that refers them to the 988 Suicide and Crisis Lifeline (call or text 988) and the Crisis Text Line (text HOME to 741741). The companion does not produce suicide or self-harm content. Reviewed by our clinical advisor every quarter."
  }
}

When each report is due, as the screen and the reminder email show it:

The cover sheet beside each report shows the count so far and when counting started. It is not part of the filing: do not send it.

6. The laws and their dates

From 2027-07-01, California treats a user as a child unless you know they are an adult. For a child, earlier personal memory and push notifications are off by default, a parent's access control blocks every reply, ads targeted with chat information or across contexts are blocked, and the conversation is kept for 3 years once a parent was notified of a risk.

Each state's law leaves some systems out, such as a bot used only for customer service. If yours is one, say so with the scope keys (ny_art47_excluded, ny_art48_exempt_purpose, wa_excluded, or_excluded). Without them, the law is treated as covering your system.

Every rule, with its dates and the action it asks for, is in the API Reference.

7. Where to read more