> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Strict mode omits required field in structured output

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Enabling strict mode on a prompt's structured output"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

**Issue:** Enabling `strict: true` on a prompt's structured output causes a runtime validation error because the `required` array is not automatically added to the schema.

**Cause:** Strict mode does not auto-generate `required` — it must be defined manually for all properties in the schema.

**Resolution:** Add the `required` array to your schema via the UI or JSON schema editor.

## Resolution steps

### Add required property to fields in UI schema editor:

#### Step 1: Open the schema editor

In the prompt editor, open the structured output schema dialog.

#### Step 2: Add `required` to each property

Use the dropdown next to every property's type field and select the `required` option.

#### Step 3: Save the prompt

Click **Update** to save. Verify the `required` array is present in the JSON before navigating away.

### Add `required` directly in the JSON object:

#### Step 1: Open the schema editor

In the prompt editor, open the structured output schema dialog.

#### Step 2: Select the JSON Schema editor view

Open the schema editor view type dropdown and select JSON

#### Step 3: Update JSON schema

Ensure your schema includes a `required` array listing all defined properties:

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "type": "object",
  "required": [
    "reasoning",
    "classification"
  ],
  "properties": {
    "reasoning": {
      "type": "string",
      "description": "The reasoning for why the classification judgement was made"
    },
    "classification": {
      "enum": [
        "good",
        "bad"
      ],
      "type": "string",
      "description": "Classification of whether the content is good or bad"
    },
  },
  "additionalProperties": false
}
```
