hallucination-prevention

hallucination-prevention is a skill for Claude Code, Codex from DevelopersGlobal/ai-agent-skills. It costs 38 tokens per session (1,166 once invoked), scanned A, original, MIT.

A set of checks for finding and reducing false information produced by large language models, which are AI systems that generate text or code.

In plain words
What is it for?
It classifies the risk of AI outputs and adds validation steps to retrieval systems, tool-using agents, and other AI pipelines.
Why use it?
It helps prevent incorrect facts, code, database queries, API calls, legal references, or financial information from reaching users or other systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It classifies the risk of AI outputs and adds validation steps to retrieval systems, tool-using agents, and other AI pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/developersglobal/ai-agent-skills/hallucination-prevention
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add DevelopersGlobal/ai-agent-skills --skill hallucination-prevention
Clone the repo
git clone --depth 1 https://github.com/DevelopersGlobal/ai-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hallucination-prevention

README.md
[![agentmods](https://agentmods.dev/badge/skills/developersglobal/ai-agent-skills/hallucination-prevention/github.svg)](https://agentmods.dev/skills/developersglobal/ai-agent-skills/hallucination-prevention)
Your own site
<a href="https://agentmods.dev/skills/developersglobal/ai-agent-skills/hallucination-prevention"><img src="https://agentmods.dev/badge/skills/developersglobal/ai-agent-skills/hallucination-prevention/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hallucination-prevention

Your own site · 80×15
<a href="https://agentmods.dev/skills/developersglobal/ai-agent-skills/hallucination-prevention"><img src="https://agentmods.dev/badge/skills/developersglobal/ai-agent-skills/hallucination-prevention.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,166 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01166
Opus 5 $0.00019 $0.00583
Sonnet 5 $0.00008 $0.00233
Haiku 4.5 $0.00004 $0.00117

Measured 10d ago against content hash 478385e375e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

hallucination-prevention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/hallucination-prevention/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Overview

LLMs hallucinate — they generate plausible-sounding but factually incorrect content with high confidence. In production systems, hallucinations cause incorrect medical advice, broken code, wrong legal citations, fabricated API calls, and erroneous financial data.

This skill builds hallucination detection and mitigation into your AI pipeline architecture — before output reaches users or downstream systems.

When to Use

  • Any AI pipeline where factual accuracy matters
  • When agents generate code, SQL, or API calls that will be executed
  • When agents retrieve information that will influence decisions
  • RAG (Retrieval-Augmented Generation) systems
  • Agentic pipelines with tool use and multi-step reasoning

Process

Step 1: Classify Your Hallucination Risk

  1. Map all AI outputs in your system. For each, classify:
    • Critical: Incorrect output causes harm (medical, legal, financial, code execution)
    • High: Incorrect output wastes significant user/system resources
    • Medium: Incorrect output is annoying but recoverable
    • Low: Incorrect output is cosmetic
  2. Apply this skill's full rigor to Critical and High outputs. Lighter checks for Medium and Low.

Verify: Every AI output in your pipeline has a hallucination risk classification.

Step 2: Ground LLM Outputs

  1. For factual queries: always provide source documents in the prompt (RAG pattern). Instruct the model to cite sources and refuse to answer if the information isn't in the provided documents.
  2. For code generation: run the code in a sandbox and verify it produces the expected output before returning to the user.
  3. For structured outputs (JSON, SQL, etc.): validate against a schema before using.
  4. For numerical claims: require the model to show its work step-by-step and verify key calculations independently.

Verify: Every Critical/High output is grounded in provided sources or verified by execution.

Step 3: Build Verification Layers

  1. Self-consistency checking: Ask the model the same question 2–3 ways and compare answers. Divergent answers signal uncertain ground.
  2. Chain-of-thought with verification: Prompt the model to reason step-by-step, then verify the reasoning chain, not just the conclusion.
  3. Separate generation from verification: Use one prompt to generate, a different prompt to critically evaluate. Never use the same model call for both.
  4. Human-in-the-loop for Critical outputs: Require human review before Critical AI-generated content reaches end users.

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 104 lines · 38 tokens per session scan A 478385e375e6

Subscribe to this mod's changes

hallucination-prevention is a skill published in the GitHub repository DevelopersGlobal/ai-agent-skills (66 stars, last pushed 4mo ago), licensed MIT. It adds 38 tokens to every session and 1,166 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

data-engineering

Guides data pipeline design, ETL/ELT workflows, schema evolution, and data quality assurance. Use when building data pipelines, designing data warehouses, migrating schemas, or ensuring data integrity across systems. Use when you need reliable, testable, and observable data flows.

borhen68/SkillEngine · 59 tokens

ai-ops

Guides operational excellence for AI/ML systems in production. Use when deploying models, managing inference infrastructure, monitoring model drift, or maintaining AI-powered features. Use when you need reliable, observable, and governable machine learning systems.

borhen68/SkillEngine · 50 tokens

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

addyosmani/agent-skills · 51 tokens

constraint-driven-development

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or…

addyosmani/agent-skills · 176 tokens

performance-optimization

Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.

addyosmani/agent-skills · 59 tokens

api-and-interface-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

addyosmani/agent-skills · 49 tokens