Check your voice agent prompt for zero width character immediately after creating the first draft of the prompt.
What are zero-width characters in Voice Agent Prompt?
Your voice agent prompt shows {{current_time_America/New_York}}. It looks clean. But one character after the closing braces is a zero-width space, and you can't see it.
A zero-width character is a real Unicode character that renders as nothing. It has a code point, it counts in the character count, and it gets stored and sent. It just takes up no visible space on the screen.
The common ones are the zero-width space (U+200B), the zero-width joiner (U+200D), the zero-width non-joiner (U+200C), and the byte-order mark (U+FEFF).
They get in through copy-paste.
Google Docs, Notion, web pages, and some editors inject them as formatting artefacts. You paste a block of prompt text and carry an invisible passenger with it.
You can not manually delete them either.
Zero-width characters can break a Voice Agent.
For example, a zero-width space next to {{current_time}} can stop the variable from populating.
Retell matches the exact token between the braces.
A hidden character on the border can break that match, and the literal text {{current_time}} gets passed to the model instead of the real time.
The same failure can hit any string match in your agent.
- Dynamic variables don't substitute.
- Tool and function names don't resolve.
- Conditional logic that compares strings silently fails.
It can also break JSON.
A stray zero-width character inside an agent config or import file makes the JSON invalid, and the import fails with an error that points to nowhere useful.
The deeper cost is debugging time.
The character is invisible, so when the agent misbehaves, you stare at a prompt that looks perfect and find nothing.
You can lose hours or even days to a problem with no visible cause.
How to detect Zero-width characters in an agent prompt?
Step-1: Copy the agent prompt straight from Retell AI.
Step-2: Navigate to an invisible text detector tool like: https://originality.ai/blog/invisible-text-detector-remover

Step-3: Paste your agent prompt in the tool input text box. You should now see the results on the right:

Step-4: Search for zero-width space in the prompt:

Finding and Removing Invisible Characters with Windows PowerShell.
I don’t recommend fixing the zero-width space issue via invisible text detector tools like originality.ai, as it can mess up the formatting of your voice agent prompt. Instead, I recommend that you run Python script to find and remove such issues on your local machine.
A local Python script does exactly what you tell it and nothing else. So every other character, including the em-dashes, arrows, and visible markers, is provably untouched.
You can read the script and know precisely what it will do before you run it.
A web tool is a black box. You paste the agent prompt in, something runs, text comes back, and you have to trust that what came back differs only where you wanted.
With an agent prompt that depends on specific characters in specific places, that trust is the weak link.
You want to remove the stray ones while keeping the visible characters you put there on purpose: em-dashes (U+2014), arrows (U+2192), and so on.
Follow the steps below to find and remove invisible characters by using a Python script on your local machine:
Step 1. Check that Python is installed on your machine.
Open Windows PowerShell and run:
python --version
A version number means you're set. If it opens the Microsoft Store or errors, install Python from python.org first and tick "Add Python to PATH" during install.
Step 2. Copy your agent prompt from Retell, paste it and save it in a notepad file.
Save your file as ‘agent-prompt.txt’ in the ‘Downloads’ folder.
Step 3. Move to the folder with your file.
In our case, it is the ‘downloads’ folder.
cd downloads
Replace downloads with wherever your file lives. The scripts below get created in this same folder, so keep everything together.
Step 4. Create the detection script.
Paste this whole block into PowerShell. It writes a file called check.py into the current folder.
@'
import sys
path = sys.argv[1]
text = open(path, encoding="utf-8").read()
found = False
for i, c in enumerate(text):
if ord(c) > 127:
print(f"index {i}: U+{ord(c):04X} {repr(c)}")
found = True
if not found:
print("No non-ASCII characters found.")
'@ | Out-File -FilePath check.py -Encoding utf8
Confirm it landed:
dir check.py
Step 5. Run the detection script.
python check.py "agent-prompt.txt"
This prints every non-ASCII character, its position in the file, and its code point.
Read the output like this:
- U+2014, U+2192, U+2705, U+274C, U+2026, U+2260 are visible characters you meant to include. Leave them.
- U+200B, U+200C, U+200D, U+FEFF, U+2060 are stray invisibles. These are the ones to remove.
Example of a stray showing up in the output:
index 885: U+200B '\u200b'

