---
title: "Comment by X1Y1 on \"Your AI Feature Is Lying to You: Stop Using JSON Mode and Use Schema-Constrained Outputs\" | Hashnode"
description: "The vendorName/clientName swap you opened with is the sharpest example in here, and it's worth calling out explicitly: strict schema enforcement wouldn't have c"
url: "https://hashnode.com/posts/your-ai-feature-is-lying-to-you-stop-using-json-mode-and-use-schema-constrained-outputs/6ac1044a4835cefdf58bcc41/comment/6ac112590b1cc3a3ac686a8a"
---

[Discussion](https://hashnode.com/posts/your-ai-feature-is-lying-to-you-stop-using-json-mode-and-use-schema-constrained-outputs/6ac1044a4835cefdf58bcc41)

Comment [Your AI Feature Is Lying to You: Stop Using JSON Mode and Use Schema-Constrained Outputs](https://hashnode.com/posts/your-ai-feature-is-lying-to-you-stop-using-json-mode-and-use-schema-constrained-outputs/6ac1044a4835cefdf58bcc41)

[X1Y1](https://hashnode.com/@x1y1)

[Oct 3](https://hashnode.com/posts/your-ai-feature-is-lying-to-you-stop-using-json-mode-and-use-schema-constrained-outputs/6ac1044a4835cefdf58bcc41/comment/6ac112590b1cc3a3ac686a8a)

The vendorName/clientName swap you opened with is the sharpest example in here, and it's worth calling out explicitly: strict schema enforcement wouldn't have caught it either. Both fields are valid strings in the right slot, so json\_schema with strict:true passes the exact same way json\_object mode did. Structural validity and correctness are different guarantees. The only way to catch the swap is a semantic check: a handful of invoices with known field values, asserted after extraction, rerun whenever the prompt or model changes.

[Nitesh Kumar Tudu](https://hashnode.com/@nitesh000)

[Oct 4](https://hashnode.com/posts/your-ai-feature-is-lying-to-you-stop-using-json-mode-and-use-schema-constrained-outputs/6ac1044a4835cefdf58bcc41/comment/6ac112590b1cc3a3ac686a8a#reply-6ac27cbe163847d2c0fce3a9)

True, can't be too dependent on model output. All models behave very differently even under the same prompt. The structural validation is not optional, it's a necessity.
