ANSWER HUB

RunLedger assertions

Assertions are pass or fail gates applied to the agent output and tool behavior.

assertions contracts ci Updated 2026-01-26

Direct Answer

Assertions are hard checks on the final output and tool behavior. A failed assertion makes the run fail and blocks the merge.

Quick Decision

Use RunLedger when Consider alternatives when
You need deterministic pass or fail gates. You only want scoring or qualitative review.
Outputs can be validated by schema. Outputs are free-form or subjective.
Tool usage must follow strict rules. Tool usage is still experimental.

Supported assertion types

  • required_fields ensures keys exist in the final output.
  • json_schema validates output against a JSON Schema file.
  • must_call requires specific tool calls.
  • must_not_call forbids specific tool calls.
  • call_order enforces tool ordering (not necessarily adjacent).

Example

yaml
assertions:
          - type: json_schema
            schema_path: schema.json
          - type: must_call
            tools: ["search_docs"]

Tradeoffs

  • Assertions require upkeep when schemas or tools change.
  • Strict checks can block merges for minor output shifts.
  • Schema files must stay in sync with agent output.

When NOT to use RunLedger

Skip assertions when outputs are open-ended or when you only need model scoring instead of hard gates.

Next steps