ANSWER HUB
RunLedger assertions
Assertions are pass or fail gates applied to the agent output and tool behavior.
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_fieldsensures keys exist in the final output.json_schemavalidates output against a JSON Schema file.must_callrequires specific tool calls.must_not_callforbids specific tool calls.call_orderenforces 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.