If the full list is long and hard to scan, use the tighter check in Step 6 instead, which flags only the strays.
Step 6. Optional: scan for strays only.
This script ignores the characters you want and reports only the problematic ones.
@'
import sys
path = sys.argv[1]
text = open(path, encoding="utf-8").read()
strays = {0x200B, 0x200C, 0x200D, 0xFEFF, 0x2060, 0x00A0, 0x180E, 0x202F}
found = False
for i, c in enumerate(text):
if ord(c) in strays:
print(f"index {i}: U+{ord(c):04X} stray invisible")
found = True
if not found:
print("Clean - no stray invisible characters found.")
'@ | Out-File -FilePath strays.py -Encoding utf8
python strays.py "agent-prompt.txt"
If it says "Clean", you're done. No need to run the cleaner. If it lists anything, go to Step 7.
Step 7. Create the cleaner script.
This script removes the stray characters and writes a separate clean copy, leaving your original untouched.
@'
import sys
path = sys.argv[1]
text = open(path, encoding="utf-8").read()
strays = ["\u200B", "\u200C", "\u200D", "\uFEFF", "\u2060", "\u180E", "\u202F"]
for ch in strays:
text = text.replace(ch, "")
out = path.rsplit(".", 1)[0] + "_clean.txt"
open(out, "w", encoding="utf-8").write(text)
print(f"Cleaned file written to: {out}")
'@ | Out-File -FilePath clean.py -Encoding utf8
Step 8. Run the cleaner.
python clean.py "agent-prompt.txt"
This creates agent-prompt_clean.txt next to the original.
Step 9. Verify the clean copy.
Run the detection script again on the cleaned file:
python check.py "agent-prompt_clean.txt"
The stray code points should be gone.
Once the strays are gone, paste the clean file into Retell, and the token is safe.
Other Articles on Voice AI.
- State Machine Architectures for Voice AI Agents.
- Missing Context Breaks AI Agent Development.
- Avoid the Overengineering Trap in AI Automation Development.
- Retell Conversation Flow Agents - Best Agent Type for Voice AI?
- How To Avoid Billing Disputes With AI Automation Clients.
- Don't 'Build' AI Automation Workflows, 'Code' Them.
- Critical Aspect of Prompt Engineering - Domain Parameters.
- Zero Shot vs Single Shot vs Multi Shot Prompting.
- How to Build Reliable AI Workflows.
- Stop Building AI You Can't Fix.
- Automating 100% of your workflows is a disaster waiting to happen.
- How to build Voice AI Agent that handles interruptions.
- AI Automation Without CRM Is Useless for Business Growth.
- Structured Data in Voice AI: Stop Commas From Being Read Out Loud.
- Why Your Voice AI Sounds Robotic and How to Fix It.
- Why You Need an AI Stack (Not Just ChatGPT).
- AI Default Assumptions: The Hidden Risk in Prompts.
- Vibe Coding Fails Without Context and Expertise.
- How to make your Voice AI Agent Date & Time Aware.
- Why AI Agents lie and don't follow your instructions.
- How to Write Safer Rules for AI Agents.
- Two-way syncs in automation workflows can be dangerous.
- Using Twilio with Retell AI via SIP Trunking for Voice AI Agents.
- The Realistic Latency Target for Voice Agents.
- The required-field loop that breaks voice agents.
- Why your Voice prompt needs a clean-up pass.
- When to split your voice agent - The Bleed Test Framework.
- Abuse Ladder in Voice AI.
- Understanding Retell AI Transfer Screening Agents.
- The 80/20 Rule of Voice Agent Development.
- Retell AI Current Time Awareness has a reliability problem.
- Every dynamic variable in voice agent needs a fallback.
- When your Voice AI grader is wrong, not your agent.
- Voice Agent Prompt Formatting Matters Lot More Then You Think.
- Most AI Projects Fail. But Yours Will Succeed.
- Run both Voice AI agent and test simulator on the same model.
- Four LLM Failure Modes and One User Failure Mode.
- What over 1000 Hours of AI Training Taught Me.
- Zero-Width Characters in Voice Agent Prompts.
- Reducing Voice Agent Latency by Testing Different TTS Engines.