Chat Abuse Detection

April 23, 2026

Basin's chat widget now includes AI-powered abuse detection to protect your resources from low-quality, off-topic, or spammy conversations.

How it works

The AI model that powers your chat responses now has access to a flag_conversation tool. When it determines a conversation isn't genuinely valuable — off-topic messages, repetitive low-effort prompts, or other resource-wasting behavior — it calls that tool automatically as part of its response.

Once a conversation is flagged:

  • The session is permanently disabled.
  • The final bot message is shown highlighted in red with a warning icon in the conversation view, so you know exactly where the session was cut off and why.
  • The conversation list marks flagged sessions with an "Abusive" badge so you can identify them at a glance.

What gets flagged

The detection is intentionally broad — the model flags conversations it judges to not be worth responding to. This includes:

  • Messages that are clearly off-topic for your chat's purpose
  • Repetitive or copy-paste spam
  • Low-effort inputs that aren't seeking genuine help

What this doesn't affect

Normal, on-topic conversations are completely unaffected. The detection runs as part of the existing response generation — there's no added latency and no separate API call.

Tuning detection with your chat's context

The abuse detection uses the same custom context you've already written for your chat widget to decide what's on-topic. The more specific your context is about your chat's purpose, the more precisely the model can judge whether a conversation belongs there.

For example:

  • A context like "Answer questions about our services" will cause the model to flag conversations about unrelated topics (e.g. general cooking advice) more readily than a vague context would.
  • If you find legitimate conversations getting flagged too aggressively, broaden your context to describe the full range of topics you want to support.
  • Conversely, if you want tighter enforcement, make your context more explicit — e.g. "Only assist with questions about billing, account settings, and deployment. Flag anything else."

You can update your chat's context from SettingsChatContext.