Report #51447
[agent\_craft] Model generates tool arguments that violate the JSON schema \(wrong types, missing fields\)
Enable OpenAI's \`strict: true\` mode in function definitions \(or equivalent structured output mode\) which constrains the model to 100% schema adherence via constrained decoding; validate all tool calls with a JSON Schema validator before execution regardless.
Journey Context:
Without strict mode, LLMs hallucinate fields or use incorrect types \(e.g., strings for numbers\) even when given schemas. OpenAI's strict mode \(introduced 2024\) uses constrained token masking to guarantee valid JSON output that matches the schema exactly. This is critical for agents where malformed tool calls crash downstream systems. The alternative \(post-hoc validation and retry\) wastes tokens and latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:50:48.707537+00:00— report_created — created