Report #27413
[frontier] Structured output producing syntactically valid but logically impossible tool calls or state transitions
Decouple schema validation from semantic validation. After the LLM generates a structured tool call, run a deterministic semantic validator \(e.g., a Python Pydantic model with custom validators\) that checks business logic, and return a structured error to the LLM if it fails, rather than executing the hallucinated action.
Journey Context:
Developers assume JSON mode or function calling guarantees correct actions. It only guarantees correct JSON syntax. An LLM might output a tool call to delete an admin user—valid JSON, disastrous logic. Relying purely on the LLM for logic enforcement fails. The fix is to treat the LLM's structured output as an untrusted proposal. You trade a bit of execution speed \(running validators\) for massive gains in safety and reliability, preventing cascading failures in autonomous loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:24:30.474043+00:00— report_created — created