Anti-Hallucination v2 (Cognitive Sandbox Edition): A Skill for Hallucination Risk Management in Research Writing and Code Generation

Preface

When using Large Language Models (LLMs) for factual research, report writing, or code generation, common issues include citation inaccuracies, fabricated APIs, and overly assertive conclusions. Manual post-fact verification is costly, and similar errors tend to recur across multiple conversations. Anti-Hallucination v2 (Cognitive Sandbox Edition) is a SkillHub community Skill that integrates “citation verification, existence checks, confidence annotation, self-verification chains, cross-session logs,” and a “Cognitive Sandbox (verified knowledge base)” into the Agent workflow. It is designed to mitigate hallucination risks in research writing and code generation scenarios. The following sections describe its positioning, capabilities, and installation methods.

What is this

Anti-Hallucination v2 (Cognitive Sandbox Edition) is a defense system designed around AI hallucination risks, emphasizing full-process risk control, self-evolution mechanisms, and data accumulation. It is published under the coordinate @user_0ecf7c29/anti-hallucination-v2. The current version is 1.0.1, categorized as ai-agent, sourced from the community, and published by user_0ecf7c29. The page indicates requires_api_key=false, meaning it does not rely on additional API keys.

SkillHub Display Page: https://www.skillhub.cn/skills/user_0ecf7c29/anti-hallucination-v2

Core Functions

The following capabilities are derived from the official description and apply when performing “factual research, report writing, code generation” or when the user explicitly requests to lower hallucination risks.

  1. Mandatory Citation Verification: Factual statements in the output must have verifiable sources to reduce unsubstantiated assertions.
  2. API Existence Check: When涉及 interfaces, libraries, or endpoints, verify their actual existence first to reduce “fabricated API” errors.
  3. Confidence Annotation: Differentiate the level of certainty for conclusions to avoid presenting everything as definitive fact.
  4. Self-Verification Chain: Add a self-check step before delivery, using a chained verification process to prevent internal contradictions.
  5. Cross-Session Hallucination Event Log: Hallucination-related events can be accumulated and logged for long-term review and to constrain recurring errors.
  6. Cognitive Sandbox and 🟡→🟢 Verification Mechanism: Write verified knowledge into the Cognitive Sandbox (verified knowledge base); entries pending verification are marked 🟡, and can be upgraded to 🟢 after verification, forming an accumulable and upgradeable knowledge base workflow.

The official English description also states that this Skill should be enabled when the user is conducting research writing, fact-checking, code generation, or explicitly requests reducing hallucination risk.

Installation and Activation

This Skill follows the standard SKILL.md format. SkillHub recommends two methods: letting the Agent operate according to the installation documentation, or using the skillhub CLI to install it to the current Agent’s skills directory.

Method 1: Prompt-based Installation

Provide the following intent to your AI (the installation instructions point to the official SkillHub documentation):

Please install `@user_0ecf7c29/anti-hallucination-v2` according to https://skillhub.cn/install/skillhub.md.

Method 2: CLI Installation

First, confirm if the SkillHub CLI is installed:

command -v skillhub && skillhub --version

If not installed, you can execute a full installation (CLI + Default Skill):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

To install only the CLI:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

When installing this Skill, you must use --dir to point to the current Agent’s skills directory; installing to the default ./skills/ might not be recognized. Example:

skillhub install user_0ecf7c29/anti-hallucination-v2 --dir <skills directory>

Common client skills paths (excerpt from SkillHub installation documentation):

Client skills Directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project
Windsurf ~/.codeium/windsurf/skills/ or .windsurf/skills/

In Cursor, you can set --dir to ~/.cursor/skills/. After installation, restart or refresh the Agent according to your client’s requirements to ensure the Skill is loaded.

Typical Usage

Official materials do not provide an independent “one-click script” example; triggering is based on the introduction: When a conversation requires fact-checking, research reports, code generation, or an explicit request to reduce AI hallucination risks, the Agent should load and follow this Skill’s rules.

Reproducible activation examples (Natural Language is sufficient):

  1. “Use the Anti-Hallucination workflow to help me write a factual research report with citations. Please verify the existence of any external APIs involved first.”
  2. “Generate code calling a specific cloud provider’s SDK. Perform API existence checks according to the Skill’s requirements and annotate confidence levels.”
  3. “Enable hallucination risk control for this output: Key conclusions must have citations; uncertain items should be marked 🟡 and enter the Cognitive Sandbox only after verification.”

Through the steps above, the Agent will execute according to the citation verification, verification chains, logs, and sandbox upgrades (🟡→🟢) defined within the Skill, rather than just making a one-time “please be careful” promise.

Applicable Scenarios and Notes

Who it is for

  • Researchers and engineers who need to write research, reports, or technical documentation and have requirements for sourcing and factual accuracy.
  • Developers using AI to generate or rewrite code who worry about fabricated library names, method names, or REST paths.
  • Teams or individuals hoping to accumulate “verified knowledge” across multiple sessions and reduce the recurrence of similar hallucinations.

Limitations and Notes

  • This Skill reduces risks at the process and constraint levels; it does not replace your final manual verification of key conclusions. Officially, zero hallucination is not guaranteed.
  • The effectiveness of the Cognitive Sandbox and event logs depends on whether the Agent persists the workspace files agreed upon by the Skill. Different clients have different requirements for skills directories and restarts, so ensure the installation path is correct.
  • SkillHub Page Statistics (as of data retrieval): Rating 100000, Downloads 838, Installs 7; Sourced from the community. Before use, check SkillHub to see if there are updates to the version or description.

Conclusion

Anti-Hallucination v2 (Cognitive Sandbox Edition) consolidates citation verification, API checks, confidence levels, self-verification chains, cross-session hallucination logs, and cognitive sandbox upgrade mechanisms into an ai-agent class Skill. It targets the two major scenarios of research writing and code generation. If you are selecting anti-hallucination capabilities on SkillHub, you can view details and install it from the official page:

  • SkillHub: https://www.skillhub.cn/skills/user_0ecf7c29/anti-hallucination-v2
  • Coordinate: @user_0ecf7c29/anti-hallucination-v2 (v1.0.1)
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye