How to Check That a Citation Actually Supports the Claim

Three checks for every citation in LLM output: the source exists, the quote is in it, and it supports the claim. Python code for each step and a decision table.

Three connected boxes showing source resolves, quote found in source, and source supports the claim
T
Teja Thota

Building Webcite, the fact-checking and citation API for AI applications.

Checking a citation takes three separate tests: the source exists, the quoted text is in it, and the source supports the claim as written. Each fails on its own. Between 3 and 13% of citation URLs from commercial models and deep research agents were fabricated, according to Rao et al. (April 2026). This guide gives code for each check and when to run it.

Key Takeaways
  • 3 to 13% of citation URLs from commercial models and research agents were fabricated, even with web search.
  • A real, reachable source still fails when it does not say what the claim says; up to 57 percent of citations lacked faithfulness in one study.
  • Run the checks in order: source exists, quote is in the source, source supports the claim.
  • A fuzzy quote match should go to review, never straight to verified.
  • Keep the matched passage with the result so a reviewer can see the evidence in one click.
Citation faithfulness: Whether a cited source actually supports the statement it is attached to, as opposed to being on the same topic or merely existing. A citation can be correct in form and still unfaithful.

Why do LLM citations fail?

LLM citations fail in three distinct ways: the source does not exist, the quote is not in it, or the source does not support the claim. Each needs its own check, and a pass on one tells you nothing about the next.

Fabricated sources are the most visible failure. Rao et al. found 3 to 13% of citation URLs had no record in the Wayback Machine and likely never existed, and 5 to 18% did not resolve, across 10 models and agents on DRBench, according to their 2026 paper. Fabrication persisted when models had web search.

Unfaithful citations are harder to spot. Wallat et al. found that attributed answers often lack citation faithfulness, for up to 57 percent of the citations, according to Correctness is not Faithfulness in RAG Attributions. The model writes the answer from what it already believes and attaches a source afterwards.

Which check catches which failure?

Match each failure to the cheapest check that catches it, and run the cheap checks first. A URL check costs one HTTP request; a support check reads the source and reasons about it.

Check Catches How Webcite call
1. Source exists Fabricated or dead URLs HTTP request, then an archive lookup Source preview, 1 credit
2. Quote is in the source Invented or altered quotes Text match against the fetched page Batch check, 1 credit per item
3. Source supports the claim Real source cited for something it does not say Stance on the claim from the source text Verify with source URLs, 4 credits

Credit prices are from Webcite’s credits documentation. The Free plan includes 100 credits a month.

How do I check that a cited source exists?

Request the URL, follow redirects, and treat a 404, a parked domain or a login wall as a failure. Rao et al.’s urlhealth tool cut non-resolving citation URLs by 6 to 79 times, to under 1%, according to the same reference hallucination paper.

import requests

def resolves(url):
    try:
        response = requests.get(url, allow_redirects=True, timeout=15,
                                headers={"User-Agent": "citation-check/1.0"})
    except requests.RequestException:
        return False
    return response.status_code < 400

A 200 response only proves a page exists. Some sites return 200 for a soft error page, and a page can change after the model read it. If a URL fails, an archive lookup tells you whether it ever existed. Record the final URL after redirects, since the cited one may forward somewhere else.

How do I check that the quote is in the source?

Fetch the source and match the quote against its text, allowing for whitespace, quote marks and line breaks. Webcite’s batch check takes up to 200 quotes per call, each with a URL, inline source text or an uploaded file, at 1 credit per item, according to the batch check reference.

import os
import requests

API = "https://api.webcite.co/api/v1"
HEADERS = {"x-api-key": os.environ["WEBCITE_API_KEY"]}

items = [
    {"id": "c1",
     "quote": "330 meters",
     "url": "https://www.toureiffel.paris/en/the-monument/key-figures"},
]
response = requests.post(f"{API}/verify/batch", headers=HEADERS,
                         json={"items": items}, timeout=(10, 300))
response.raise_for_status()

for result in response.json():
    binding = result["binding"]
    print(result["id"], binding["grounded"], binding["method"],
          result["verification"]["band"])
    print("  closest passage:", binding.get("matched_text"))

