Report #12433
[agent\_craft] Strict JSON schema mode reduces hallucinated tool arguments
Enable 'strict' or 'json\_mode' in the API to force the model to conform exactly to the tool schema, preventing hallucination of extra parameters or incorrect types \(e.g., passing a string where an object is required\).
Journey Context:
Without strict mode, models may invent parameters not in the schema or fail to respect required vs optional fields, especially when generating code blocks as arguments. Strict mode constrains the output at the token sampling level, ensuring valid JSON that passes schema validation without client-side retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:54:58.660806+00:00— report_created — created