【Harness:设计规范】15、Harness 成熟度模型(H0-H3):你的 AI 智能体在第几层

【Agent 成熟度评估】Harness 成熟度模型(H0-H3):你的 AI 智能体在第几层?

关键词 :Harness 成熟度模型、Agent 能力评估、H0-H3 分级、AI 智能体评测、系统可审计性、确定性执行、归因能力

字数 :约 11200 字 | 阅读时长 :24 分钟

适用人群:AI 架构师、技术负责人、DevOps 工程师、AI 产品经理


📑 本文目录

  1. 引言:Harness 不是"全有或全无",复杂度应匹配任务风险
  2. 四层成熟度阶梯(H0--H3)
    • 2.1 H0:最小 Harness ------ 基础模式,仅生成最终补丁
    • 2.2 H1:增加可复现性 ------ 输出再现代码的复现日志
    • 2.3 H2:增加归因能力 ------ 故障归因与确定性需求检查
    • 2.4 H3:全功能运行时 ------ 结构化验证报告与完整可审计性
  3. 三层评估体系:完成性(Correctness)、归属性(Attribution)、可维护性(Maintainability)
  4. 各层级输出差异对比表与适用场景
  5. 从 H0 到 H3 的实战演进路径:迁移触发条件与关键配置变更
  6. 自评估工具:你的 Agent 系统在哪个级别?(附 Checklist)
  7. 总结 + 行动建议

📌 引言:不是每个 Agent 都需要造航天飞机

你可能已经见过这样的场景:

  • 一个初创团队花三个月搭建了"完美"的多 Agent 协作系统,结果发现 90% 的用户只需要一个简单的 FAQ 机器人。
  • 另一个团队用 200 行代码和几个 Prompt 拼出一个"最小可用"Agent,上线后每天处理上千请求,从未出过安全事故。

为什么会有如此大的反差?

答案很简单:不同的任务风险等级,需要不同成熟度的 Harness 设计。如果你只是让 AI 帮你翻译一段文字,用 H0 就够了;但如果你让 AI 自动操作公司数据库,至少需要 H2 甚至 H3。

Harness 成熟度模型(H0--H3)正是为解决这个问题而生的------它帮助团队根据业务需求评估当前系统的能力缺口,并指导逐步升级,避免过度工程化或能力不足。

本文将系统介绍

  • H0 到 H3 每一层的核心能力与适用场景;
  • 评估 Agent 系统的三个核心维度(完成性、归属性、可维护性);
  • 一个完整的自评估工具,让你 10 分钟内判断自己的 Agent 在哪个级别;
  • 从低级到高级的实战演进路径,包括触发条件和关键配置变更。

无论你是刚开始探索 AI Agent 的新手,还是已经运行大型智能体平台的老手,这套模型都能帮你看清现状、规划未来


1. 四层成熟度阶梯(H0--H3)

1.1 成熟度模型全景图

