Rate Limiting

Limit messages per session to prevent abuse and control costs.

Rate limiting controls how many messages each visitor can send inside a rolling time window. Use it to prevent abuse, reduce costs, and ensure fair access for all visitors.

Setting Up Rate Limiting

  1. Go to your agent's Settings tab
  2. Click Security
  3. Find Rate Limit
  4. Set the maximum messages and the window in seconds
  5. Customize the limit message (optional)
  6. Save changes

Configuration Options

Messages Per Window

The maximum number of messages a single visitor can send during the rolling window:

  • Min: 1
  • Max: 100
  • Default: 20

Window (Seconds)

How long the rolling window lasts:

  • Min: 10 seconds
  • Max: 3600 seconds (1 hour)
  • Default: 240 seconds (4 minutes)

Limit Message

Custom text shown to visitors when the limit is hit. Max 500 characters. Default: "Too many messages in a row".

How Visitors Are Identified

Each visitor is tracked by their client IP address. If no IP is available, the conversation ID is used as a fallback. The limit is enforced server-side per chatbot, so visitors cannot bypass it by clearing browser data.

What Happens at the Limit

When a visitor exceeds the limit, the chatbot replies with your configured limit message instead of generating a new response. The counter naturally resets as the rolling window advances — visitors can continue chatting once enough time has passed.

Example message:

"Too many messages in a row. Please try again later or contact us directly at [email protected]."

Choosing the Right Limit

Use CaseRecommended Limit
FAQ/Simple questions10-15 messages / 4 min
Customer support20-30 messages / 4 min
Technical documentation30-50 messages / 5 min
Complex consultations50-100 messages / 10 min

Rate limiting is always on — the lowest allowed value is 1 message per 10 seconds. If you want a very permissive setup, raise maxMessages toward 100 and shrink the window.

Considerations

Too Low:

  • Frustrates visitors mid-conversation
  • Incomplete support interactions
  • Poor user experience

Too High:

  • Risk of abuse
  • Higher costs
  • Potential for spam

Start with the default (20 messages per 4 minutes) and adjust based on your Chat Logs data.

Rate Limiting vs. Plan Limits

FeatureRate LimitingPlan Limits
ScopePer visitor (IP), rolling time windowPer workspace, per month
PurposePrevent abuseControl costs
What happensLimit message returnedAgent paused
ResetWhen the rolling window advancesBilling cycle

Both can be active simultaneously. Plan limits protect your total usage; rate limiting protects per-visitor usage.

Monitoring Rate Limits

Check if visitors are hitting limits:

  1. Go to Chat Logs
  2. Look for conversations that end abruptly
  3. Review message counts per conversation

If many visitors hit limits, consider:

  • Increasing the limit
  • Improving answer quality (fewer back-and-forth)
  • Adding suggested messages to guide conversations

Bypassing Rate Limits

For internal testing, you can:

  • Use the Playground (still subject to the same limits)
  • Create a separate test agent with a very high limit (e.g., 100 messages per 10 seconds)
  • Raise the limit temporarily during load tests

Best Practices

  1. Start with the defaults - 20 messages per 4 minutes is a good baseline
  2. Monitor feedback - Check if visitors complain about limits
  3. Combine with domain restrictions - Extra protection
  4. Provide alternatives - Include contact info in the limit message
  5. Review regularly - Adjust based on actual usage patterns

Next Steps