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
- Go to your agent's Settings tab
- Click Security
- Find Rate Limit
- Set the maximum messages and the window in seconds
- Customize the limit message (optional)
- 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 Case | Recommended Limit |
|---|---|
| FAQ/Simple questions | 10-15 messages / 4 min |
| Customer support | 20-30 messages / 4 min |
| Technical documentation | 30-50 messages / 5 min |
| Complex consultations | 50-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
| Feature | Rate Limiting | Plan Limits |
|---|---|---|
| Scope | Per visitor (IP), rolling time window | Per workspace, per month |
| Purpose | Prevent abuse | Control costs |
| What happens | Limit message returned | Agent paused |
| Reset | When the rolling window advances | Billing 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:
- Go to Chat Logs
- Look for conversations that end abruptly
- 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
- Start with the defaults - 20 messages per 4 minutes is a good baseline
- Monitor feedback - Check if visitors complain about limits
- Combine with domain restrictions - Extra protection
- Provide alternatives - Include contact info in the limit message
- Review regularly - Adjust based on actual usage patterns
Next Steps
- View chat logs to monitor conversations
- Configure domain restrictions for additional protection
- Set visibility to control access