# ADR-002: System Backstop for Hallucination Prevention

**Date:** 2026-02-06
**Status:** Accepted

## Context
RAG agents, including our own Benchmark Harness, suffer from "halucination" when asked about concepts that do not exist in the codebase. Vector search often returns "nearest neighbors" which are irrelevant, and the LLM then fabricates a connection.

## Decision
We implemented a **"System Backstop"** mechanism directly in `clew-engine` via a new MCP tool: `verify_concept(concept: str)`.

- **Tool:** `verify_concept` performs a strict vector search. If no strong matches are found, it returns a "VERIFICATION FAILED" message.
- **Protocol:** Agents are instructed (via system prompt) to CALL this tool FIRST for any key concepts in the user's query.
- **Outcome:** If verification fails, the agent must stop and report absence, rather than proceeding to `search_codebase` or `traverse_graph`.

## Consequences
**Positive:**
- drastically reduces hallucination on "False Premise" queries.
- Saves token costs (stops early).
- Improves user trust.

**Negative:**
- Adds latency (1 extra round trip) for every query.
- May produce false negatives if the vector embedding doesn't match a valid concept (search quality dependency).

## Alternatives Considered
- **Confidence Scoring:** Relying on LLM confidence scores (unreliable).
- **Graph-Only Verification:** Using graph traversal to find the node. (We do use graph, but vector is the entry point. `verify_concept` is essentially a "strict entry point" check).
