https://retellai.com/?utm_source=discord&utm_medium=seo logo
what are best practices to prevent spam call attac...
# ❓・ai-evy-support
b
@AI Evy what are best practices to prevent spam call attacks?
a
Thanks for tagging me @Bobster2002. I'll look through relevant sources and get back to you shortly.
### Answer Here are the best practices to prevent spam call attacks on your Retell AI agent: ## Core Prevention Strategies 1. Never expose your API key publicly – always use a [public key]() in the frontend. [(1) ]() 2. Rotate and revoke keys immediately if your API key is ever exposed. 3. Enable reCAPTCHA when using Retell widgets to prevent bots from abusing your endpoints. 4. Restrict functionality and regions – only allow the capabilities or geographic regions you actually need. 5. Implement rate limiting (number-based, IP-based, etc.) for your endpoints. 6. Use user identification mechanisms (KYC measures) when necessary. 7. Add prompt logic in your agent to detect unrelated or suspicious calls and hang up quickly. ## Inbound Call Protection - Set up [inbound webhooks]() to detect and block unwanted traffic based on the incoming number. - Enable an inbound webhook on your number, check the
from_number
, and reject suspicious calls by responding with a 200 status without including
override_agent_id
. [(2) ]() ## Additional Mitigation - Configure
max_call_duration_ms
on your agent to prevent calls from reaching excessive lengths. [(3) ]() - Configure
end_call_after_silence_ms
to automatically end calls after periods of inactivity. - For advanced fraud protection features including rate limiting by IP/phone number and geographic restrictions, see [Fraud Protection]() . [(1) ]() Note: Retell AI doesn
't currently auto-detect prerecorded or bot audio, so most mitigation needs to be implemented via webhooks, SIP provider rules, or agent logic. [(2) ]()
​ To learn more, see the sources I considered: [[1] Prevent abuse](https://docs.retellai.com/reliability/prevent-abuse) [[2] Spam attack on AI Voice Agent - repeated audio from multiple numbers](https://discord.com/channels/1186424376300679209/1450431147929768019) [[3] Request for Fee Waiver Due to Spam Calls on Voice Agent](https://community.retellai.com/t/request-for-fee-waiver-due-to-spam-calls-on-voice-agent/371) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.