skills/archive/reduce-hallucination/SKILL.md
Audit a Beam agent for hallucination risk using interrogation-science techniques — check prompts, input/output schemas, node boundaries, and (when available) real task evidence; then recommend prompt fixes, schema fixes, and graph-level additions (Code Executor validators, LLM cross-examiner nodes, abstention routing). STRICTLY READ-ONLY: never modifies, publishes, or deploys anything — output is an audit report with ranked recommendations. Trigger on "audit this agent for hallucination", "why is this agent extracting wrong data", "check this prompt for hallucination risk", "reduce hallucination", "审计幻觉", "为什么提取不准", "检查这个 agent 的幻觉风险", or when a user shows correction/complaint data from a production agent.
npx skillsauth add beam-ai-team/beam-next-skills reduce-hallucination-archivedInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Archived duplicate. Kept for reference only; the active maintained version lives at
skills/beam/beam-tools/reduce-hallucination.
把审讯科学 / 法庭质询里"让知情者说真话"的已验证技巧,变成对 Beam agent 的标准化审计流程。 每个 LLM 节点是一个证人;节点间的数据交接是证词的转录环节;用户纠错和任务记录是物证。
This skill is read-only for Beam state. Before fetching task evidence or writing an audit report, show the workspace, agent ID, API host, task sample size, destination path, and whether customer/task data will be included. Require explicit user approval in the current turn before exporting reports outside the local workspace. Do not create tasks, update prompts or schemas, publish graphs, trigger runs, or modify Beam data from this skill.
理论与实证基础(先读,按需深入):
03-projects/06-reduce-hallucination/04-outputs/checklist.md — 12 条 production checklist + 5 禁用03-projects/06-reduce-hallucination/04-outputs/transfer-map.md — 技巧映射 + 关键不对称03-projects/06-reduce-hallucination/04-outputs/case-study-favorite-cv.md — 本 skill 的母案例(2,818 tasks 回溯)03-projects/06-reduce-hallucination/02-resources/research-report.md — 引用与效应量凭证:.env 的 BEAM_{EU,US,BID}_API_BACKEND / _API_KEY。请求头:x-api-key + current-workspace-id(从 agent URL 第一段取 workspace id)。
| 要什么 | 端点 |
|---|---|
| Agent graph(节点、prompt、schema、边)| GET {backend}/agent-graphs/{agentId} —— 按 agentId 取,graphId 会滚动,别缓存 |
| 任务列表(分页)| GET {backend}/agent-tasks?agentId={id}&pageNum=1&pageSize=100(totalCount 在顶层)|
| 单任务全节点中间输出 | GET {backend}/agent-tasks/{taskId} → agentTaskNodes[].output / .input |
| 工作区 agent 清单 | GET {backend}/agent?pageNum=1&pageSize=100(beam-os 类型要加 ?type=beam-os)|
prompt 在节点 JSON 里的位置不固定(toolConfiguration.prompt / originalTool.prompt 等)——递归搜 prompt 键。
注意:runtime 跑的是 published 版本,GET 返回 draft——审计结论要注明审计的是哪个版本(isPublished/isDraft)。
对每个 LLM 节点,跑红旗清单。每条红旗 = 一种审讯学违例:
| # | 红旗模式(在 prompt/schema 里找什么)| 审讯学依据 | 危害 |
|---|---|---|---|
| R1 | 枚举字段缺 null/unknown/UNKNOWN 选项;"Expected output is a confirmation of X" 单向输出 | Reid 批判:逼供产生顺从(假供述 OR 3.03)| 被迫猜测,自信编造 |
| R2 | prose 给了弃权令,schema 没给("use null if missing" 但字段类型无 null)| 同上——schema 赢,弃权令失效 | 母案例泄漏点 1 |
| R3 | 要求引用/evidence,但下游没有任何核查环节 | Verifiability:告知+真核查才有 g=0.80;光告知=学会编更像真的引用 | 假锚点 |
| R4 | 方向性指令:"be conservative / assume / infer from / default to" | 单向 presumption;配 R1 时产生系统性偏差 | 母案例 70% 低估 |
| R5 | 未定义口径的聚合字段("total years"、"overall score")| commitment & lock-in 的前提是先声明计量口径 | 定义错位被当成提取错误 |
| R6 | few-shot 示例与任务无关 / 示范了无引用推理 | Model Statement:示范设定"合格答案"预期 | 教坏输出风格 |
| R7 | prompt 让节点声称做它没有工具做的事("fetch from Airtable" 而节点无此工具)| 假前提(evidence ploys OR 0.37)| 编造过程叙述 |
| R8 | 用户/上游给的"事实"未标注来源就当真值用 | SUE:只用已核实证据对质 | 前提污染 |
| R9 | 模板有强制槽位 [Slot] 但无空值分支 | 逼供的模板版 | 母案例 license_state→FL |
| R10 | 复核/重试指令用攻击性措辞("you were wrong, fix it")且无新证据注入 | sycophancy = 假供述;无外部信号的 self-correction 劣化 | 正确答案被翻掉 |
记录格式:节点名 | R# | prompt 原文引用 | 一句话后果。
幻觉主战场。把 graph 的边和参数连接画成数据流表,逐条检查:
stated | inferred | absent 一类的来源标注?job.facility_type 被写进 "Your resume shows"。)这是 SUE 的完整落地,也是本 skill 区别于纯静态 lint 的地方:
GET /agent-tasks/{taskId} 拉每个节点的中间输出。license_state: "MO" 同时出现在 missing_fields 里)= 弹劾点。按 ROI 排序输出三层建议。怎么改 graph 的机制知识参考 beam-agent-builder(只读它的文档,不执行 build):
skills/general/beam-agent-builder/references/node-authoring.md(节点/参数机制)、
references/_steering/topology-shapes.md(拓扑)、prompt-best-practices.md(Beam prompt 约定:JSON 例子双花括号、变量 pill 三反引号)、beam-reality.md(平台坑:published vs draft、linked-param 字段、conditionNode 限制)。
层 1 — Prompt/schema 修改(零结构改动):
years_licensed vs years_worked),或输出区间 {floor, ceiling}{value, source, evidence_quote} 三件套层 2 — 加 Code Executor 验证节点(零 LLM 成本,确定性): | 验证器 | 检查什么 | |---|---| | 枚举白名单 | 州码 ∈ 50 州、status ∈ 合法值——拦"ll SW license"类损坏输出 | | 引用真伪 string-match | evidence_quote 逐字存在于源文档,不存在 → 打回/降级 | | 跨字段一致性 | 总年限 ≈ Σ positions 时长;missing_fields 与已填值不矛盾 | | 口径计算 | 日期差/求和由代码算,LLM 只做语义抽取 | | 出口合同 | 用户可见文本里的每个事实槽位非空且来自允许的来源字段 |
放置位置:产出最终用户可见内容的节点之前。失败路径:写 fallback 字段/标记,由后续节点改发开放问题或转人工(注意 beam-reality.md:条件分支在 chat-mode 会 stall,线性图里用"标记字段+下游节点自判"模式更稳)。
层 3 — 加 LLM 交叉质询节点(LM-vs-LM cross-examination,Cohen EMNLP 2023):
{verdict, offending_claims[]};高风险流程可对关键字段乱序重问做一致性投票写到调用方指定位置(默认当前项目 03-working/ 或新建 03-projects/.../)。结构:
# Hallucination Audit — {agent name} ({agentId}, {draft|published})
## 一句话结论
## 证据概览(节点数 / 审计版本 / 任务样本量 / 纠错样本量+方向)
## Findings(每条:位置 | R# | 原文引用 | 后果 | 对应修复编号)
## 数据流图与死信通道
## 修复建议(层 1/2/3,每条标注预期消灭哪些 findings)
## 待验证(证据不足的怀疑 + 建议的取证方法)
## 诚实边界(哪些纠错不是幻觉而是流程缺口;本审计没覆盖什么)
better-doc:finding 必须让没读过理论的人看懂。tools
Build a Palantir-shape, PDF-native use-case proposal document for a sophisticated enterprise account: research-grounded use cases (each with description, challenge, impact, value), an operating-graph ontology page, a recommended PoC with a week-by-week plan, and a closing page that asks for one decision. Load when a client asks us to 'propose high-impact use cases', requests a use-case presentation/catalog for a function (finance, HR, ops), or when a technical evaluation team will review candidates to pick a PoC. NOT for single-account cold outreach (use prospect-brief), full process diagnostics (use operating-diagnostic), or priced proposals (use proposal-creation).
development
Convert Beam Figma slide designs into high-fidelity, editable HTML presentation decks. Use when Codex is asked to audit Figma slides, extract slide templates, rebuild Beam slides as HTML decks, decide whether Figma imagery should be exported or rebuilt in HTML/CSS, create Beam/Prism-compatible deck templates, or improve fidelity of existing Beam HTML slide rebuilds.
development
Use the Beam AI reusable slide library: individual HTML slide templates extracted from Beam Figma rebuilds, kept separate from deck themes and full deck templates. Load when the user asks for a slide library, specific Beam slide patterns, reusable Figma-inspired slides, Prism slide-library items, or slide-level HTML templates.
development
Use Beam AI deck and report design packs, HTML templates, and curated examples to create sales decks, customer intro decks, RPO decks, and DIN A4 use-case proposal reports. Load when the user asks for Beam-branded presentation templates, Prism-compatible deck templates, Beam report templates, customer intro decks, commercial proposals, or reusable HTML deck/report examples.