Issue
Invalid JSON Output
The AI returns malformed JSON or structured output that cannot be parsed.
What This Looks Like
The AI returns something that looks like JSON or structured output, but the result will not parse. The user may see broken braces, unescaped quotes, trailing commas, mixed prose inside the JSON, comments inside the object, or an output block that a parser rejects even though a human can understand the intent.
Why It Matters
Structured output often sits between the AI and another system. If the JSON is invalid, downstream parsing, validation, importing, automation, or tool execution can fail immediately. This turns a small-looking formatting failure into a workflow blocker.
Structural Signal
A structured output contract exists, but the generated response violates the parseable form required by the consumer. The issue is not whether the answer is semantically useful; it is whether the output can cross the interface boundary as valid structured data.
Common Triggers
- The prompt asks for JSON but also invites explanation or commentary
- Format constraints are weak or incomplete
- The output mixes prose and structured data
- The model optimizes for readability instead of parseability
- Required schema rules are implied but not enforced
- The response includes markdown, comments, or surrounding text where raw JSON was required
When to Use This Issue
Use this Issue when the central failure is that generated JSON or structured output cannot be parsed by the expected consumer.
When Not to Use This Issue
Do not use this Issue when the JSON parses successfully but contains wrong values, missing fields, extra fields, or wrong field types. Those are separate structured-output Issues.
Category
Primary Pattern
Declared Patterns
Schema Breakage
A structural condition where an instance, graph, payload, or object violates the type, shape, or rule requirements of a declared schema.
Interface Mismatch
A structural condition where observed interface behavior, shape, or exchange differs from the declared interface contract.
Constraints Underspecified
A structural condition where declared constraints are insufficient to eliminate ambiguity or multiple admissible states.
Derived Primary Lenses
Constraint Sufficiency Lens
Evaluates whether declared constraints are sufficient to eliminate structural degrees of freedom.
Interface Contract Lens
Compares declared interface structure to observed runtime structure to detect contract deviations.
Invariant Lens
Verifies that declared invariants are structurally enforceable and not contradicted by observed structure.
Derived Secondary Lenses
Conflict Lens
Detects mutually incompatible constraints, claims, states, or declarations that cannot be simultaneously satisfied.
Determinism Lens
Evaluates whether identical structural inputs produce equivalent structural outputs across repeated executions.
Normalization Lens
Transforms structurally equivalent variants into a canonical form to prevent false divergence.
Variance / Entropy Lens
Measures structural variability across repeated or comparable evaluations and identifies divergence beyond expected bounds.
Search Intents
- AI invalid JSON
- ChatGPT malformed JSON
- JSON parse error AI output
- LLM output invalid JSON
- AI gave JSON that will not parse
- malformed structured output