#mermaid-svg-AabSGNWdXrZpA6PH{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-AabSGNWdXrZpA6PH .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-AabSGNWdXrZpA6PH .error-icon{fill:#552222;}#mermaid-svg-AabSGNWdXrZpA6PH .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-AabSGNWdXrZpA6PH .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-AabSGNWdXrZpA6PH .marker{fill:#333333;stroke:#333333;}#mermaid-svg-AabSGNWdXrZpA6PH .marker.cross{stroke:#333333;}#mermaid-svg-AabSGNWdXrZpA6PH svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-AabSGNWdXrZpA6PH p{margin:0;}#mermaid-svg-AabSGNWdXrZpA6PH .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-AabSGNWdXrZpA6PH .cluster-label text{fill:#333;}#mermaid-svg-AabSGNWdXrZpA6PH .cluster-label span{color:#333;}#mermaid-svg-AabSGNWdXrZpA6PH .cluster-label span p{background-color:transparent;}#mermaid-svg-AabSGNWdXrZpA6PH .label text,#mermaid-svg-AabSGNWdXrZpA6PH span{fill:#333;color:#333;}#mermaid-svg-AabSGNWdXrZpA6PH .node rect,#mermaid-svg-AabSGNWdXrZpA6PH .node circle,#mermaid-svg-AabSGNWdXrZpA6PH .node ellipse,#mermaid-svg-AabSGNWdXrZpA6PH .node polygon,#mermaid-svg-AabSGNWdXrZpA6PH .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-AabSGNWdXrZpA6PH .rough-node .label text,#mermaid-svg-AabSGNWdXrZpA6PH .node .label text,#mermaid-svg-AabSGNWdXrZpA6PH .image-shape .label,#mermaid-svg-AabSGNWdXrZpA6PH .icon-shape .label{text-anchor:middle;}#mermaid-svg-AabSGNWdXrZpA6PH .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-AabSGNWdXrZpA6PH .rough-node .label,#mermaid-svg-AabSGNWdXrZpA6PH .node .label,#mermaid-svg-AabSGNWdXrZpA6PH .image-shape .label,#mermaid-svg-AabSGNWdXrZpA6PH .icon-shape .label{text-align:center;}#mermaid-svg-AabSGNWdXrZpA6PH .node.clickable{cursor:pointer;}#mermaid-svg-AabSGNWdXrZpA6PH .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-AabSGNWdXrZpA6PH .arrowheadPath{fill:#333333;}#mermaid-svg-AabSGNWdXrZpA6PH .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-AabSGNWdXrZpA6PH .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-AabSGNWdXrZpA6PH .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-AabSGNWdXrZpA6PH .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-AabSGNWdXrZpA6PH .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-AabSGNWdXrZpA6PH .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-AabSGNWdXrZpA6PH .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-AabSGNWdXrZpA6PH .cluster text{fill:#333;}#mermaid-svg-AabSGNWdXrZpA6PH .cluster span{color:#333;}#mermaid-svg-AabSGNWdXrZpA6PH div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-AabSGNWdXrZpA6PH .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-AabSGNWdXrZpA6PH rect.text{fill:none;stroke-width:0;}#mermaid-svg-AabSGNWdXrZpA6PH .icon-shape,#mermaid-svg-AabSGNWdXrZpA6PH .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-AabSGNWdXrZpA6PH .icon-shape p,#mermaid-svg-AabSGNWdXrZpA6PH .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-AabSGNWdXrZpA6PH .icon-shape .label rect,#mermaid-svg-AabSGNWdXrZpA6PH .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-AabSGNWdXrZpA6PH .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-AabSGNWdXrZpA6PH .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-AabSGNWdXrZpA6PH :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} H3: 全功能运行时
H2 + 结构化验证

  • 完整可审计
    形式化验证

不可篡改审计链

策略即代码
H2: 归因能力
H1 + 归因系统
确定性检查

故障定位到组件
H1: 可复现性
H0 + 复现日志
完整执行轨迹

可复现执行路径
H0: 最小 Harness
基础模式

仅生成最终补丁
无记忆 / 无归因 / 无审计

1.2 H0:最小 Harness ------ 基础模式,仅生成最终补丁

核心特征

  • 最简化 Harness 配置,不保存执行日志,不记录中间步骤
  • 只输出最终结果(如代码补丁、翻译文本、摘要)
  • 典型代表:单轮对话、一次性代码生成、简单问答

典型代码示例

python 复制代码
# H0 级别实现
def h0_agent(user_query: str) -> str:
    response = llm.generate(user_query)
    return response  # 只返回最终结果,无任何额外信息

适用场景

场景 是否适用 原因
代码补全 只关心最终代码,不需要中间过程
文本翻译 输出即答案,无需追溯
内容摘要 结果可人工复核
自动发邮件 无法审计谁调用了什么参数

风险等级。适合无副作用的只读任务。

1.3 H1:增加可复现性 ------ 输出再现代码的复现日志

核心特征

  • 在 H0 基础上增加复现日志(execution trace)
  • 记录完整的输入输出序列、工具调用参数、中间推理步骤
  • 支持确定性重放:相同输入 + 相同种子 → 相同输出

典型实现

python 复制代码
# H1 级别实现
def h1_agent(user_query: str) -> Tuple[str, Dict]:
    # 记录执行轨迹
    trace = {
        "input": user_query,
        "timestamp": datetime.now().isoformat(),
        "steps": []
    }
    
    # 调用 LLM
    step1 = {"action": "llm_generate", "input": user_query}
    response = llm.generate(user_query)
    step1["output"] = response
    trace["steps"].append(step1)
    
    # 返回结果和日志
    return response, trace

复现日志示例

json 复制代码
{
  "input": "修复函数 divide(a,b) 除零错误",
  "timestamp": "2026-05-18T10:30:00Z",
  "steps": [
    {
      "action": "llm_generate",
      "input": "修复函数 divide(a,b) 除零错误",
      "output": "def divide(a,b): return a/b if b!=0 else None"
    }
  ]
}

适用场景

