Report #80193
[frontier] Agents fail when tool schemas drift or when they hallucinate parameters for tools they don't fully understand
Use JSON Schema/Zod not just for validation but as runtime contracts: generate structured tool descriptions that include not just types but constraints \(min/max, enums, regex\) and use these to generate few-shot examples dynamically. Validate both input AND output against schema at runtime, treating schema violations as recoverable errors with automatic retry.
Journey Context:
Standard developers use Zod or JSON Schema only for type validation at the boundary. The emerging pattern is treating schemas as executable contracts: the schema drives the prompt engineering \(generating examples of valid inputs\), the LLM is constrained to structured output \(OpenAI's structured outputs or guided decoding\), and violations trigger automatic recovery flows \(clarification questions, schema-constrained retries\). This shifts failure modes from silent hallucinations to explicit contract violations. Tradeoff: stricter schemas reduce flexibility but increase reliability. Common mistake: using loose 'any' types or optional fields where constraints are actually known.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:12:39.766854+00:00— report_created — created