skills/beam/beam-tools/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; output is an audit report with ranked recommendations. Load when user says "audit this agent for hallucination", "why is this agent extracting wrong data", "check this prompt for hallucination risk", "reduce hallucination", or shows correction/complaint data from a production agent.
npx skillsauth add beam-ai-team/beam-next-skills reduce-hallucinationInstall 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.
把审讯科学 / 法庭质询里"让知情者说真话"的已验证技巧,变成对 Beam agent 的标准化审计流程。 每个 LLM 节点是一个证人;节点间的数据交接是证词的转录环节;用户纠错和任务记录是物证。
理论与实证基础(捆绑在本 skill 的 references/,按需深入):
references/checklist.md — 12 条 production checklist + 5 禁用references/transfer-map.md — 审讯技巧 → prompt 技巧映射 + 关键不对称references/case-study-favorite-cv.md — 母案例:2,818 个 production tasks 回溯,幻觉定位在节点边界references/research-report.md — 25 来源、22 条三票验证结论 + 效应量引用凭证:.env 的 Beam backend/key(如 BEAM_EU_API_BACKEND / BEAM_EU_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 的机制知识参考你环境里的 agent-graph 构建类 skill(如 beam-agent-builder / beam-agent-manager / beam-graph-edit——只读其文档作参考,本 skill 不执行任何修改)。
层 1 — Prompt/schema 修改(零结构改动):
years_licensed vs years_worked),或输出区间 {floor, ceiling}{value, source, evidence_quote} 三件套{{ }};变量 pill 用三反引号包裹层 2 — 加 Code Executor 验证节点(零 LLM 成本,确定性): | 验证器 | 检查什么 | |---|---| | 枚举白名单 | 州码 ∈ 50 州、status ∈ 合法值——拦损坏输出 | | 引用真伪 string-match | evidence_quote 逐字存在于源文档,不存在 → 打回/降级 | | 跨字段一致性 | 总年限 ≈ Σ positions 时长;missing_fields 与已填值不矛盾 | | 口径计算 | 日期差/求和由代码算,LLM 只做语义抽取 | | 出口合同 | 用户可见文本里的每个事实槽位非空且来自允许的来源字段 |
放置位置:产出最终用户可见内容的节点之前。失败路径:写 fallback 字段/标记,由后续节点改发开放问题或转人工(注意:条件分支在 chat-mode 会 stall,线性图里用"标记字段+下游节点自判"模式更稳)。
层 3 — 加 LLM 交叉质询节点(LM-vs-LM cross-examination,Cohen EMNLP 2023):
{verdict, offending_claims[]};高风险流程可对关键字段乱序重问做一致性投票写到调用方指定位置。结构:
# Hallucination Audit — {agent name} ({agentId}, {draft|published})
## 一句话结论
## 证据概览(节点数 / 审计版本 / 任务样本量 / 纠错样本量+方向)
## Findings(每条:位置 | R# | 原文引用 | 后果 | 对应修复编号)
## 数据流图与死信通道
## 修复建议(层 1/2/3,每条标注预期消灭哪些 findings)
## 待验证(证据不足的怀疑 + 建议的取证方法)
## 诚实边界(哪些纠错不是幻觉而是流程缺口;本审计没覆盖什么)
development
--- name: taste-skill type: skill version: '1.0' author: Leonxlnx (packaged by Zhichao Li) category: general tags: - frontend - design - anti-slop - landing-page updated: '2026-06-11' visibility: public description: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check. license: MIT.
development
Use when communicating quantitative information in any form — Slack updates, emails, reports, decks, dashboards, landing pages, product UI, public talks. Covers two integrated layers: (1) making numbers semantically meaningful (translation, anchoring, simplification, story-pairing) and (2) showing numbers cleanly (chart vs table vs prose, chart-by-message, pre-attentive emphasis, color discipline, decluttering). Distilled and integrated from *Show Me the Numbers* (Stephen Few) and *Make Numbers Count* (Chip Heath & Karla Starr). Not for raw data analysis or statistics — this is about communication of numbers, not their derivation.
development
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.
tools
Stateful multi-session tutor adapted for Beam — teach a stakeholder to understand, trust, and operate a specific agent, or teach a Solution Engineer a client's business process for delivery. Grounds every lesson in Knowledge Hub sources (real agent graphs, real tasks, transcripts, Linear) before any web resource. Also works for any general topic. Trigger on "teach me", "beam teach", "教我", "onboard <person> on <agent>", "help <stakeholder> understand the agent", "learn this client's process".