场景 是否适用 原因
自动代码修复 需要复现执行路径来验证修复
数据分析报告 可审计数据处理步骤
客服对话 可追溯对话上下文
金融交易建议 缺少归因能力,无法解释决策

风险等级中低。可复现但无法定位失败原因。

1.4 H2:增加归因能力 ------ 故障归因与确定性需求检查

核心特征

  • 在 H1 基础上增加归因系统:能定位失败发生在哪个组件(指令层/记忆层/工具层/LLM)
  • 支持确定性需求检查:如输出格式必须符合 JSON Schema,工具调用必须符合权限策略
  • 提供失败分类:配置错误、输入错误、模型错误、外部依赖错误

归因架构图
#mermaid-svg-pP85S5ecXjiv66EQ{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-pP85S5ecXjiv66EQ .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-pP85S5ecXjiv66EQ .error-icon{fill:#552222;}#mermaid-svg-pP85S5ecXjiv66EQ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-pP85S5ecXjiv66EQ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-pP85S5ecXjiv66EQ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-pP85S5ecXjiv66EQ .marker.cross{stroke:#333333;}#mermaid-svg-pP85S5ecXjiv66EQ svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-pP85S5ecXjiv66EQ p{margin:0;}#mermaid-svg-pP85S5ecXjiv66EQ .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-pP85S5ecXjiv66EQ .cluster-label text{fill:#333;}#mermaid-svg-pP85S5ecXjiv66EQ .cluster-label span{color:#333;}#mermaid-svg-pP85S5ecXjiv66EQ .cluster-label span p{background-color:transparent;}#mermaid-svg-pP85S5ecXjiv66EQ .label text,#mermaid-svg-pP85S5ecXjiv66EQ span{fill:#333;color:#333;}#mermaid-svg-pP85S5ecXjiv66EQ .node rect,#mermaid-svg-pP85S5ecXjiv66EQ .node circle,#mermaid-svg-pP85S5ecXjiv66EQ .node ellipse,#mermaid-svg-pP85S5ecXjiv66EQ .node polygon,#mermaid-svg-pP85S5ecXjiv66EQ .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-pP85S5ecXjiv66EQ .rough-node .label text,#mermaid-svg-pP85S5ecXjiv66EQ .node .label text,#mermaid-svg-pP85S5ecXjiv66EQ .image-shape .label,#mermaid-svg-pP85S5ecXjiv66EQ .icon-shape .label{text-anchor:middle;}#mermaid-svg-pP85S5ecXjiv66EQ .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-pP85S5ecXjiv66EQ .rough-node .label,#mermaid-svg-pP85S5ecXjiv66EQ .node .label,#mermaid-svg-pP85S5ecXjiv66EQ .image-shape .label,#mermaid-svg-pP85S5ecXjiv66EQ .icon-shape .label{text-align:center;}#mermaid-svg-pP85S5ecXjiv66EQ .node.clickable{cursor:pointer;}#mermaid-svg-pP85S5ecXjiv66EQ .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-pP85S5ecXjiv66EQ .arrowheadPath{fill:#333333;}#mermaid-svg-pP85S5ecXjiv66EQ .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-pP85S5ecXjiv66EQ .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-pP85S5ecXjiv66EQ .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pP85S5ecXjiv66EQ .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-pP85S5ecXjiv66EQ .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pP85S5ecXjiv66EQ .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-pP85S5ecXjiv66EQ .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-pP85S5ecXjiv66EQ .cluster text{fill:#333;}#mermaid-svg-pP85S5ecXjiv66EQ .cluster span{color:#333;}#mermaid-svg-pP85S5ecXjiv66EQ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-pP85S5ecXjiv66EQ .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-pP85S5ecXjiv66EQ rect.text{fill:none;stroke-width:0;}#mermaid-svg-pP85S5ecXjiv66EQ .icon-shape,#mermaid-svg-pP85S5ecXjiv66EQ .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pP85S5ecXjiv66EQ .icon-shape p,#mermaid-svg-pP85S5ecXjiv66EQ .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-pP85S5ecXjiv66EQ .icon-shape .label rect,#mermaid-svg-pP85S5ecXjiv66EQ .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pP85S5ecXjiv66EQ .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-pP85S5ecXjiv66EQ .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-pP85S5ecXjiv66EQ :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} H2 归因系统
指令层
记忆层
工具层
LLM
外部
任务失败
失败分类器
指令配置错误
记忆检索失败
API 返回错误
模型输出不合规
依赖服务超时
归因报告
自动修复/人工介入

确定性需求检查示例

