Hedgemony detects when AI-generated code makes false claims by checking propositions against the actual runtime environment, classifying errors like fabrications and contradictions.
The title uses the popular words “hallucinating” and “lying,” but Hedgemony makes them precise. It does not claim to observe a hidden thought inside a model or determine whether the model intended to deceive anyone. It catches the exact moment a probabilistic guess becomes an external, falsifiable claim in code. Before a model produces code, its next token is only a probability. But the moment it writes `import ghostlib`, `json.serialise(...)`, or `math.sqrt(2, 3)`, it has made a proposition about the world: this package exists, this attribute belongs to this object, or this call is possible. Those propositions have truth values in the environment where the code is supposed to run. That is the boundary Hedgemony measures. It takes a claim made by generated code, submits it to an independent authority, and records the result. The model does not inspect itself. Another model does not vote. Confidence is not evidence. The interpreter and package registry decide what exists, while executable examples decide whether stated behavior actually holds. This is the point where “hallucination” stops being a vague description of model behavior and becomes a reproducible technical event: the generated code asserted something checkable, and reality contradicted it. Hedgemony names each form of that event precisely. A fabrication is the umbrella term for a false claim about the world. An invention is a name that exists nowhere, such as `import ghostlib`. A misattribution is a real name assigned to the wrong owner, such as `json.serialise`. A malformation means the target exists but the attempted call is impossible, such as passing two arguments to `math.sqrt`. A contradiction means the implementation disagrees with its own stated behavior. “Lying” is therefore shorthand, not a claim about intent. Hedgemony does not decide why the false statement appeared. It decides only the part that can be established: the code said this thing exists or behaves this way, and the selected environment proved otherwise. The underlying move is simple but powerful. A language model produces probabilistic output. Hedgemony transforms supported pieces of that output into deterministic questions: Does this package exist? Does this module path resolve? Can this name be imported? Does this object own this attribute? Can this function accept this call shape? Does the implementation produce the result it explicitly said it would produce? For each supported question, Hedgemony requires external evidence. A fluent explanation cannot change the answer. A second model cannot overrule it. Repeating the same confident claim does not increase its truth value. Consider an agent that generates `console.table(...)`. The expression looks plausible, the accompanying explanation may sound authoritative, and another model might approve it. The installed interpreter cannot be persuaded. Either `table` exists on that object in the selected environment or it does not. Hedgemony reports the exact line, the false ownership claim, and classifies it as a misattribution. But existing names do not guarantee correct logic. A model can use real packages, valid methods, and legal arguments while still calculating the wrong result. Hedgemony therefore runs a second pass over the file’s stated `>>>` examples inside a bounded subprocess. When the implementation disagrees with an example, the model’s plausible logic becomes a measurable contradiction. There is also a boundary Hedgemony refuses to hide. If code contains plausible but wrong logic and nothing states what the correct behavior should be, there is no external standard against which to judge it. Hedgemony calls that confabulation and does not pretend to detect it. Instead, it reports `NO_CONTRACT`, making the missing evidence visible. Add one expected example, and the previously undecidable confabulation becomes a decidable contradiction. That may be the most important property for autonomous agents: uncertainty is never silently converted into safety. A clean result means no supported fabrication or tested contradiction was found. It does not mean the entire program has been proven correct. In an agent workflow, the model remains free to imagine, generate, and repair. But it is no longer the final authority over its own work. The agent generates a file, Hedgemony identifies the exact false or contradicted claims, the agent repairs those lines, and the deterministic referee runs again. Creativity stays probabilistic; acceptance becomes evidence-based. The first public release has zero runtime dependencies, supports Python 3.9 and later, produces machine-readable findings, and was validated through 228 checks, clean wheel and source-distribution installations, and an immutable cryptographically attested release. So my question for people building real agents is this: if you could identify the exact point where an AI hallucination becomes a falsifiable claim in code, where would you place that gate? After every generated file, before tests, before a pull request, or immediately before an autonomous action reaches production? And what is the most convincing false claim an agent has ever embedded in working-looking code for you?
The user experiences AI hallucinations in research and analysis, such as fake references and answers, and seeks prompts to prevent LLMs from fabricating information.
The article describes a type of AI hallucination where claims are accurate but quotations are fabricated, evading standard fact-checking, and discusses implementation challenges in detecting such errors.
A tool called Lighthouse, built by an AI governance engineer, uses runtime validation to detect epistemic drift and confident-sounding nonsense in AI output and writing.
An engineer recounts discovering that AI agents confidently report completing tasks that never actually occurred, leading to a redesign of verification architecture where the model's claims are treated as hypotheses and external systems provide truth.
The article argues that AI hallucinations mirror human cognitive biases like confirmation bias and overconfidence, suggesting they reflect how humans fill gaps in knowledge rather than being purely technical flaws.