Skip to content
QwryAI
Documentation
Pages

AI Agent Management

Guardrails: protect your agent from spam and abuse

Protect your agent from abuse with a rate limit, spam detection and country blocking

Guardrails are the QwryAI settings that protect your agent from abuse: a Rate limit that caps how fast visitors can send messages, Spam detection that pauses spam and abusive conversations, and Country blocking that hides your agent from visitors in the countries you choose. Guardrails are set per agent and apply mainly to your website channels (Chat bubble, Center Stage and Help Page), with some coverage of the API and messaging channels, as each section below lists.

Go to Build › Guardrails. The page has two tabs:

  • Auto protection holds two cards, Rate limit and Spam detection. Each card has its own Save button, so save one before you edit the other.
  • Blocklists holds Country blocking.

Guardrails settings take effect as soon as you save them; they don't wait for Publish.

Auto protection: Rate limit and Spam detection.

Rate limit

Use Rate limit to cap how many messages one visitor's device can send to your agent in a set time.

Set Limit to N messages every N seconds, then write the Message to show when limit is hit. A visitor who goes over the limit sees this message instead of a reply until the time window passes.

Limit to N messages every N seconds.

Defaults and allowed values

SettingDefaultAllowed values
Limit to (messages)201 to 200
every (seconds)2401 to 3,600
Message to show when limit is hit"Too many messages in a row"Any text up to 500 characters

If a value is out of range, the card shows an error such as Messages can't be more than 200. or Seconds can't be more than 3,600., and Save stays off until you fix it.

Where the rate limit applies

  • Applies to: the Chat bubble and website iframe, for visitors on your website
  • Doesn't apply to: your own tests in the Playground

Spam detection

Use Spam detection to have QwryAI check visitor messages for spam. When a conversation is judged to be spam, it's paused and your agent stops replying to it. You can also pause a conversation yourself from Inbox.

Turn on the switch in the card's header, review the definition, and select Save.

Spam detection, with your own definition.

Defining what counts as spam

What counts as spam for this agent holds the instructions the spam check follows, up to 2,000 characters. QwryAI starts you with a definition that flags:

  • Profanity: vulgar, obscene, insulting or sexually explicit words or slang, in any language.
  • Spam: unsolicited commercial promotions, scams, repetitive gibberish, random keyboard mashing, or emoji-only messages.

Edit the text to suit your business. For example, relax the profanity rule for a casual brand, or add patterns you see often, such as competitor promotions or repeated links. Be specific about what should and shouldn't count, because anything the check judges to be spam pauses that conversation.

You can't save with the switch on and the field empty.

What happens when a conversation is paused

  • The visitor can keep sending messages. They're saved, but your agent doesn't reply.
  • Your team sees the paused conversation in Inbox and can pick it up or resume the agent.

Resume a paused conversation

  1. Open the conversation

    Go to Inbox and open the paused conversation.

  2. Resume the agent

    Select Resume AI in the conversation header. Your agent replies to new messages again.

Supported channels

Spam detection works on:

  • Chat bubble and website iframe
  • Center Stage
  • Help Page
  • API
  • WhatsApp, Messenger and Instagram
  • Android SDK and iOS SDK

Spam detection doesn't run on:

  • Slack
  • Email: email has its own spam filter. See Email.
  • Zendesk Messaging
  • Phone

Country blocking

Use Country blocking on the Blocklists tab to hide your agent from visitors in particular countries. QwryAI works out each visitor's country from their IP address.

Blocking a country

  1. Open Blocklists

    Go to Build › Guardrails and open the Blocklists tab.

  2. Pick the countries

    Under Blocked countries, open Select countries... and search for a country by name. Select each country you want to block. Each one appears as a chip with its flag below the picker.

    Search, select, save.
  3. Save

    Select Save. QwryAI confirms with Country blocking settings saved.

    To unblock a country, select the X on its chip and save again.

Allowing only a few countries

To make your agent available in only a few countries:

  1. Select Select all in the country picker.
  2. Unselect the countries you want to allow.
  3. Select Save.

The picker then shows how many countries are blocked.

Supported channels

  • Chat bubble and Center Stage: not shown to visitors from blocked countries.
  • Help Page: not available to visitors from blocked countries.
  • API: chat requests from blocked countries are turned away.

Frequently asked questions

Why are several visitors hitting the rate limit at once?

Check that Limit to isn't set too low for how your customers chat. Raise it, or lengthen the window, so a normal conversation fits.

Does spam detection pause real customers?

It can, if your definition is too broad. Read paused conversations in Inbox, select Resume AI for any that weren't spam, and tighten What counts as spam for this agent.

Can I unpause a conversation that spam detection paused?

Yes. Open it in Inbox and select Resume AI. Your agent then replies to new messages again.

What does a paused visitor see?

Nothing changes on their screen. Their messages are saved, but your agent doesn't reply until your team picks up the conversation or resumes the agent.

Can I allow only certain countries?

There's no allowlist, but you can get the same result: select Select all in the country picker, unselect the countries you want to allow, and save.

Explore the documentation