Community研究与数据分析github.com

getedgehq/harness-first

在责怪或更换模型之前,先审计智能体的“防护栏”(精标集、裁判、成本上限、数据层、操作审批、追踪),从而诊断并修复不可靠、昂贵或不安全的LLM智能体。

harness-first 是什么?

本技能针对LLM智能体开发中常见的“模型问题”提供了结构化审计方法。核心主张是:绝大多数表现问题(如代币烧钱、幻觉、结果不稳定)根因不在模型本身,而在于缺乏一套完整“防护栏”(Harness)。技能将防护栏拆解为六项关键组件:精标集(Golden Set)、裁判系统(Judge)、成本治理、数据层、操作安全和追踪能力。它指导用户首先从证据而非“感觉”复现症状,然后逐一评估六项组件为“存在/部分存在/缺失”,并据此决定下一步:是修复机制还是更换模型。该技能适用于Claude Code、Cursor、Codex等平台,强调在任何模型或提示更改前必须运行精标集,且安全漏洞应被阻断。最终产出一份包含根因、防护栏评分卡、已修改或创建文件及阻塞风险的报告。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getedgehq/skills/tree/main/harness-first

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

防护栏优先

模型是引擎。大多数“模型问题”其实是缺失防护栏:没有定义正确输出、没有检验变更、没有设定消费上限、数据缺乏公认定义、行动没有审批、也没有追踪来定位不良调用。在触碰模型之前,先审计这些。

1. 依据证据而非感觉重现症状

  • 阅读症状所触及的智能体代码:循环、工具定义、提示组装、数据访问、副作用的工具。
  • 阅读所有存在的日志/追踪/转录。汇总它们(按对话、按工具、按错误):谁花费了代币、哪些调用失败、哪些回答错误。通常只有少数离群值占据主导。
  • 将根因表述为一种带证据的机制(文件:行、日志ID、你计算出的数字)。“模型不好”不是一种机制。

常见机制:

  • 代币烧钱: 无最大迭代次数的循环、在确定性错误上重试、每轮发送完整历史或巨大工具结果、未缓存稳定上下文。
  • “幻觉”: 智能体忠实地使用了模棱两可或错误的来源(两个具有相同名称和不同含义的表/字段、过时的文档)。亲自重新计算两个数字来证明。
  • 脆弱性: 没有回归集就上线的提示更改;只有作者手动核验过的行为。

2. 评分六项防护栏组件

对每一项,标记 存在 / 部分存在 / 缺失,并附带你发现的证据:

组件存在意味着
精标集约20+个包含期望答案或约束的用例,来自真实流量、事故和边界情况
裁判优先进行确定性检查(数字、策略规则、禁止内容),仅对代码无法检查的内容使用LLM评分;每次提示/模型/工具更改时运行
成本治理每用户和每工作流的硬性代币/成本上限、每次运行的最大迭代次数、带消息的优雅停止
数据层只读凭据用于读取、数据字典定义智能体可能使用的每个指标/字段
操作安全不可逆或外部操作(发送、支付、删除、写入、退款)是可逆的或需要人工批准
追踪每次模型和工具调用都记录对话ID、工作流、输入、输出、代币、成本、延迟、错误

3. 在构建之前决策

  • 在没有评估证据的情况下,绝不推荐更换模型。 如果有人问“我们应该换模型吗?”,答案是:修复机制,然后对两个模型运行精标集,比较质量和成本。说出仅修复机制预计能节省多少,附上你的数字。
  • 未经精标集运行,绝不批准上线提示/智能体更改。 如果存在记录的输出,亲自对照期望答案进行评分,并通过用例ID报告失败项。
  • 安全漏洞(未关闭的副作用、读取路径上的写入权限、泄露内部数据)是阻塞性的,即使无人询问也必须处理。

4. 按此顺序构建最小防护栏

  1. 止血: 最大迭代次数、非临时性错误不重试、截断/总结大型工具输出、每次运行硬性成本上限。
  2. 屏蔽副作用: 对不可逆工具设置批准步骤或草稿模式;对查询工具使用只读连接。
  3. 精标集文件(evals/golden.jsonl 或类似):输入、期望答案或约束、来源(日志ID/事故/策略条款)。包含刚刚失败的用例。
  4. 裁判脚本,运行精标集并输出每个用例的通过/失败以及总计。优先进行确定性检查,然后再进行LLM评分。
  5. 数据字典,用于智能体报告的每个指标(定义、源表/字段、排除项)。
  6. 追踪,按上述字段配置,如果缺失则添加。

写入真实的文件,而不是文件的描述。运行所有能运行的内容并报告结果。

5. 报告

  • 针对实际提出的问题给出单行答案(例如“暂时不要换模型:3次运行卡在重试循环中,消耗了71%的代币”)。
  • 带证据和数字的根因。
  • 防护栏评分卡(六项组件)。
  • 你更改或创建的内容,以及你运行的内容。
  • 阻塞风险,然后是一个简短的优先下一步工作列表。