python 复制代码
# H2 级别的输出验证
def h2_validate_output(output: str, schema: dict) -> Tuple[bool, str]:
    try:
        data = json.loads(output)
        jsonschema.validate(data, schema)
        return True, "验证通过"
    except json.JSONDecodeError as e:
        return False, f"JSON 解析失败: {e}"
    except jsonschema.ValidationError as e:
        return False, f"Schema 不符: {e.message}"

适用场景

场景 是否适用 原因
自动 SQL 查询生成 需要验证输出 SQL 语法和权限
智能客服(复杂业务) 需要定位问题环节
自动部署脚本 失败时需快速定位原因
高频交易 Agent ⚠️ 需要 H3 归因还不够,需要完整审计

风险等级中高。能快速定位问题,但缺乏防篡改的完整证据链。

1.5 H3:全功能运行时 ------ 结构化验证报告与完整可审计性

核心特征

  • 在 H2 基础上增加结构化验证报告完整可审计性
  • 结构化验证:不仅检查"是否成功",还输出详细的验证证据(如"第 3 步调用了 send_email 工具,参数 to=admin@example.com,返回码 200")
  • 完整可审计:所有操作记录不可篡改(如写入 WORM 存储或区块链),满足合规要求
  • 策略即代码:安全策略、边界规则以代码形式管理,可版本控制、可测试

H3 完整审计链示意图
#mermaid-svg-EiZCpf1EfS09nv6W{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-EiZCpf1EfS09nv6W .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-EiZCpf1EfS09nv6W .error-icon{fill:#552222;}#mermaid-svg-EiZCpf1EfS09nv6W .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-EiZCpf1EfS09nv6W .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-EiZCpf1EfS09nv6W .marker{fill:#333333;stroke:#333333;}#mermaid-svg-EiZCpf1EfS09nv6W .marker.cross{stroke:#333333;}#mermaid-svg-EiZCpf1EfS09nv6W svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-EiZCpf1EfS09nv6W p{margin:0;}#mermaid-svg-EiZCpf1EfS09nv6W .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-EiZCpf1EfS09nv6W .cluster-label text{fill:#333;}#mermaid-svg-EiZCpf1EfS09nv6W .cluster-label span{color:#333;}#mermaid-svg-EiZCpf1EfS09nv6W .cluster-label span p{background-color:transparent;}#mermaid-svg-EiZCpf1EfS09nv6W .label text,#mermaid-svg-EiZCpf1EfS09nv6W span{fill:#333;color:#333;}#mermaid-svg-EiZCpf1EfS09nv6W .node rect,#mermaid-svg-EiZCpf1EfS09nv6W .node circle,#mermaid-svg-EiZCpf1EfS09nv6W .node ellipse,#mermaid-svg-EiZCpf1EfS09nv6W .node polygon,#mermaid-svg-EiZCpf1EfS09nv6W .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-EiZCpf1EfS09nv6W .rough-node .label text,#mermaid-svg-EiZCpf1EfS09nv6W .node .label text,#mermaid-svg-EiZCpf1EfS09nv6W .image-shape .label,#mermaid-svg-EiZCpf1EfS09nv6W .icon-shape .label{text-anchor:middle;}#mermaid-svg-EiZCpf1EfS09nv6W .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-EiZCpf1EfS09nv6W .rough-node .label,#mermaid-svg-EiZCpf1EfS09nv6W .node .label,#mermaid-svg-EiZCpf1EfS09nv6W .image-shape .label,#mermaid-svg-EiZCpf1EfS09nv6W .icon-shape .label{text-align:center;}#mermaid-svg-EiZCpf1EfS09nv6W .node.clickable{cursor:pointer;}#mermaid-svg-EiZCpf1EfS09nv6W .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-EiZCpf1EfS09nv6W .arrowheadPath{fill:#333333;}#mermaid-svg-EiZCpf1EfS09nv6W .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-EiZCpf1EfS09nv6W .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-EiZCpf1EfS09nv6W .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-EiZCpf1EfS09nv6W .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-EiZCpf1EfS09nv6W .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-EiZCpf1EfS09nv6W .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-EiZCpf1EfS09nv6W .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-EiZCpf1EfS09nv6W .cluster text{fill:#333;}#mermaid-svg-EiZCpf1EfS09nv6W .cluster span{color:#333;}#mermaid-svg-EiZCpf1EfS09nv6W div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-EiZCpf1EfS09nv6W .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-EiZCpf1EfS09nv6W rect.text{fill:none;stroke-width:0;}#mermaid-svg-EiZCpf1EfS09nv6W .icon-shape,#mermaid-svg-EiZCpf1EfS09nv6W .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-EiZCpf1EfS09nv6W .icon-shape p,#mermaid-svg-EiZCpf1EfS09nv6W .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-EiZCpf1EfS09nv6W .icon-shape .label rect,#mermaid-svg-EiZCpf1EfS09nv6W .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-EiZCpf1EfS09nv6W .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-EiZCpf1EfS09nv6W .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-EiZCpf1EfS09nv6W :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 不可篡改存储
用户请求
身份认证
审计: 请求入栈
执行引擎
工具调用
审计: 工具调用参数+结果
LLM 推理
审计: Prompt + 输出
验证器
审计: 验证结果
返回用户
审计: 响应出栈

