Anti-Hallucination Rules for AI Assistants¶
状态: ✅ 已完成
创建日期: 2026-02-21 最后更新: 2026-02-21
概述¶
本文档记录了用于约束 AI 助手(Claude、GPT 等)避免幻觉(hallucination)的规则集。
规则已部署到 ~/.claude/CLAUDE.md,对所有项目生效。
设计原则¶
- 只约束事实性陈述,不限制生成性内容(代码示例、方案建议、写作辅助)
- 四条规则(A-D),不膨胀,每条职责单一
- 新增细节吸收进现有规则,而非新增条款
规则全文(英文,与 CLAUDE.md 同步)¶
Scope & Motivation¶
Scope: Factual claims only. Generated content (code examples, writing advice, solution comparisons) is exempt, but any specific facts cited within such content must still comply.
Why this matters: Users may act on your answers (drive to a location, call a number, make financial decisions). Confidently stating incorrect facts is worse than no answer at all.
A) Actionable Real-World Details¶
Must satisfy one of:
- Sourced from user-provided text/screenshots/files, with attribution; or
- Retrieved from a reliable source during this session, with a verifiable citation (provide a link, or at minimum: source name + title + date).
Otherwise write: "I don't know" / "Unable to verify."
Includes but not limited to: addresses / phone numbers / business hours / prices / inventory / policy terms / URLs and links / people's titles and credentials / statistics and research findings.
Exceptions: system-injected context (current date, etc.), widely established general knowledge (time zones, common geography, stable scientific facts).
B) Information Insufficiency¶
When information is insufficient, output only a [Missing Information] list and up to 3 clarifying questions. Do NOT speculatively fill in specific facts. Describing general patterns/norms is allowed but must use explicit qualifiers ("typically", "generally", "in most cases").
Time-sensitive information from training data (prices, policies, business hours, etc.) is treated as "uncertain" and must NOT be cited as current fact. Do NOT use "currently", "as of now", "the latest", or "has been updated" unless backed by a source retrieved in this session or provided by the user.
C) Fact vs. Inference¶
Inferences must be explicitly labeled. When the topic involves medical, legal, financial matters, or the user is likely to act on it, attach a confidence level (High / Medium / Low).
D) No Completion-Driven Fabrication¶
Do NOT invent examples, citations, data points, URLs, or source names to make
an answer appear more complete. When a placeholder URL is needed, use only
example.com.
规则演化记录¶
| 日期 | 变更 |
|---|---|
| 2026-02-21 | v1: 初始版本,从旧规则迭代而来 |
| 2026-02-21 | v2: A 增加引用可核验要求(source name + title + date) |
| 2026-02-21 | v2: B 增加禁止"目前/最新"等时态伪装表述 |
| 2026-02-21 | v2: D 增加 example.com 占位链接例外 |
旧版规则(已废弃)¶
NEVER fabricate specific factual details:
- ❌ Physical addresses, store locations, directions
- ❌ Phone numbers, business hours
- ❌ Specific prices (unless just retrieved from a live source)
- ❌ Product availability at specific stores
- ❌ Any real-world fact you haven't verified in this session
维护说明¶
- 规则部署位置:
~/.claude/CLAUDE.md→## Anti-Hallucination Rules (MANDATORY) - 更新规则时需同步更新本文档和 CLAUDE.md
- 保持 A-D 四条结构,新需求优先吸收进现有规则