Skip to content
C.W.K.
Stream
Lesson 04 of 04 · published

The Purity Gate: Verify Provenance, Not Quality

~12 min · verification, llm, agents, evidence

Level 0Unsorted
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Confident Output Is Not Evidence of Work

Ask a model what people are saying about a topic right now. It will answer. It will answer whether or not it searched anything, and the two answers are equally fluent, equally specific, and equally structured. Reading the prose cannot tell you which one you got.

That is the whole problem with grounding an automated pipeline on a generated answer. The failure mode is not garbage output — garbage would be easy. It is a well-formed, plausible answer produced entirely from prior knowledge, describing a state of the world that may be months out of date.

Require Something Only the Real Path Can Produce

The gate is to demand an artifact the model cannot fabricate its way past. Here that is a citation: at least one link to a post on the platform being sampled, on one of that platform's actual hostnames. A search that ran produces those naturally, because it saw the posts. A model answering from memory has nothing real to point at.

Note what the gate deliberately does not do. It makes no judgment about whether the reading is insightful, whether the temperature is correct, or whether the summary is well written. Quality is not mechanically checkable and attempts to check it produce a worse instrument. Provenance is checkable, and it is the property that actually distinguishes a real sample from a hallucinated one.

Store the Failure, Loudly

A card that fails the gate is not silently discarded. It is stored with its raw text and marked as failed, for two reasons. Diagnostically, the rejected output is the only evidence of why the run did not work — a prompt that stopped producing citations is telling you something, and deleting the evidence deletes the signal. Operationally, a sampler that quietly produces nothing looks identical to a quiet day.

The same reasoning covers parsing. When the response is supposed to be structured and is not quite, parse tolerantly, keep what you can, and mark the row rather than dropping it.

The Prompt Is Not the Enforcement

The instruction does ask for citations, and asking helps. But the instruction is a request and the gate is a check, and only one of them is load-bearing. This is the same distinction as the previous lesson's clause about untrusted input: you can ask a model for a property, and you should — but if the property matters, something outside the model has to verify it.

The test for whether you have a gate or a hope is simple: if the model ignored the instruction entirely, would anything notice?

Check provenance mechanically; leave quality to a person. A gate that tries to judge whether an answer is good will be wrong in both directions and erode trust in itself. A gate that only asks "did this come from where it claims?" is cheap, exact, and catches the failure that actually matters.

Code

A gate on provenance, with failures stored rather than dropped·python
_X_HOSTS = {"x.com", "www.x.com", "twitter.com",
            "www.twitter.com", "mobile.twitter.com"}


def extract_card(raw: str) -> dict:
    """Parse a sampled trend card and gate it on PROVENANCE.

    A model asked about current sentiment answers confidently whether
    or not it searched, and the two answers read identically. A real
    link to a real post is the one thing the search path produces and
    prior knowledge cannot.
    """
    card = _parse_tolerantly(raw)       # keep what we can
    if card is None:
        # Never silently dropped: the raw text is the only evidence of
        # why the run failed, and a sampler producing nothing looks
        # exactly like a quiet day.
        return {"status": "unparsed", "raw": raw}

    cited = [
        p for p in card.get("posts", [])
        if urlsplit(p.get("url", "")).netloc.lower() in _X_HOSTS
    ]
    if not cited:
        return {"status": "no_citation", "raw": raw, "card": card}

    # The gate judges PROVENANCE only. Whether the read is insightful,
    # whether the temperature is right, whether the prose is good --
    # none of that is mechanically checkable, and an instrument that
    # tries is worse than one that does not.
    card["posts"] = cited
    card["status"] = "ok"
    return card

External links

Exercise

Take a prompt in your system that asks the model for a structural property — cite sources, return JSON, stay under a length, use only supplied facts. Write the check that would fail if the model ignored it, and run your pipeline with that check active for a week. Count how often it fires.
Hint
Expect a non-zero rate even on a well-behaved model, particularly for citation and length clauses. That rate is the number you have been silently accepting, and knowing it is more valuable than the individual rejections — it tells you whether the property was ever really holding.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.