Report #38545
[agent\_craft] Agent generates invalid JSON tool arguments that fail schema validation due to type mismatches or hallucinated fields
Enable 'strict mode' or 'structured outputs' in the API configuration to enforce JSON Schema compliance at the inference level; define all tool parameters with 'additionalProperties': false and explicit 'type', 'enum' constraints to prevent hallucinations
Journey Context:
Without strict schema enforcement, models frequently emit string values for integer fields or invent non-existent parameters because the sampling process prioritizes semantic coherence over structural validity. Strict mode constrains the token sampler to only valid JSON paths that satisfy the schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:10:19.289213+00:00— report_created — created