结构化验证报告示例

json 复制代码
{
  "task_id": "task_12345",
  "status": "success",
  "verification": {
    "input_validation": {"passed": true, "checks": ["PII_filter", "injection_detection"]},
    "tool_calls": [
      {"tool": "query_db", "params": {"sql": "SELECT * FROM users WHERE id=?"}, "result": "OK", "row_count": 1},
      {"tool": "send_email", "params": {"to": "admin@example.com"}, "result": "OK", "message_id": "msg_987"}
    ],
    "output_validation": {"passed": true, "schema_match": true}
  },
  "audit_hash": "0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"
}

适用场景

场景 是否适用 原因
金融风控 Agent 需要完整审计链满足监管
医疗诊断辅助 决策过程必须可追溯
自动驾驶规划 事故后需要完整归因
企业级多 Agent 平台 满足 SOC2、HIPAA 等合规要求

风险等级。适用于高风险、强监管场景。


2. 三层评估体系:完成性、归属性、可维护性

Harness 成熟度模型从三个维度评估 Agent 系统的能力:
#mermaid-svg-bbHQL3ElPs9m0I7B{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-bbHQL3ElPs9m0I7B .error-icon{fill:#552222;}#mermaid-svg-bbHQL3ElPs9m0I7B .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-bbHQL3ElPs9m0I7B .marker{fill:#333333;stroke:#333333;}#mermaid-svg-bbHQL3ElPs9m0I7B .marker.cross{stroke:#333333;}#mermaid-svg-bbHQL3ElPs9m0I7B svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-bbHQL3ElPs9m0I7B p{margin:0;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge{stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 text{fill:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth--1{stroke-width:17;}#mermaid-svg-bbHQL3ElPs9m0I7B .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-0{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-0{stroke-width:14;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-1{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-1{stroke-width:11;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 text{fill:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-2{stroke-width:8;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-3{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-3{stroke-width:5;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-4{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-4{stroke-width:2;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-5{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-5{stroke-width:-1;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-6{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-6{stroke-width:-4;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-7{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-7{stroke-width:-7;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-8{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-8{stroke-width:-10;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-9{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-9{stroke-width:-13;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 polygon,#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 text{fill:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .node-icon-10{font-size:40px;color:black;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .edge-depth-10{stroke-width:-16;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled circle,#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:lightgray;}#mermaid-svg-bbHQL3ElPs9m0I7B .disabled text{fill:#efefef;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-root rect,#mermaid-svg-bbHQL3ElPs9m0I7B .section-root path,#mermaid-svg-bbHQL3ElPs9m0I7B .section-root circle,#mermaid-svg-bbHQL3ElPs9m0I7B .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-bbHQL3ElPs9m0I7B .section-root text{fill:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-root span{color:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .section-2 span{color:#ffffff;}#mermaid-svg-bbHQL3ElPs9m0I7B .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-bbHQL3ElPs9m0I7B .edge{fill:none;}#mermaid-svg-bbHQL3ElPs9m0I7B .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-bbHQL3ElPs9m0I7B :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 评估体系
完成性 Correctness
任务达成率
输出准确率
格式合规率
归属性 Attribution
失败定位精度
根因分析深度
决策可解释性
可维护性 Maintainability
日志完整性
审计可追溯
策略可版本化

2.1 完成性(Correctness)

衡量 Agent 能否正确完成任务

指标 H0 H1 H2 H3
任务达成率 ≥ 60% ≥ 75% ≥ 85% ≥ 95%
输出格式合规率 人工校验 ≥ 80% ≥ 95% ≥ 99.9%
幻觉率 < 10% < 8% < 5% < 1%

2.2 归属性(Attribution)

衡量失败时能否快速定位原因

指标 H0 H1 H2 H3
失败定位精度 任务级 组件级 代码行级
根因分析深度 仅日志 分类+建议 自动修复
决策可解释性 轨迹可回放 关键决策标注 完整推理链

