How verification works
This is the whole point of MaxModel, so here is the honest mechanism — no hand-waving.
The guarantee
Every claim in a verified answer is backed by a quote that appears character-for-character in a source you supplied. If a quote can’t be found in your sources, the claim is dropped.
The check is deterministic code. There is no second model “grading” the answer — that approach can hallucinate too. A string either is or is not a substring of your source.
The pipeline
A verified.create call runs three steps:
- EXTRACT — one model call (through the gateway) turns the question + your sources into
candidate claims. Each claim comes with a
quotethe model says supports it, and theidof the source it came from. The quotes are not trusted yet. - VERIFY — for each claim, code checks the
quoteagainst the named source’s text.- The source
idmust exist → otherwiseunknown_source. - The quote must be found in that source’s text under the active
mode→ otherwisequote_not_found. - On success, the exact character
range[start, end)in the original source is recorded.
- The source
- ASSEMBLE — grounded claims become the
text(with inline[id]markers) andcitations. Everything that failed verification goes intounsupported, and never appears intext.
Because step 2 is pure string matching, the same input always produces the same verification result — easy to test, impossible to fudge.
strict vs lenient
Both modes are deterministic. They differ only in how forgiving the match is:
| Mode | Matches when the quote equals the source span after… |
|---|---|
strict (default) | normalizing whitespace and case |
lenient | the above, plus tolerating punctuation / diacritic differences |
strict is the safe default. Use lenient when your sources and the model’s quoting differ
only in punctuation (e.g. a dropped comma) and you’d rather keep the claim than drop it.
In both modes the returned range maps back to the original source text, so you can
highlight the exact span even though matching was done on a normalized copy.
What this catches
- Fabricated facts — a number or policy the model invented isn’t in your sources, so its
quote won’t match → dropped into
unsupported. - Misattribution — a real quote pinned to the wrong source
idfails the source check. - Paraphrase-as-quote — if the model paraphrases instead of copying, the quote won’t be verbatim → dropped.
What it does not do
- It does not fact-check your sources. If a source is wrong, a faithful quote of it is still “grounded.” MaxModel guarantees traceability to your sources, not ground truth.
- It does not retrieve. You decide what goes into
sources. - It is not a moderation or safety filter.
Honest degradation
MaxModel fails loud rather than returning ungrounded text as if it were verified:
- No
sourcesandallowUngroundedis false →400 no_sources. - The model returns an unparseable structure even after a retry →
502 extraction_failed. - Set
allowUngrounded: trueto explicitly opt into a flagged plain answer (grounded: false) when grounding isn’t possible.