---
title: "Give the model a way to say it does not · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/allow-unknown
updated: 2026-10-20
licence: "All rights reserved"
---

# Give the model a way to say it does not know

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Structured output and tools](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools)
- Rule: Give every schema field the model may not be able to fill an explicit "unknown" value or null. Never force it to invent a plausible answer.
- How: Strict structured output always fills required fields. Without an escape value the model invents one, such as a date or an order number. Add `unknown` to enums and make fields nullable where the input may lack them. Treat `unknown` in code as "ask the user" or "send to a person". Put cases with missing information in the eval set and expect `unknown` there.
- Check: Run the eval cases that lack the needed information. Each returns `unknown` or null in the right field, and none returns an invented value.

Example:

```ts
const Invoice = z.object({
  invoiceNumber: z.string().nullable(),
  dueDate: z.iso.date().nullable(),
  currency: z.enum(['EUR', 'SEK', 'USD', 'unknown']),
});
```

```python
class Invoice(BaseModel):
    invoice_number: str | None
    due_date: date | None
    currency: Literal["EUR", "SEK", "USD", "unknown"]
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/allow-unknown`.

- Previous: [Retry a bad answer and then fall back](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/retry-invalid-output)
- Next: [Design tools like a small public API](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools/tool-design)
- [Structured output and tools](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools)
