Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:42 evey Hermes plugins Output Validation

From Leeroopedia
Knowledge Sources
Domains Validation, Hallucination_Detection, Quality_Assessment
Last Updated 2026-10-29 00:00 GMT

Overview

A two-layer validation method that combines regex-based hallucination pattern detection with LLM-assisted reliability scoring to assess whether delegation results can be trusted.

Description

Output Validation addresses the hallucination problem: LLMs, especially free or smaller models, may produce plausible-sounding but fabricated content. The validation combines two complementary layers:

  1. Pattern-based checks: A curated list of regex patterns flags common hallucination indicators — knowledge cutoff references ("as of my last cutoff"), capability denial while giving specifics ("I can't browse the web, but here's what I found"), specific date/version claims that need verification, vague authority claims ("according to the official latest..."), and weasel words ("it is widely known that..."). Each match adds a flag.
  2. LLM-based scoring: A validation prompt asks the active model to rate the delegation result 0-10 for reliability, with clear rubric definitions (10 = verifiable with sources; 0 = complete fabrication).

The final score is the LLM score minus the number of pattern flags (clamped to 0+). Scores map to trust levels: ≥7 = TRUST, 4-6 = CAUTION, <4 = REJECT.

Usage

Use this principle when trusting LLM output for downstream decisions. The pattern layer is fast and free; the LLM layer costs one additional call but provides nuanced assessment. Together they catch both obvious red flags (pattern matches) and subtle quality issues (LLM assessment). Suitable for any delegation pipeline where output reliability matters.

Theoretical Basis

The combined validation score:

Failed to parse (syntax error): {\displaystyle \text{score} = \max(0, \text{LLM\_score} - |\text{pattern\_flags}|) }

The trust thresholds:

recommendation={TRUSTif score≥7CAUTIONif score≥4REJECTif score<4

# Abstract algorithm (NOT real implementation)
flags = [desc for pattern, desc in HALLUCINATION_PATTERNS if re.search(pattern, result)]
llm_score = parse_score(call_llm(VALIDATE_PROMPT.format(task, result, model)))
final_score = max(0, llm_score - len(flags))
if final_score >= 7: return "TRUST"
elif final_score >= 4: return "CAUTION"
else: return "REJECT"

The pattern subtraction ensures that even a high LLM self-assessment is penalized when objective red flags are present, countering the tendency of models to rate themselves favorably.

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment