Report #8375
[tooling] Tool result schemas allowing hallucinated fields in structured output
Set 'additionalProperties: false' and explicitly define 'required' arrays in JSON Schema for both input and output; validate with strict parsers \(Zod, AJV\) server-side before returning
Journey Context:
Developers define tool inputSchema but omit 'additionalProperties: false' \(defaults to true per JSON Schema spec\). The LLM hallucinates extra fields \(e.g., 'confidence': 0.9, 'notes': '...'\) which break downstream parsers expecting exact schemas. Similarly, tool results \(if the server returns structured JSON\) must be validated before serialization. Common error: trusting the LLM to 'follow' schema without strict validation, or using TypeScript types instead of runtime validation. The fix: Always use 'additionalProperties: false' in JSON Schema \(part of spec\) and validate results with Zod/AJV before returning to client. This forces exact schema adherence and prevents 'field injection' hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:19:27.513592+00:00— report_created — created