AI Skills AI技能 15h ago Updated 14h ago 更新于 14小时前 48

Agent Observability Is Not Logging: The Evidence Layer Production Agents Need 代理可观测性不是日志记录:生产代理需要的证据层

Agent observability must shift from tracking infrastructure health to reconstructing and verifying autonomous work outcomes, with the "claim of completion" as the fundamental unit of observation A four-layer mental model (Run, Trace, Thread, Outcome) is essential for understanding agent behavior at appropriate granularity, with "Outcome" being the critical addition for production systems Evidence-first tracing should preserve seven layers (Identity, Intent, Context, Control, Action, Proof, Outco Agent可观测性的核心单位不是请求,而是"完成声明",需重建Agent看到的上下文、执行的决策、产生的副作用和验证证据 提出Run-Trace-Thread-Outcome四层观察模型,区分单次调用、任务尝试、长期上下文和最终结果,不同层级对应不同问题类型 证据优先追踪需保留七层结构:身份、意图、上下文、控制、行动、证明和结果,用结构化证据替代私人思维链记录 传统基础设施指标(延迟、错误率、CPU)无法反映Agent任务责任,健康的基础设施仍可能产生错误的Agent结果 生产追踪应转化为评估用例,形成"追踪→失败模式→评估→发布"的闭环改进循环,避免依赖人工复现和被动响应

68
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • Agent observability must shift from tracking infrastructure health to reconstructing and verifying autonomous work outcomes, with the "claim of completion" as the fundamental unit of observation
  • A four-layer mental model (Run, Trace, Thread, Outcome) is essential for understanding agent behavior at appropriate granularity, with "Outcome" being the critical addition for production systems
  • Evidence-first tracing should preserve seven layers (Identity, Intent, Context, Control, Action, Proof, Outcome) to enable operators to accept, reject, retry, or escalate work without reconstructing from memory
  • Production traces must feed directly into evaluation loops, converting real-world failures into regression tests rather than treating them as unavoidable anecdotes
  • Cost per verified outcome should replace token counts and latency as the primary metric, accounting for the full workflow including retries, evaluators, and human review

Why It Matters

This article addresses a critical gap in AI engineering: conventional observability tools are fundamentally inadequate for autonomous agents that can produce fluent but incorrect outputs while all infrastructure metrics remain green. For practitioners building production agent systems, the framework provides actionable guidance on what to measure, how to structure traces, and how to close the loop between observability and evaluation—transforming production failures into systematic improvements rather than recurring incidents.

Technical Details

  • Four-unit mental model: Run (single operation), Trace (related runs for one task attempt), Thread (longer-lived context spanning multiple traces), Outcome (accepted terminal state with evidence and authority)
  • Seven-layer evidence structure: Identity (IDs and versions), Intent (task contract and acceptance criteria), Context (sources and freshness), Control (routing and policy decisions), Action (validated tool calls), Proof (tests and verifications), Outcome (terminal state and ownership)
  • OpenTelemetry GenAI integration: Standardized telemetry for model calls, token usage, tool calls, and results, with explicit handling of sensitive content through structured metadata and access-controlled evidence references
  • Six measurement categories: Outcome quality (verified-task success, policy-violation rate), Path efficiency (tool calls per task, retry rate), Reliability (terminal-state coverage, escalation rate), Evidence quality (independent verification, citation validity), Control (approval-gate coverage, audit completeness), Economics (cost per verified outcome)
  • Evaluation loop: Capture production traces → identify failure patterns → curate safe test cases → add deterministic checks or human rubrics → make targeted changes → evaluate offline → monitor in bounded releases

Industry Insight

  • Organizations should prioritize observing one consequential workflow end-to-end rather than attempting comprehensive token-level monitoring, focusing on high-stakes tasks like code changes, security classifications, or customer-facing recommendations where verification gaps cause real harm
  • The shift from "cost per token" to "cost per verified outcome" will reshape agent economics, revealing that seemingly cheap model calls become expensive when multiplied by retries, evaluator calls, and human repair time—this metric will become essential for executive reporting and resource allocation
  • Teams that fail to implement evidence-first tracing with outcome-level verification will face increasing regulatory and operational risk as agents handle more consequential tasks; the framework positions early adopters to build defensible audit trails while avoiding the privacy risks of indiscriminate content capture

TL;DR

  • Agent可观测性的核心单位不是请求,而是"完成声明",需重建Agent看到的上下文、执行的决策、产生的副作用和验证证据
  • 提出Run-Trace-Thread-Outcome四层观察模型,区分单次调用、任务尝试、长期上下文和最终结果,不同层级对应不同问题类型
  • 证据优先追踪需保留七层结构:身份、意图、上下文、控制、行动、证明和结果,用结构化证据替代私人思维链记录
  • 传统基础设施指标(延迟、错误率、CPU)无法反映Agent任务责任,健康的基础设施仍可能产生错误的Agent结果
  • 生产追踪应转化为评估用例,形成"追踪→失败模式→评估→发布"的闭环改进循环,避免依赖人工复现和被动响应

为什么值得看

这篇文章为AI从业者提供了Agent可观测性的系统性框架,填补了传统服务监控与Agent自主工作评估之间的关键空白。它提出的证据优先方法和四层观察模型,帮助团队从"服务是否健康"转向"任务是否真正完成且符合策略",对构建生产级Agent系统具有重要指导意义。

技术解析

  • 四层观察模型:Run(单次模型调用/检索/工具调用/策略检查)、Trace(一次任务尝试的相关运行集合)、Thread(跨多次追踪的长期用户或工作流上下文)、Outcome(已接受的终端状态、证据、验证器和权限)。慢模型响应是Run级问题,编辑错误文件是Trace级问题,丢失客户上下文是Thread级问题,缺少审批记录是Outcome级问题。
  • 证据优先追踪七层结构:Identity(追踪ID、Agent/模型/工具/策略版本)、Intent(标准化任务合同、验收标准、负责人、风险等级)、Context(源ID、检索结果、记忆读写、新鲜度信号)、Control(路由、预算、重试原因、权限决策、升级条件)、Action(验证的工具参数、范围、幂等键、开始/结束时间、结果)、Proof(测试、API响应、引用、评估器输出、策略检查)、Outcome(已完成、阻塞、需审查、拒绝、超时或升级)。
  • 关键指标体系:Outcome quality(验证任务成功率、人类接受率、策略违规率、 unsupported-claim率)、Path efficiency(每次验证任务的工具调用数、重试率、重复观察率、死胡同率)、Reliability(终端状态覆盖率、超时率、工具失败率、恢复成功率)、Evidence quality(独立验证的关键操作比例、引用有效性、陈旧上下文发生率)、Control(审批门控覆盖率、拒绝操作率、权限边界违规、审计完整性)、Economics(每次验证结果的成本、每完成任务token数、每人审查分钟数)、Drift(按模型/提示/工具/策略/检索/Agent版本的轨迹变化)。
  • 隐私安全设计:不依赖记录私人思维链或永久存储所有对话,而是通过可观察产物解释行为。OpenTelemetry GenAI语义约定明确将提示、完成、工具调用和工具结果内容视为潜在敏感信息,建议优先使用结构化元数据和访问控制的证据引用,除非完整内容捕获有明确的运营目的、保留策略、脱敏路径和访问模型。

行业启示

  • 从服务健康到任务责任:Agent系统需要超越传统可观测性,建立以"完成声明验证"为核心的评估体系。团队应将关注点从"服务是否可用"转向"任务是否真正完成且符合策略",健康的基础设施指标无法保证正确的Agent结果。
  • 追踪即评估输入:生产追踪不应仅用于调试,而应系统性地转化为回归测试和评估用例。建议建立"捕获追踪→识别失败模式→构建最小安全用例→添加确定性检查→定向改进→评估发布"的闭环流程,将生产追踪转化为回归测试而非 recurring anecdote。
  • 成本计算需包含完整工作流:工程领导者应关注"每次验证结果的成本"而非单纯模型调用成本。真正的高效工作流需考虑重试、评估器调用、人类审查和失败尝试的总成本,单次模型调用廉价但需要四次重试、两次评估器调用和三十分钟人工修复的工作流并非真正高效。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Agent Agent LLM 大模型 Evaluation 评测 Programming 编程