Report #25265
[architecture] LLM orchestrator hallucinates the name of a target agent during a handoff, routing the task into the void
Constrain the orchestrator's output using a strict enum or function call schema that only contains the exact string names of valid agents. Map the validated string to the agent object in code.
Journey Context:
When using natural language to decide handoffs \(e.g., 'Route this to the refund\_agent'\), LLMs will occasionally output 'refund\_department' or 'returns\_agent' which don't exist in the system. Relying on fuzzy matching is dangerous. By forcing the LLM to output a structured tool call \(e.g., transfer\_to\_agent\(agent\_name: Literal\['refund\_agent', 'support\_agent'\]\)\), the code layer deterministically maps the string to the agent instance, making hallucinated targets a schema validation error rather than a runtime crash.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:48:44.617718+00:00— report_created — created