2.3 可维护性(Maintainability)

衡量系统能否持续迭代、合规审计

指标 H0 H1 H2 H3
日志完整性 不可篡改
审计可追溯 人工追溯 半自动 全自动+哈希链
策略版本化 部分 策略即代码

3. 各层级输出差异对比表与适用场景

3.1 输出差异对比表

维度 H0 H1 H2 H3
返回内容 最终结果 结果 + 执行日志 结果 + 归因报告 结果 + 验证报告 + 审计哈希
日志粒度 任务级 组件级 调用级
可复现性 ✅(相同种子)
失败归因 ✅(组件级) ✅(代码行级)
确定性检查 ✅(格式/权限) ✅(形式化验证)
审计就绪 ✅(防篡改)
平均响应延迟 中高
存储成本 很高

3.2 适用场景矩阵

渲染错误: Mermaid 渲染失败: Lexical error on line 3. Unrecognized text. ... vs 任务风险 x-axis 低风险 --> 高风险 y-ax ----------------------^

快速选择指南

如果你的任务... 推荐级别
只读、无副作用、结果可人工复核 H0
需要复现执行过程,但错误成本低 H1
失败时需要快速定位问题组件 H2
强监管、需审计、错误成本极高 H3

4. 从 H0 到 H3 的实战演进路径

4.1 演进决策框架

#mermaid-svg-2KF7ZzVMENeX4War{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-2KF7ZzVMENeX4War .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-2KF7ZzVMENeX4War .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-2KF7ZzVMENeX4War .error-icon{fill:#552222;}#mermaid-svg-2KF7ZzVMENeX4War .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2KF7ZzVMENeX4War .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-2KF7ZzVMENeX4War .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2KF7ZzVMENeX4War .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2KF7ZzVMENeX4War .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-2KF7ZzVMENeX4War .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2KF7ZzVMENeX4War .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2KF7ZzVMENeX4War .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2KF7ZzVMENeX4War .marker.cross{stroke:#333333;}#mermaid-svg-2KF7ZzVMENeX4War svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2KF7ZzVMENeX4War p{margin:0;}#mermaid-svg-2KF7ZzVMENeX4War .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-2KF7ZzVMENeX4War .cluster-label text{fill:#333;}#mermaid-svg-2KF7ZzVMENeX4War .cluster-label span{color:#333;}#mermaid-svg-2KF7ZzVMENeX4War .cluster-label span p{background-color:transparent;}#mermaid-svg-2KF7ZzVMENeX4War .label text,#mermaid-svg-2KF7ZzVMENeX4War span{fill:#333;color:#333;}#mermaid-svg-2KF7ZzVMENeX4War .node rect,#mermaid-svg-2KF7ZzVMENeX4War .node circle,#mermaid-svg-2KF7ZzVMENeX4War .node ellipse,#mermaid-svg-2KF7ZzVMENeX4War .node polygon,#mermaid-svg-2KF7ZzVMENeX4War .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-2KF7ZzVMENeX4War .rough-node .label text,#mermaid-svg-2KF7ZzVMENeX4War .node .label text,#mermaid-svg-2KF7ZzVMENeX4War .image-shape .label,#mermaid-svg-2KF7ZzVMENeX4War .icon-shape .label{text-anchor:middle;}#mermaid-svg-2KF7ZzVMENeX4War .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-2KF7ZzVMENeX4War .rough-node .label,#mermaid-svg-2KF7ZzVMENeX4War .node .label,#mermaid-svg-2KF7ZzVMENeX4War .image-shape .label,#mermaid-svg-2KF7ZzVMENeX4War .icon-shape .label{text-align:center;}#mermaid-svg-2KF7ZzVMENeX4War .node.clickable{cursor:pointer;}#mermaid-svg-2KF7ZzVMENeX4War .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-2KF7ZzVMENeX4War .arrowheadPath{fill:#333333;}#mermaid-svg-2KF7ZzVMENeX4War .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-2KF7ZzVMENeX4War .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-2KF7ZzVMENeX4War .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-2KF7ZzVMENeX4War .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-2KF7ZzVMENeX4War .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-2KF7ZzVMENeX4War .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-2KF7ZzVMENeX4War .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-2KF7ZzVMENeX4War .cluster text{fill:#333;}#mermaid-svg-2KF7ZzVMENeX4War .cluster span{color:#333;}#mermaid-svg-2KF7ZzVMENeX4War div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-2KF7ZzVMENeX4War .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-2KF7ZzVMENeX4War rect.text{fill:none;stroke-width:0;}#mermaid-svg-2KF7ZzVMENeX4War .icon-shape,#mermaid-svg-2KF7ZzVMENeX4War .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-2KF7ZzVMENeX4War .icon-shape p,#mermaid-svg-2KF7ZzVMENeX4War .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-2KF7ZzVMENeX4War .icon-shape .label rect,#mermaid-svg-2KF7ZzVMENeX4War .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-2KF7ZzVMENeX4War .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-2KF7ZzVMENeX4War .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-2KF7ZzVMENeX4War :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 否





