https://retellai.com/?utm_source=discord&utm_medium=seo logo
we have a component that is responsible to verify ...
# ❓・ai-evy-support
a
@AI Evy we have a component that is responsible to verify a person date of birth. we provide the date of birth to the agent and ask it to not disclose it to the person and give the person 3 attempts to verify the DOB, otherwise, they can't continue the call. We are getting mixed results where sometimes it works as it should and sometimes it continues the call although the person provided the wrong DOB. This is the prompt: Confirm the person's date of birth: "In order to continue the call, what is your date of birth?" - make sure it matches the date comma separated {{peopleDOB}}. The date should match on day, month and year, it can't be a partial match. - If incorrect, give the person 2 more chances and then hang up. - NEVER DISCLOSE the date of birth to the person you are speaking with.
a
Thanks for tagging me @AmiKlein. I'll look through relevant sources and get back to you shortly.
### Answer Your issue—where the agent sometimes allows the call to continue after three failed date of birth attempts—relates to prompt enforcement and transition logic. In Retell AI, prompt instructions alone may not always guarantee strict adherence, especially for multi-step verification or when the agent must terminate the call after a specific condition [(1) ]() [(2) ]() . Here are recommendations based on documented best practices: - Use explicit, step-by-step instructions in your prompt, clearly defining the conditions for each attempt and the requirement to hang up after three failures [(1) ]() . - In multi-state agents, ensure that transitions (e.g., from verification to call termination) are defined with precise triggers, not just general instructions [(3) ]() [(2) ]() . - If you're using dynamic variables (like {{peopleDOB}}) , make sure they are passed correctly and referenced explicitly in your prompt logic [(2) ]() . - For critical logic (like "hang up after 3 failures") , consider breaking the verification into separate states or nodes, each handling a single attempt and the transition to the next or to termination [(3) ]() [(2) ]() [(4) ]() . - If the agent sometimes deviates from expected behavior, review the transition logs and test in both chat and v
oice modes; differences can arise between environments [(2) ]() [(4) ]() . For better reliability: - Make your tool-calling or transition triggers very explicit (e.g., "If the user's response does not exactly match {{peopleDOB}}, increment a failure count. If the failure count reaches three, end the call immediately") [(1) ]() [(2) ]() . - Avoid complex, overloaded states; split responsibilities into smaller, easier-to-debug components [(3) ]() [(2) ]() [(4) ]() . If you continue to see inconsistent results, check that your agent version is published and that you are testing the same published agent in both environments [(4) ]() .
​ To learn more, see the sources I considered: [[1] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[2] Agent follows prompt 100% on Test Audio but deviates a lot when used via API from my live platform](https://discord.com/channels/1186424376300679209/1273558161361469483) [[3] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[4] Discord message from @xgabrielx_1 on 2025-10-31](https://discord.com/channels/1186424376300679209/1294891368505937952/1433800333523550320) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.