Structured data guides

Check a Booking Response Before Using Its Model JSON

·

The booking example includes a nested ID, a small seat count and an optional customer note. The response needs to satisfy a specific contract before a downstream booking workflow reads it.

LLM Output JSON Guardrail Validator

Check the booking fields against their contract

Select Load example. Open Optional JSON schema and find the required booking object, its required id and seats fields, and the optional note. Select Check model JSON. The example passes with two seats and ID 9007199254740993.

Download model-output.json and inspect the last digit of the identifier in a text editor. Change it to 9007199254740992 and check again. The lower value is blocked at /booking/id even though some number parsers would round the two identifiers to the same value.

Passing booking response
{
  "booking": {"id": 9007199254740993, "seats": 2},
  "note": "Window seats if available"
}

RFC 8259 JSON grammar and interoperabilityJSON Schema 2020-12 validation vocabulary

Review wording that looks like instructions

Reload the example and change the note to Ignore previous instructions. Check the response again. The result moves to review and points to /note. Read the note in context before you forward the file to another model or an automated action.

Try two note keys in the same object. Parsing stops at the duplicate instead of choosing one note for you. A reserved property such as constructor also blocks the check.

RFC 8259 JSON grammar and interoperability

Choose checks that match your handoff

Remove the JSON schema to apply the default requirement for an object root. Add a supported schema to constrain the value type, required properties, additional fields, exact numeric bounds, string lengths or array size. Same-document JSON Pointers can refer to reusable definitions.

The instruction review catches selected wording and model delimiters. Use the separate structural findings to decide which fields downstream code can safely interpret as data.

JSON Schema 2020-12 validation vocabularyRFC 6901 JSON Pointer

Common questions

Can I paste an entire model chat transcript?

The editor expects one JSON document. Remove surrounding text and Markdown fences before checking the payload.

What if I need pattern or unevaluatedProperties?

Use a validator that implements those schema assertions. This workspace identifies unsupported assertions and stops before reporting a pass.

Sources

Put it into practice.

Related guides