当前 H0
是否需要

复现执行路径?
保持 H0
升级到 H1
失败时是否需要

快速定位原因?
保持 H1
升级到 H2
是否需要

满足合规审计?
保持 H2
升级到 H3

4.2 迁移触发条件与配置变更

升级路径 触发条件 关键配置变更 工作量估计
H0 → H1 需要调试失败案例、验证修复效果 增加日志记录模块;配置结构化输出 2--3 人天
H1 → H2 故障频发、需要自动化归因 增加确定性检查(Schema 验证);引入归因分类器 1--2 人周
H2 → H3 合规要求(SOC2、HIPAA);业务风险极高 增加审计链(WORM 存储);策略代码化;形式化验证 2--4 人周

4.3 各层级 Harness 配置示例

H0 配置(最简):

yaml 复制代码
# harness_h0.yaml
version: "1.0"
level: H0
components:
  instruction: true
  safety: minimal
  memory: false
  planner: false
  tools: false
  feedback: false
  orchestration: false

H1 配置(增加日志):

yaml 复制代码
# harness_h1.yaml
version: "1.0"
level: H1
components:
  instruction: true
  safety: basic
  memory: session_only
  planner: false
  tools: false
  feedback: false
  orchestration: false
logging:
  level: INFO
  output: local_file
  include_trace: true

H2 配置(增加归因 + 确定性检查):

yaml 复制代码
# harness_h2.yaml
version: "1.0"
level: H2
components:
  instruction: true
  safety: advanced
  memory: persistent
  planner: react
  tools: true
  feedback: false
  orchestration: basic
logging:
  level: DEBUG
  output: structured_json
  include_trace: true
validation:
  input_schema: true
  output_schema: true
  tool_permission: true
attribution:
  enabled: true
  classifiers: [instruction, memory, tool, llm]

H3 配置(全功能):

yaml 复制代码
# harness_h3.yaml
version: "1.0"
level: H3
components:
  instruction: true
  safety: enterprise
  memory: persistent_with_vector
  planner: plan_execute
  tools: true_with_mcp
  feedback: true
  orchestration: full_state_machine
logging:
  level: TRACE
  output: immutable_storage (WORM)
  include_trace: true
  audit_hash: sha256
validation:
  input_schema: true
  output_schema: true
  tool_permission: true
  formal_verification: true
attribution:
  enabled: true
  classifiers: [all_components]
  auto_remediation: true
compliance:
  audit_retention_days: 3650
  signature_required: true

5. 自评估工具:你的 Agent 系统在哪个级别?

5.1 快速自测问卷

回答以下 12 个问题,统计得分:

# 问题
1 你的 Agent 能否在无人工干预下完成至少一个业务任务? +1 0
2 Agent 执行失败后,你能从日志中完整回放执行过程吗? +2 0
3 你能知道失败发生在哪个组件(指令/记忆/工具/LLM)吗? +3 0
4 你的 Agent 输出格式是否经过自动校验(如 JSON Schema)? +2 0
5 你是否记录了每次工具调用的完整参数和返回值? +2 0
6 你的系统是否支持确定性重放(相同输入 → 相同输出)? +1 0
7 你能否定位到具体是哪一行 Prompt 或哪一个参数导致失败? +3 0
8 你的审计日志是否写入不可篡改存储(如 WORM)? +4 0
9 你是否为 Agent 的行为定义了策略即代码(Policy as Code)? +3 0
10 你的系统能否自动生成结构化验证报告? +2 0
11 你是否满足行业合规要求(SOC2、HIPAA、GDPR 等)? +4 0
12 系统能否在任务失败后自动修复或给出修复建议? +2 0

评分规则

  • 0--5 分:H0 ------ 最小 Harness
  • 6--12 分:H1 ------ 具备可复现性
  • 13--20 分:H2 ------ 具备归因能力
  • 21 分以上:H3 ------ 全功能运行时

