Grounding Claims Against Supplied Facts

Separate what your records establish from what an application merely asserts — the core pattern behind LLM-output guardrails

All recipes· ml· 8 minutesintermediateen
Instance: localhost:8080

Opens your running SynapCores (Grounding Claims Against Supplied Facts will be staged for a preview — nothing runs until you click Run). No instance yet? Install free in ~30s.

Share

Grounding Claims Against Supplied Facts

Objective

An application — often an LLM — states things about your records. Some restate what the record says; some are predictions dressed as facts. Verify each statement against the record text and keep the unsupported ones out of customer-facing output.

Step 1: A statement the record establishes

Default thresholds (0.6) apply when none are supplied:

curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{
    "model": "nli-default",
    "statement": "Shipment K9 is recorded as delivered.",
    "truth_anchors": ["The supplied shipping ledger records shipment K9 as delivered."],
    "closed_world": false
  }' http://localhost:8080/v1/ai/nli/verify

Expected (verified on v2.1.1-ce): verdict TRUTH, entailment 1.00 — a faithful restatement of the ledger.

Step 2: A prediction the record does not establish

curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{
    "model": "nli-default",
    "statement": "Shipment K9 will arrive tomorrow.",
    "truth_anchors": ["The supplied shipping ledger records shipment K9 as created."],
    "closed_world": false,
    "contradiction_threshold": 0.6, "entailment_threshold": 0.6
  }' http://localhost:8080/v1/ai/nli/verify

Expected (verified): verdict UNVERIFIED_PLAUSIBLE, neutral 0.69 — "created" establishes nothing about tomorrow. Keep the claim unverified, or run closed-world when product policy permits only claims the evidence explicitly supports.

Use it from your app

This is the guardrail shape for RAG and chat: after generation, verify each claim in the answer against the passages that were actually retrieved, and suppress or caveat anything that isn't entailed. The classifier does not check an external ledger, judge source authenticity, or forecast anything — the caller supplies the facts, which is exactly what makes the check auditable.

Key Concepts Learned

  • "The record says X" and "X will happen" are different claims; NLI separates them cleanly.
  • Grounding against supplied evidence is what makes an AI guardrail reviewable after the fact.

Tags

nliclaim-verificationgroundingllm-guardrailhallucination-checkrest

Run this on your own machine

Install SynapCores Community Edition free, paste the SQL or Cypher above into the bundled web UI, and watch it run.

Download Free CE