# Verify strict JSON Schema enforcement via response_format

> Source: LMSpeed (https://lmspeed.net) — https://lmspeed.net/audit/structured-output. When citing or reusing this content, credit "LMSpeed" and link to https://lmspeed.net/audit/structured-output.

Verify whether OpenAI-compatible relays preserve response_format json_schema strict mode (additionalProperties: false) without silent stripping.

Canonical URL: https://lmspeed.net/audit/structured-output
Last updated: 2026-12-03T18:58:42.592Z (site data revision; page date not supplied)

Reproduction and quotation must name LMSpeed, link to the canonical HTML URL, and retain individual source citations.

Detect relays that quietly strip strict schema constraints or emit Markdown-fenced prose instead of schema-valid JSON.

Capabilities & Context LimitsDefault suite@lmspeed/audit v0.3.3 · independent-2026-11-24.1

[Run the All-in-One audit](https://lmspeed.net/audit)[Fingerprint Detection](https://lmspeed.net/audit/model-fingerprint)

## Recent public reports

Redacted audit reports that included this probe.

- [9r***.dpdns.org

osqoof/gpt-6

Audited at · Dec 2Passed](https://lmspeed.net/audit/N40mYlV6Wi7FIZUZ)

- [9r***.dpdns.org

osqoof/gpt-6

Audited at · Dec 2Passed](https://lmspeed.net/audit/ioQ8Fhj5sRl6FSnv)

- [ap***.ai

claude-opus-5-5

Audited at · Dec 2Passed](https://lmspeed.net/audit/UE6_9YowLYxNwcPG)

- [ap***.cc

standard/claude-opus-5.5

Audited at · Dec 2Did not pass](https://lmspeed.net/audit/tGHasfcva0AHdZFy)

- [fr***.in

deepseek-v4.1-flash-1017

Audited at · Dec 2Passed](https://lmspeed.net/audit/hiSam9nJebv3-v3K)

- [ap***.vip

Claude Opus 5.5

Audited at · Dec 1Passed](https://lmspeed.net/audit/2JpeaBJGrkHe0Mvz)

## Overview & Risk Context

Structured output auditing submits a constrained response_format JSON Schema enforcing required fields, enums, and additionalProperties: false, then validates every byte returned.

### What this check measures

Checks strict `json_schema` adherence including nested required keys, enum constraints, and absence of unrequested extra fields.

### Why this risk matters

Gateways translating OpenAI payloads to older endpoints frequently discard `response_format` or drop `strict: true`, breaking production data extractors.

### When to run this check

Run before deploying structured classification, extraction pipelines, or deterministic UI-generation backends.

A model instructed nicely in prose may output valid JSON 90% of the time—making silent stripping of `response_format: { type: "json_schema", strict: true }` hard to notice until edge keys or Markdown code fences crash production parsers.

## Detection Methodology, Evidence & Limitations

Issues strict Schema enforcement requests inside @lmspeed/audit with adversarial prompt temptation toward extra keys/prose and strict schema parsing.

- **1. Probe**

Send a request enforcing `response_format.type = "json_schema"` with `strict: true`, enums, and `additionalProperties: false`.

- **2. Inspect**

Parse raw completion text with zero cleanup heuristics (no silent Markdown fence stripping) and validate against the schema.

- **3. Conclude**

Fail cleanly on wrapper prose, invalid JSON, missing required fields, or unauthorized extra keys.

### How to read the verdict

Clean raw JSON strictly obeying schema types and `additionalProperties: false` passes; prose wrapping or schema violations trigger warn/fail.

### Evidence basis & thresholds

Raw JSON parser result and strict schema validator compliance across required keys, types, enums, and additionalProperties.

### Scope limits & abstention conditions

Validates endpoint schema compliance on representative schemas; deeply recursive custom schemas may still hit provider-specific complexity caps.

### Verification Sources & Baselines

Implemented in @lmspeed/audit v0.3.3 (ruleset independent-2026-11-22.2); supplementary capability/injection design cross-checked against Veridrop, LLMprobe-engine, and meow-llm-detector specs.

- [lmspeed/audit (v0.3.3)](https://github.com/nexmoe/lmspeed-audit)Open-source LMSpeed probe engine, catalog registry, and calibrated fingerprint protocols.

## Frequently Asked Questions

### Why fail responses wrapped in ```json Markdown code fences?

True strict `json_schema` decoding operates at grammar/token level and returns pure JSON—fences usually signal that the relay stripped `response_format` and relied on plain prompting.

### Why test additionalProperties: false specifically?

Prompted JSON often drifts by adding helpful commentary fields; strict schema enforcement guarantees closed field sets.

### Does every OpenAI-compatible model support json_schema strict mode?

No, older models support only `json_object` or unstructured text—this check makes that incompatibility visible before deployment.

### Which related check tests structured function arguments?

Run Tool Permissions (`tool-calling`) to check function-call schema adherence alongside `response_format`.

## All audit checks by category

Explore every single-check audit tool grouped by risk domain, with Fingerprint Detection pinned first for model-authenticity verification.

### Fingerprint Detection

Pinned · Priority Group3

- [Model distribution fingerprint](https://lmspeed.net/audit/model-fingerprint)

- [Numeric fingerprint screening](https://lmspeed.net/audit/numeric-fingerprint)

- [Tokenizer fingerprint](https://lmspeed.net/audit/tokenizer-fingerprint)

### Prompt & Injection Security

6

- [Token injection](https://lmspeed.net/audit/token-injection)

- [Prompt extraction](https://lmspeed.net/audit/prompt-extraction)

- [Instruction conflict](https://lmspeed.net/audit/instruction-conflict)

- [Jailbreak identity](https://lmspeed.net/audit/jailbreak-identity)

- [Conditional injection](https://lmspeed.net/audit/conditional-injection)

- [Web3 injection](https://lmspeed.net/audit/web3-prompt-injection)

### Response & Stream Integrity

5

- [Stream integrity](https://lmspeed.net/audit/stream-integrity)

- [Stream consistency](https://lmspeed.net/audit/stream-consistency)

- [Tool substitution](https://lmspeed.net/audit/tool-substitution)

- [Error leakage](https://lmspeed.net/audit/error-leakage)

- [Latency variance](https://lmspeed.net/audit/latency-variance)

### Capabilities & Context Limits

7

- [Context window and recall](https://lmspeed.net/audit/context-window)

- [Tool permissions](https://lmspeed.net/audit/tool-calling)

- Structured JSON output

- [Image understanding](https://lmspeed.net/audit/image-understanding)

- [PDF understanding](https://lmspeed.net/audit/pdf-understanding)

- [Quality canary](https://lmspeed.net/audit/quality-canary)

- [Quality comparison](https://lmspeed.net/audit/quality-comparison)

### Related LMSpeed benchmarks & methodology

- [Full 25-Check Provider Audit](https://lmspeed.net/audit)

- [3-Stage Fingerprint Pipeline](https://lmspeed.net/audit#fingerprint-detection)

- [LLM API Speed Test](https://lmspeed.net/speed)

- [Provider Directory](https://lmspeed.net/provider)

- [Model Directory & Pricing](https://lmspeed.net/model)

- [Benchmark Methodology](https://lmspeed.net/methodology)

---
Cite as: Verify strict JSON Schema enforcement via response_format — LMSpeed, https://lmspeed.net/audit/structured-output (retrieved 2026-12-04)
