Korzen

Blog

Bot protection for chatbots: the message that costs you money

An AI chat open to visitors spends tokens on every message, and scripts spend them for free. Where to check, what stays yours, and what Bot Protection is not.

A support widget or a free assistant on your site answers anyone who types, and every answer spends a model's tokens. Most of the people typing are customers. Some of the traffic is not: scripts that send prompts in bulk to get free inference through your widget, tools that resell your chat as an API, and bots that leave spam leads in it. Each of those messages is billed to you like a customer's.

This page is about a chat open to visitors. If you sell an AI product with free accounts, the abuse starts at the sign-up: see bot protection for AI apps.

Where to check

Your server asks Bot Protection before it spends, and acts on the class it gets back. A chat has three places where the answer matters:

  • Before the first message of a conversation: refuse bot; for unknown with a high bot_score, give the conversation a short limit, or ask the visitor to sign in to go on. Send "protected_action": true here: a script that calls your chat's endpoint without loading the page carries no token from the tag, and block mode refuses it.
  • Before an expensive answer: a long context, a file to read, a tool call or a bigger model. Ask again there; it costs one decision and saves the answer.
  • The sign-up or the form that lifts the limit: where a visitor becomes an account, or leaves an email for a lead. See free trial abuse.

Each call is a decision on your plan, so check once per conversation and again before what is expensive, not on every message. The tag goes on the page that shows the chat, and your server's call passes on the token the tag set.

Start in monitor mode: you see how many conversations block mode would have stopped before anyone is refused.

What stays yours

The limits that bound your spend are your own, and they stay in place whatever Bot Protection answers:

  • A limit per visitor and per account: messages and tokens per conversation, and per day. A person who types a lot is still a person.
  • The prompt's own safety: what the model may say and do, which tools it may call, and what it does with what a visitor pastes into it.

Bot Protection is not prompt-injection protection. It judges whether a visitor is a person or automation; it does not read the messages, and a person can still type a malicious prompt.

Questions

Does Bot Protection check every chat message?

It checks what your server asks about. Asking on every message costs a decision each; asking at the start of a conversation and before expensive answers covers the spend for far fewer.

Does Korzen stop prompt injection?

No. It tells a person from automation, never what a message says. Guard the prompt, the tools and the output in your own code or with a tool made for that.

Will real visitors be refused?

A person is judged on what their visit shows. Being on a VPN, a mobile network or a shared office connection never makes a person a bot on its own, and monitor mode shows your own numbers before anyone is refused.