致谢

本技能所遵循的方法来自Mark Ajzenstadt (@mardehaym) 的公开帖子:https://x.com/mardehaym/status/2099562230647804152。论点归功于他;本技能中的过程、措辞和评估均为Edge自有,且作者并未审阅它们。

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

getedgehq/agent-evals

Build evals for an AI agent that already does real work. Use when someone asks "how do I know my agent is right", wants to test an agent before trusting it, compare models on cost versus quality, or turn production failures into tests. Walks from first tasks and yes/no verifiers, to isolated environments, to a trace-driven improvement loop.

getedgehq/cli-ux-review

Audit a command-line tool for user-friendliness — clear situation / next-step / options in every output, colour-highlighted runnable commands, no raw jargon, no silent hangs. Invoke for "CLI UX audit", "review my CLI", "is this CLI intuitive", or before any CLI release.

getedgehq/generate-image

Generate images with OpenAI GPT Image 2 via the Codex CLI, billed through the user's ChatGPT Plus subscription (no OpenAI API key, no per-image API cost). Use when the user asks to create, generate, or make an image, picture, illustration, icon, hero graphic, or concept art from a text prompt.

getedgehq/http-error-triage

Run before concluding anything from an HTTP error on a third-party API. Separates a real credential/entitlement problem from a CDN or WAF block, a wrong endpoint, or a client-signature ban. Use whenever an API returns 401/403/402/429 and you are about to say "the key is dead", "credits are exhausted", "the plan lacks access", or "we are rate limited".

getedgehq/linkedin-media-prep

Convert, crop, resize, and compress images and videos for optimal LinkedIn upload quality and file size. Use when the user wants to prepare a photo, image, or video for LinkedIn (profile picture, cover photo, post image, article featured image, post video, or video ad), optimize file size for LinkedIn, crop and resize for LinkedIn dimensions, convert HEIC/RAW/PNG/MOV to LinkedIn-ready JPEG or MP4, or mentions LinkedIn media requirements, specs, or limits.

getedgehq/monid

>-

getedgehq/opendraft

An 18-agent pipeline that turns one topic line into a drafted

getedgehq/people-search

Find and rank professional people for recruiting, partnerships, sales, or research from user-provided data, public web sources, an authenticated search session, or a connected provider. Use for people discovery, LinkedIn or Sales Navigator search design, profile-list ranking, or provider filter translation.

getedgehq/rocketlist

Turn a CV into a shortlist of live startup roles from Rocketlist's public job board, including adjacent job titles the person would never have searched for, each with its published salary, the evidence for the fit, and a direct apply link. Use for "find roles I would be a strong fit for", career pivots, remote or VC-backed job hunts, and salary-visible role discovery.

getedgehq/security-audit-checklist

Run a comprehensive security audit across application code, cloud infrastructure, containers, CI/CD pipelines, and infrastructure-as-code. Covers privacy compliance, OWASP basics, secret leakage, API security, IAM misconfigurations, storage exposure, Kubernetes hardening, and network security. Use when the user asks to audit, review, or harden app or cloud security, check for secrets, scan for XSS/SQLi, verify security headers, review Terraform/CloudFormation, audit AWS/GCP/Azure configs, or perform any security-focused review.

getedgehq/shadcn-first

>-

getedgehq/skills

Develop or review a branded long-form YouTube channel using Simon Kaiser's public creator-led approach: audience fit, recurring formats, natural brand integration, Time with Brand, and an organic, paid, and Shorts strategy. Use for channel strategy, format briefs, and pilots.

getedgehq/skills

Build a YouTube strategy, evidence-backed idea slate, and title plus thumbnail package using Paddy Galloway's public method. Use when planning a channel, choosing concepts, or preparing a video before filming.

getedgehq/skills

Build or review a buyer-centered strategic narrative using Andy Raskin's public method. Use for sales or investor deck stories, homepage positioning, keynotes, launch narratives, and why-now messaging.

getedgehq/skills

Turn a product URL, launch brief, or approved script into a production-ready launch video. Use for product reveals, feature announcements, SaaS launches, and narrated product films; not for generic explainers or editing existing footage.

getedgehq/strip-image-ai-metadata

Strip C2PA and AI-generation metadata from images (PNG, JPEG, WebP) to remove "Generated by AI" / "ChatGPT" / "DALL-E" labels that platforms like LinkedIn, Instagram, and X display. Use when the user wants to clean AI-generated images before posting, remove AI attribution from photos, strip C2PA manifests, sanitize image metadata for professional use, or verify whether an image contains C2PA data.

getedgehq/top-down-comms

>-

getedgehq/workplan

Create, update, or close work plans for multi-step tasks. Use when starting refactors, bug lists, feature work, migrations, or any task with 2+ steps. Also use after auto-compaction to re-orient. Triggers: "workplan", "work plan", "create a plan", "what's the plan", "where was I", or when Claude detects

相关技能