5.2 详细评估 Checklist

H0 必备项

  • 能完成至少一个业务任务
  • 有基本的输入输出

H1 必备项(H0 + 以下):

  • 记录完整的执行日志
  • 支持日志重放
  • 有明确的任务成功/失败判断

H2 必备项(H1 + 以下):

  • 失败时能自动归因到组件
  • 输出格式自动校验
  • 工具调用有权限校验

H3 必备项(H2 + 以下):

  • 审计日志不可篡改
  • 策略代码化且版本管理
  • 结构化验证报告
  • 满足行业合规要求

5.3 自评估示例

假设你的系统是一个自动 SQL 查询生成器:

  • ✅ 能生成 SQL(+1)
  • ✅ 有日志记录(+2)
  • ❌ 不知道失败是 SQL 语法错还是数据库连接错(0)
  • ✅ 输出格式是 JSON(+2)
  • ❌ 没记录工具调用参数(0)
  • ❌ 不支持确定性重放(0)
  • ❌ 无法定位到具体错误点(0)
  • ❌ 无审计(0)
  • ❌ 无策略代码化(0)
  • ❌ 无验证报告(0)
  • ❌ 不满足合规(0)
  • ❌ 无自动修复(0)

总分 = 1+2+2 = 5H0 级别。建议升级到 H1(增加确定性重放和参数记录)。


6. 总结 + 行动建议

6.1 核心要点回顾

  1. Harness 成熟度不是越高越好:H0 适合低风险任务,H3 适合强监管场景。过度设计会浪费资源,不足会带来风险。
  2. 四层模型
    • H0:最小 Harness,只输出最终结果
    • H1:增加可复现性,输出完整执行日志
    • H2:增加归因能力,定位失败组件
    • H3:全功能运行时,结构化验证 + 不可篡改审计
  3. 三层评估体系:完成性(任务正确率)、归属性(定位精度)、可维护性(审计就绪)
  4. 演进路径:根据业务需求触发升级,而非盲目追求最高级
  5. 自评估工具:12 问快速判断当前级别,Checklist 指导升级

6.2 行动建议

你的当前级别 建议行动
无 Harness 先搭建 H0,跑通核心任务
H0 评估是否需要复现调试;若是,升级到 H1
H1 评估失败频率和影响;若频繁且定位困难,升级到 H2
H2 评估合规要求;若需审计,升级到 H3
H3 持续优化验证规则和审计性能

6.3 最后的话

Harness 成熟度模型不是要你"卷"到 H3,而是帮你做出明智的设计选择

  • 如果你在做个人项目或内部工具,H0 或 H1 完全足够。
  • 如果你在构建企业级自动化,H2 是性价比最高的选择。
  • 如果你在金融、医疗、自动驾驶等强监管领域,H3 是必要条件。

记住:最好的 Harness 不是功能最多的,而是与你的风险等级最匹配的。


📚 参考资源


💬 写在最后

如果你的团队正在评估 AI Agent 系统的成熟度,欢迎使用本文的自评估工具做一个快速诊断。如果有任何疑问或想分享你的评估结果,欢迎在评论区留言交流。

下一期我们将深入 安全护栏层,探讨如何防止 AI 被诱导执行危险操作。敬请期待!

相关推荐
Raink老师7 小时前
【AI面试临阵磨枪-79】实时数据 RAG:订单、商家、物流、天气、动态库存
人工智能·面试·职场和发展
脑极体7 小时前
点亮星河AI+鸿蒙,一座艺术场馆的日神觉醒
人工智能·华为·harmonyos
Cosolar7 小时前
Chroma向量库面试学习指南
数据库·人工智能·面试·职场和发展·数据库架构
BUG指挥官8 小时前
Claude Code的自动化编程
人工智能
意图共鸣8 小时前
意图共鸣科技《认知智能白皮书》——感知与执行分离:认知架构(CA)如何重塑大模型底层结构
人工智能·架构
等一个人的@8 小时前
让数据自己开口:数睿通智库新增智能问数模块
人工智能·自然语言处理
ZGi.ai8 小时前
人工审查节点:让自动化工作流多一步人工把关
运维·人工智能·自动化·人机协同·智能体工作流·人工审查
王莎莎-MinerU8 小时前
MinerU 深度技术解析:从架构原理到生产部署的全面指南
css·人工智能·自然语言处理·架构·ocr·个人开发
盘古信息IMS9 小时前
盘古信息IMS V6 8.0重磅发布:以薪火AI数智平台点燃离散制造数智化引擎
大数据·人工智能·制造