The Assertions section appears only on run items that LangSmith Engine proposed as offline examples. It does not appear on other runs, on thread items, or in pairwise queues. Assertions are available in the LangSmith UI only.
Review proposed assertions
To review and save the assertions Engine proposes:- On an Engine issue, click Engine proposed N examples, then click Edit in annotation queue. For details, see Add offline examples.
- In the annotation queue, find the Assertions section in the side panel. Engine fills it with its proposed assertions, and the run shows a Proposed by Engine banner.
-
Edit each assertion’s key, a short summary of the claim (for example,
must_cite_sourceormust_not_invent_url), and its one-sentence comment describing the claim. The key is free-form. Themust_andmust_not_prefixes are a naming convention. LangSmith does not treat them specially. - (Optional) Click + Add to add an assertion, or click the delete icon on a row to remove it. While the run has assertions, LangSmith replaces the run’s outputs with a read-only preview of the assertions, labeled as reference outputs. This preview is what gets saved to the dataset. The run’s actual output is not saved, because assertions describe what a correct answer should include, not what this run produced. To edit the run’s Inputs before you save the example, such as to refine the prompt, enable Classic Trace View for the queue. The outputs stay locked to the assertion preview while any assertions remain.
- Click Add to Dataset & Next in the side panel footer (keyboard shortcut: ⌘ Enter on macOS or Ctrl Enter elsewhere). LangSmith adds the current run to the queue’s default dataset, or prompts you to pick one if no default is configured. The queue then moves you to the next run.
outputs field is stored as JSON. For example:
inputs field stores the run’s inputs, or your edited version if you changed them. See Example data format for the full shape of a saved example.
Evaluate against assertions
Write an offline evaluator that reads the saved assertions fromreference_outputs["assertions"] and returns one feedback score per assertion. The minimal shape:
- LLM-as-a-judge: For each assertion, prompt a model with the application’s output and the assertion’s
comment, and have it return a score. Best when claims are subjective or hard to verify mechanically. - Code-based checks: For each assertion, run a deterministic check keyed off the assertion’s
key, such as a regex match, schema validation, or substring presence. Best when the claim has a crisp, mechanical answer. - Partial-credit scoring: Return a numeric score (for example, between 0.0 and 1.0) instead of a boolean to grade on a scale and give “partial credit” to outputs that fulfill some, but not all, claims.
Connect these docs to your agent of choice via MCP for real-time answers.