Each result reports whether the quote was grounded and how it matched: exact, normalized, fuzzy, reflowed or unbound. A fuzzy match, and a reflowed match from an OCR reading, are capped at needs review and never reported as verified. The closest passage comes back even when the quote is unbound, so a reviewer sees what the source does say. For runs larger than one call, see rate limits, caching and batching.

This check proves the words are in the source. It does not judge whether the claim around them is true, and the meaning field stays not checked unless you supply an assessment.

How do I check that the source supports the claim?

Send the claim with the cited URL to a verification call that reads the source and returns a stance. Webcite’s verify endpoint inspects up to five public HTTPS URLs passed as source URLs and returns a stance for each citation and a verdict for the claim, according to the verify reference.

claim = "The Eiffel Tower is 330 meters tall"
cited = "https://www.toureiffel.paris/en/the-monument/key-figures"

response = requests.post(f"{API}/verify", headers=HEADERS, json={
    "claim": claim,
    "source_urls": [cited],
    "include_stance": True,
    "include_verdict": True,
}, timeout=(10, 300))
response.raise_for_status()
data = response.json()

for group in data.get("claim_groups", []):
    verdict = group.get("verdict") or {}
    print(group["claim"], verdict.get("result"))
    for citation in group.get("citations", []):
        if citation["url"] == cited:
            print("  cited source:", citation.get("stance"),
                  citation.get("stance_explanation"))

Each citation’s stance is supports, contradicts, partially_supports, neutral or inconclusive. The claim’s verdict is supported, partially_supported, contradicted, mixed or unverifiable, according to Webcite’s OpenAPI schema. This call costs 4 credits with stance and verdict. The verification response format guide walks through each field, and you can run a saved example in the playground to see a verdict without code.

Treat unverifiable as unknown, not false, and treat a missing verdict as no evidence of support. When a claim has a wrong clause and the evidence proves a replacement, the verdict carries a correction with exact proof quotes.

Can an LLM judge citation faithfulness on its own?

A general model is a weak judge of whether a citation is unfaithful. On CiteCheck, a Chinese-language dataset, GPT-4o reached 70.4% accuracy on the dev set and 71.6% on the test set for unfaithful citation samples. A Llama-3.1-8B fine-tuned on its training set was the top performer at 91.4% and 90.6%, according to Xu et al., CiteCheck (2025).

Fixing citations after generation also helps. CiteFix reported a 15.46% relative improvement in overall accuracy for its RAG system from post-processing citation correction, according to Maheshwari et al., CiteFix (2025). That changes which source is attached; it still needs the support check above.

Keep the evidence with every result: the matched passage, the stance explanation and the source link. Webcite’s source preview returns a text fragment link that scrolls the page to the quote, so the reviewer reads the passage, not the whole page.

Where should these checks run?

Run them wherever generated text leaves your system: before publishing, before an answer reaches a customer, and in tests for agents. The source and quote checks are cheap enough to run on every citation; the support check can run on every claim that carries a number, a name or a date. For figures in financial text, see checking numbers against the source.

For a full pipeline with storage and review queues, see building a citation pipeline for AI-generated content. For background on attribution methods, see source attribution in AI. To run the same checks from Claude Code or Cursor, set up the Webcite MCP server and see the MCP guide for cited document reading.


Frequently Asked Questions

How do I verify citations in LLM output?

Run three checks in order: confirm the cited URL resolves to a real page, confirm the quoted text appears in that page, then judge whether the page supports the claim as written. Each check catches a different failure, so passing one says nothing about the next.

How often do LLMs fabricate citation URLs?

Rao et al. (April 2026) found 3 to 13% of citation URLs from commercial models and deep research agents were hallucinated, with no record in the Wayback Machine, and 5 to 18% did not resolve. Fabrication persisted with web search enabled.

Does a real source mean the citation is correct?

No. Wallat et al. found that up to 57 percent of citations in attributed answers lacked citation faithfulness. A real page can be cited for a claim it does not make, so check support separately.

How do I check whether a quote exists in a source?

Fetch the source and match the quote against its text, allowing for whitespace and punctuation changes. Webcite’s batch check does this for up to 200 quotes per call at 1 credit each and reports whether each match was exact, normalized, fuzzy, reflowed or unbound.

How do I check that a source supports a claim?

Send the claim and the cited URL to a verification API that reads the source and returns a stance. Webcite returns supports, contradicts, partially_supports, neutral or inconclusive for each source, and a verdict for the claim, for 4 credits.