---
title: "Harness 与评估参考：agent lens - Harness 与评估 | 思行致远"
canonical: "https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-agent-lens/"
dateModified: "2026-06-30"
datePublished: "2026-06-30"
---

打开 AI·外脑目录  

 

AI·外脑

 [返回专栏首页](https://siyuanailab.com/knowledge/)

 ×

 

站内搜索 

⌕

   

主要栏目

 

- [AI 核心概念](https://siyuanailab.com/knowledge/ai-core/)

- [工作流](https://siyuanailab.com/knowledge/workflows/)

- [工具配置与选型](https://siyuanailab.com/knowledge/toolkits/)

- [信源与标准](https://siyuanailab.com/knowledge/sources/)

- [场景案例 待开发](https://siyuanailab.com/knowledge/scenarios/)

- [职业与能力](https://siyuanailab.com/knowledge/career/)

 

专题

 

- [从这里开始](https://siyuanailab.com/knowledge/start/)

- [获取与安装](https://siyuanailab.com/knowledge/install/)

- [建设日志](https://siyuanailab.com/knowledge/ops/)

  

[工作流子目录](https://siyuanailab.com/knowledge/workflows/) 

基础设施层

 

- [浏览器自动化 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/browser-automation/)

- [MCP 工具 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/mcp-tools/)

- [文件系统与本地执行 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/filesystem-local/)

- [API 网关与工具路由 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/api-tool-routing/)

Skill 生产线

 

- [目标明确 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/goal-definition/)

- [Skill 设计 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/skill-design/)

- [代码实现 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/implementation/)

- [测试评估 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/testing-evaluation/)

Skill 参考库

 

- [写作与内容 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/writing-content/)

- [研究与知识 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/research-knowledge/)

- [沟通与协作 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/communication-collaboration/)

- [产品与项目 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/product-project/)

- [数据与分析 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/data-analysis/)

- [创意与设计 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/creative-design/)

- [商业与营销 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/business-marketing/)

Agent Building

 

只收录有多步工作流、工作标准、Loop、Harness、工具链或通信机制的真 Agent；不收纯 persona、profile、curated list 或只有 system prompt 的仓库。

 

- [多 Agent 框架 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/multi-agent-frameworks/)

- [工作流编排 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/)

- [Sub-agent 模式 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/sub-agent-patterns/)

- [Harness 与评估 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/) 

- [WF-091 Harness 与评估参考：agent lens](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-agent-lens/)

- [WF-092 Harness 与评估参考：claude code hooks multi agent observability](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-claude-code-hooks-multi-agent-observability/)

- [WF-093 Harness 与评估参考：HALO](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-halo/)

- [WF-094 Harness 与评估参考：litefuse](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-litefuse/)

- [WF-095 Harness 与评估参考：www project agent observability standard](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-www-project-agent-observability-standard/)

  

Agent Building · Harness 与评估 · Agent Building 参考 · WF-091

 

# Harness 与评估参考：agent lens

 

思行致远 · 2026/6/30 · 置信度：高

 

HarnesstraceobservabilityAgent评估

 

一个多会话 Agent 轨迹 harness，可运行 Claude Code/Codex、捕获 ATIF 轨迹、追踪文件 diff、重放/重采样并记录 subagent。

 

# agent lens

 

> 一个多会话 Agent 轨迹 harness，可运行 Claude Code/Codex、捕获 ATIF 轨迹、追踪文件 diff、重放/重采样并记录 subagent。

 

## 这个能力解决什么问题

 

AgentLens 解决的是“Agent 做了什么无法复盘”的问题。编码 Agent 往往跨多轮、多会话、多文件甚至多个子 Agent 工作，单看最终 diff 不知道它为什么这么改、哪一步写了文件、子 Agent 做了什么、同一个 session 换一次采样会不会不同。AgentLens 把这些运行过程标准化成 ATIF 轨迹，并用 shadow git 记录文件状态变化。

 

## 核心逻辑

 

输入是一份 YAML 实验配置：engine、provider、model、work_dir、session_mode、allowed_tools、sessions、subagents 和可选 judge。Harness 按 session 顺序运行 Claude Code 或 Codex，工作目录中的文件变化由隐藏 shadow git 追踪，每个 Agent step、tool call、observation、thinking block 被写成 ATIF。可选择 isolated/chained/forked session，做 session resampling、turn-level replay，或让 auto-judge 按 rubric 每 N 轮检查并 early exit。输出是 run 目录、ATIF JSON、state_changelog、diff、judge verdict 和 web UI 可视化。

 

## 技术结构

 

- 关键模块：engine adapter 支持 Claude Code SDK 和 Codex CLI；config YAML 定义实验；shadow git 追踪文件；ATIF adapter 标准化轨迹；session modes 管理上下文继承；subagent capture 链接 parent/child trajectory；judge 模块做在线 rubric 检查；UI 展示 run/diff/memory。
 
- 调用链路：加载 YAML → 准备 work_dir/memory → 调 engine 执行 session → 捕获工具和消息 → shadow git 记录 step-level diff → 可选 judge/resample/replay → 输出 run artifacts。
 
- 输入输出：输入是项目目录、会话 prompt、工具白名单、engine/provider auth；输出是 ATIF、run_meta、session_diff、state_changelog、judge.jsonl、subagent trajectory。
 
- 核心依赖：Python 3.12+、uv、Claude Code 或 Codex CLI；UI 需要 Node/npm。

 

## 为什么值得参考

 

它把 Agent 评估从“看结果”推进到“看轨迹”。尤其是 shadow git 的设计很实用：不要求 Agent 主动报告自己改了什么，而是在外部追踪每步文件变化。对于研究 Agent 行为、调试子 Agent 和做工作流验收，它比普通日志更有证据力。

 

## 为什么不建议直接套用

 

AgentLens 是研究/实验 harness，不是业务执行框架。它会注入工作目录路径、创建 memory 文件、使用 shadow git、捕获 reasoning/工具轨迹，这些在隐私或企业环境中必须审查。Codex API capture 和 resampling 可能需要带计费 API key；turn-level replay 仍标注实验性，不能直接当生产审计保证。

 

## 如何改造成自己的版本

 

- 先采用它的配置思想：每次评估都用 YAML 固定 engine、work_dir、工具、sessions 和预算。
 
- 在内部工作流中实现 shadow diff 或最小文件变更记录，不依赖 Agent 自述。
 
- 每个子 Agent 产出单独轨迹，并在父轨迹里只放引用，避免日志混乱。
 
- 用 judge rubric 做早停只限低风险实验，不让 judge 自动批准生产动作。
 
- 定期重采样同一任务，观察失败模式是否稳定，而不是只跑一次。

 

## 适用场景

 

- 编码 Agent、研究 Agent、子 Agent 行为分析、轨迹复盘。
 
- 需要比较 Claude Code 与 Codex 等不同 engine 的执行差异。
 
- 需要 session chaining/forking/resampling 的实验。

 

## 不适用场景

 

- 不允许捕获工具轨迹、文件 diff 或 reasoning 的敏感项目。
 
- 只需要简单线上监控，不需要重放/重采样的业务应用。
 
- 希望开箱即用评估业务质量但没有 rubric 和任务集的团队。

 

## Agent Building 判断

 

- 多步工作流：YAML sessions → engine run → trajectory capture → shadow diff → judge/resample/replay → inspect UI。
 
- 工作标准：config 明确 engine、tools、session mode、budget、memory、subagents、judge rubric。
 
- Loop 标准：session chaining/forking、resampling、turn-level replay 和 auto-judge early exit 支撑实验循环。
 
- Harness 标准：ATIF、shadow git、state_changelog、run_meta、web UI、judge 构成完整 harness。
 
- 工具调用链路或 Agent 间通信：捕获 Claude/Codex 工具调用和 subagent trajectory ref。
 
- 为什么不是 persona / profile / system prompt only：它是运行、捕获、重放和评估框架，不是提示词库。

 

## 参考信息

 

- 原项目：[agent-lens](https://github.com/dreadnode/agent-lens)
 
- 作者：dreadnode
 
- 相关概念：[[Agent Harness]]、[[可观测性]]
 
- 相关卡片：[workflow-read-095](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-www-project-agent-observability-standard/)

 

## 参考对象信息

 

**名称：**agent-lens

 

**作者：**dreadnode

 

**链接：**[https://github.com/dreadnode/agent-lens](https://github.com/dreadnode/agent-lens)

 

## 适用场景与行动

 

**场景：**Agent Building / Harness 与评估

 

**适合谁：**关注 AI 工作流、Skill 生产和 Agent Building 的读者

 

**下一步：**先阅读边界说明，再判断它是否适合改造成自己的Harness 与评估流程。

 

当前内容按公开来源和已审核草稿整理，只作为工作流理解与方法论参考。

 

涉及客户数据、外部平台、会议记录和业务系统的场景，必须保留人工确认与授权边界。

  

[下一张：Harness 与评估参考：claude code hooks multi agent observability](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/agent-building-harness-evaluation-claude-code-hooks-multi-agent-observability/)

 

[返回当前分类](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/) [返回工作流专栏](https://siyuanailab.com/knowledge/workflows/)
