When an agent gives a wrong answer, first find out which layer caused it. Open the call in Call History and work through the transcript:
- Did the agent hear the right words? Compare the recording with the
userlines. If not, see Transcription accuracy. - Did it have the right information? Check the dynamic variables in the Data tab, and the knowledge base chunks it retrieved in Knowledge and workflows.
- Did it call the right tool with the right arguments? Check the tool call and tool result items in the transcript.
- Did it follow the prompt? If the inputs were right, the prompt or model is the cause.
Reproduce it#
Fix the problem where you can repeat it:
- Test LLM in the builder chats with the agent in text, using the same prompt, tools and knowledge base. Paste the caller's words from the transcript to reproduce a turn.
- The test panel's turn debugging lets you inspect each turn of a test conversation.
- Simulation runs the agent against an AI-simulated caller, and test cases let you save a scenario and re-run it after every change.
See Test for these tools.
Causes and fixes#
Made-up answers#
| Cause | Fix |
|---|---|
| The answer is not in the prompt or knowledge base | Add it to the knowledge base, or tell the agent what to say when it does not know |
| Retrieval returned the wrong chunks | Check Knowledge and workflows on the call. Improve the source documents, and tune the agent's knowledge base settings |
| The prompt invites guessing | Add a rule such as "If the information is not provided, say you will check and offer a callback" |
AI QA scores calls for hallucination and knowledge base recall, so you can find these calls across many conversations.
Wrong tool or wrong arguments#
| Cause | Fix |
|---|---|
| Vague tool descriptions | Say exactly when to call each tool and when not to |
| Arguments in the wrong format | Describe each parameter with an example. Keep tool_call_strict_mode on (the default) so arguments follow the schema |
| A tool result the model misreads | Return short, labelled results from your endpoint |
| A transfer to the wrong number | Use a static destination per tool, or list numbers clearly for inferred destinations; see Debug transfers |
Ignoring the prompt#
| Cause | Fix |
|---|---|
| Prompt too long or contradictory | Shorten it. Move reference material to a knowledge base. The builder's Tokens estimate shows the size |
| The task needs strict steps | Use a multi-prompt agent with states, or a conversation flow with nodes and edges |
| Model too small for the task | Try a larger model and compare in simulations; see Billing for prices |
| Randomness | model_temperature defaults to 0. It is not sent to GPT-5 family models |
| Early details forgotten on long calls | The workspace LLM token limit drops the oldest turns when the history is too long. Raise it, or use collected variables to keep key facts |
Missing or wrong variables#
Unfilled {{variables}} reach the model as written. Set defaults with Default Dynamic Variables, and check the call's Dynamic variables and Collected variables in the Data tab. The precedence is agent defaults, then environment tag, then contact fields, then the request, then values collected during the call, then live overrides.
Off-topic or unsafe replies#
- Turn on
scope_boundariesin the Agent Handbook with ascope_description, so the agent declines unrelated requests and does not reveal its instructions. - Add guardrail
output_topics(for exampleregulated_advice) with afallback_message. Guardrails cost $0.01 per minute.
Compare versions#
When a change makes things worse, compare the published version with the draft and roll back if needed.