Grafana Labs 提出使用一种熟悉的可靠性工程方法,解决现代软件中一个相对陌生的问题:如何衡量 AI 智能体的实际表现是否良好。在最近的一篇文章中,该公司介绍了如何使用评估、服务级别目标(SLO)和错误预算,将幻觉、任务完成度、毒性和成本等行为转化为可衡量的目标,并持续监控。
这一构想针对的是传统应用可观测性的一项根本局限。传统指标可以告诉工程师,智能体响应速度很快、没有遇到技术错误,并消耗了一定数量的 Token,但这些指标未必能说明它的答案是否正确、是否以现有信息为依据,或者是否对用户有用。Grafana 的方法是评估行为本身,并将结果转换为可以对照 SLO 进行衡量的 SLI。
第一步是评估。评估会检查一次智能体交互,并判断它是否满足某项特定的行为标准。Grafana 给出的示例包括:响应是否以所提供的上下文为依据、是否完成了用户请求、是否包含有毒内容、是否泄露个人信息,或者是否受到提示词注入的影响。评估可以使用另一个语言模型充当裁判,但如果无需 LLM 就能识别相关行为,也可以使用正则表达式等确定性检查。
这与尝试创建单一的“智能体质量分数”存在重要区别。Grafana 认为,质量是多维的:一个智能体可能回答有据可依但成本高昂,可能有帮助却偶尔生成有毒内容,也可能准确但速度缓慢。将这些方面作为独立指标,可以让团队针对特定应用真正关注的行为分别设定目标,而不是将重要故障隐藏在一个汇总分数中。
一旦某种行为可以被衡量,传统的 SRE 概念就可以派上用场。Grafana 举例称,可以设置一个 SLO,要求在 30 天内,95% 的对话被判定为已经完成用户请求。剩余的 5% 就成为错误预算,即团队明确决定在这一时期内可以容忍的不可接受行为数量。
这种方法的重要性,与其说在于百分比本身,不如说在于它所建立的决策模型。当错误预算仍然充足时,团队可以尝试调整提示词、模型或智能体行为。随着预算逐渐耗尽,工作重点可以转向提高质量,而不是继续引入更多变更。从概念上看,这与 SRE 团队长期以来用于平衡可靠性和开发速度的取舍相同。Grafana 现有的 SLO 工具同样通过 SLI、目标值和时间窗口定义 SLO,并根据目标值与 100% 之间的差额计算错误预算。
当智能体行为逐渐变化,而不是突然发生严重故障时,这种方法尤其有用。传统告警可能会发现失败请求突然激增,但智能体可能仍在正常响应,其答案却在悄然变得不那么有用。模型变更、提示词修改、检索方式变化或用户行为转变,都可能导致质量每天下降零点几个百分点。
Grafana 认为,监控错误预算的消耗可以使这种漂移变得可见。对于一个 30 天的目标而言,单次糟糕交互可能并不重要,但持续下降会稳定地消耗可用预算。这提供了一种不同于传统基础设施监控的信号:需要关注的不一定是某一次执行是否失败,而是系统的整体行为是否正在偏离约定的可靠性边界。
最困难的部分可能不是创建 SLO,而是决定什么才算可接受的行为。对于可用性目标,组织可以借鉴数十年的运维经验;但对于智能体的任务完成度或回答有据性究竟应该达到 85%、95% 还是 99%,业界远未形成同等程度的共识。
Grafana 的方法是先通过评估建立基线,再利用历史结果帮助推荐适当的目标值。随着智能体逐渐成熟,之后还可以收紧目标。这一概念也反映出可观测性覆盖范围正在发生更广泛的变化。Grafana 自身的智能体可观测性工作,源于监控 Grafana Assistant 时遇到的问题:随着提示词、模型和工具不断变化,传统监控已无法满足需求。在社区讨论中,Grafana 工程师将离线评估与在线评估区分开来:前者针对已知场景验证变更,后者则根据真实的生产交互评估行为。
传统可观测性通常关注系统是否可用,以及性能是否处于技术限制范围内。AI 系统引入了另一个层面:系统的决策和输出是否仍处于可接受的行为边界内。这在评估、可观测性和工程变更之间建立了一个反馈闭环,与传统应用监控相比,它更接近持续质量度量。
这种方法也存在一项重要限制。SLO 的有效性完全取决于其底层测量。如果充当裁判的 LLM 持续错误分类响应,由此产生的错误预算可能会带来一种虚假的精确感。同样,设计不当的评估可能会奖励那些在技术上满足某项标准,却没有真正满足用户意图的智能体输出。
这意味着,组织仍然需要具有代表性的评估数据集、对可接受行为的清晰定义、在适当场景中采用确定性检查、对模糊案例进行人工审查,并持续验证评估器本身。SLO 提供了治理机制,但并不会让底层质量测量天然变得正确。
SLO 传统上为工程团队平衡可靠性和变更提供了一套共同语言:定义重要事项,对其进行衡量,设定可接受的阈值,并利用剩余的错误预算指导决策。
将同样的思路应用于 AI 智能体,可以把这一模型从系统可靠性扩展到行为可靠性。智能体在技术层面可能处于可用状态,但在运行层面却并不可靠,因为它的答案正在变得越来越不准确、缺少依据、成本高昂或不安全。将这些行为作为可衡量的服务目标,可以为工程团队提供一种机制,用于发现这种退化,并决定何时应该停止实验、转而进行修复。
因此,其意义并不只是 Grafana 又增加了一项 AI 指标,而是一个成熟的 SRE 原则正在被应用于一种特殊环境:系统即使仍然“在线”,也可能变得越来越不可信。对于正在将 AI 智能体投入生产环境的组织而言,这一区别可能会成为 AI 可观测性中更为重要的组成部分之一。
Grafana 的 SLO 方法是行业推动智能体行为可度量化这一更广泛努力的一部分,不过其他组织正在从不同方向解决这个问题。例如,Anthropic为智能体制定了更加正式的评估实践,通过定义明确的任务、重复试验和多个评分器,衡量智能体能否持续达成预期结果。其中,pass@k 与 pass^k 之间的区别尤其适用于生产环境中的智能体:pass@k 衡量智能体在多次尝试中是否至少成功一次,pass^k 则衡量它能否在所有尝试中始终成功。对于生产智能体而言,可靠性比最终偶然找到一次答案更加重要。
OpenTelemetry 则从不同层面处理这一问题,它正在为智能体遥测制定标准化语义约定,使追踪、指标和日志能够为跨框架、跨供应商评估智能体行为提供一致的基础。这些方法共同展现出一种正在形成的模式:评估负责判断智能体的行为是否正确,可观测性提供证据,而 SLO 则提供用于判断该行为是否可以接受的运行阈值。
原文链接:
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Grafana Labs suggested using a familiar reliability engineering method to solve a relatively new problem in modern software: how to measure the good performance of AI AI agent. In a recent article, the company described how assessments, service level targets (SLOs) and erroneous budgets were used to translate illusions, mission fulfilment, toxicity and cost behaviour into measurable targets and to monitor them on an ongoing basis.
This concept addresses a fundamental limitation of the detectability of traditional applications. Traditional indicators could tell engineers that AI agent responded quickly, did not encounter technical errors and consumed a certain amount of Token, but they did not necessarily indicate whether its answers were correct, based on available information or useful for users. Grafana's method is to assess the behaviour itself and to convert the results into a SLI that can be measured against SLO.
The first step is assessment. The evaluation examined a AI agent interaction and judged whether it met a particular standard of conduct. Examples given by Grafana include whether the response was based on the context provided, whether the user request was completed, whether it contained toxic content, whether personal information was disclosed or whether it was affected by prompt injections. The assessment can be based on another language model as a referee, but it can also be tested for certainty, such as regular expression, if LLM is not needed to identify the relevant behaviour.
This is an important difference from trying to create a single “AI agent mass score”. According to Grafana, quality is multidimensional: a AI agent may answer well-founded but costly, may help produce occasional toxic content, or may be accurate but slow. These aspects, as stand-alone indicators, allow teams to set separate targets for behaviour that is of real concern to a given application, rather than concealing critical malfunctions in an aggregate score.
Once something can be measured, the traditional RSRE concept can be useful. Grafana, for example, could set up a SLO to require that within 30 days, 95 per cent of the dialogues were determined to be completed. The remaining 5 per cent is the wrong budget, i.e. the number of unacceptable acts that the team has clearly decided to tolerate during this period.
The importance of this approach lies not so much in the percentage itself as in the decision-making model it creates. When the wrong budget is still sufficient, the team can attempt to adjust prompt, model or AI agent behaviour. As the budget was running out, the focus could shift to improving quality rather than continuing to introduce more changes. Conceptually, this is the same as the SRE team's long-standing trade-off between reliability and speed of development. Grafana's existing SLO tool also defines SLO by SLI, target value and time window, and calculates the wrong budget based on the difference between the target value and 100%.
This approach is particularly useful when the behaviour of AI agent is gradually changing rather than when there is a sudden and severe breakdown. Traditional alarms may find a sudden surge in failed requests, but AI agent may still be responding normally, but its answers are quietly becoming less useful. Model changes, changes in prompt, changes in search methods or changes in user behaviour may lead to a decrease in quality by a few percentage points per day.
Grafana believes that monitoring the consumption of wrong budgets can make this drift visible. For a 30-day target, a single bad interaction may not be important, but a continuous decline will steadily consume the available budget. This provides a signal different from that of traditional infrastructure monitoring: it is not necessarily the failure of a given enforcement, but whether the system as a whole is moving away from the agreed level of reliability.
The most difficult part might be not to create SLO, but to decide what was acceptable. For usability goals, organizations can learn from decades of experience; however, industry is far from reaching the same level of consensus on whether AI agent ' s mandate completion or response should be 85 per cent, 95 per cent or 99 per cent.
Grafana ' s approach is to establish a baseline first through assessment and then use historical results to help recommend appropriate target values. As AI agent matures, it can then tighten targets. This concept also reflects a broader change in observable coverage. Grafana's own AI agent observability work stems from the problems encountered in monitoring Grafana Assistant: As prompt, models and tools change, traditional surveillance is no longer sufficient. In community discussions, Grafana engineers distinguished the offline assessment from the online assessment: the former validated changes to known scenarios, while the latter assessed behaviour on the basis of real production interactions.
Traditional observability is usually concerned with the availability of systems and whether performance is within technical constraints. AI introduces another dimension: whether system decision-making and output remain within acceptable behavioural boundaries. This creates a feedback loop between assessment, detectability and engineering change, which is closer to continuous quality measurement than traditional application monitoring.
There is also an important limitation to this approach. The effectiveness of SLO depends entirely on its bottom measurement. If the LLM acting as a referee continues to respond by misclassify, the resulting misbudgeting may give rise to a false sense of precision. Similarly, poorly designed assessments may reward the output of AI agent, which technically meets a standard but does not really satisfy the user ' s intent.
This means that the organization still needs representative assessment data sets, a clear definition of acceptable behaviour, a definitive examination in the appropriate scene, manual review of vague cases and continuous validation of the evaluator itself. SLO provides a governance mechanism, but does not allow for natural correctness of bottom mass measurements.
SLO has traditionally provided a common set of language for the engineering team to balance reliability and change: defining matters of importance, measuring them, setting acceptable thresholds and using the remaining incorrect budgets to guide decision-making.
Applying the same line of thought to AI AI agent can extend this model from system reliability to behavioural reliability. AI agent may be available at the technical level, but it is not reliable at the operational level because its answers are becoming increasingly inaccurate, ill-founded, costly or unsafe. These actions, as measurable service objectives, could provide the engineering team with a mechanism to detect such degradation and decide when the experiment should be stopped and repaired.
Thus, the significance is not just that Grafana has added an AI indicator, but that a mature SRE principle is being applied to a particular environment: the system, even if it remains “online”, may become less credible. This distinction is likely to be one of the more important components of AI ' s observability for organizations that are putting AI AI agent into the production environment.
Grafana's SLO approach is part of a broader effort to promote AI agent behavioural tolerance, although other organizations are addressing the problem in different directions. For example, Anthropic has developed a more formal assessment practice for AI agent to measure the sustainability of Z42Z in achieving the desired results through well-defined tasks, repeated tests and multiple scorers. Of these, the difference between pass@k and pass^k applies in particular to AI agent:pass@k in the production environment to measure whether AI agent has been successful at least once in several attempts, and pass^k to measure whether it has been successful in all attempts. For the production of AI agent, reliability is more important than finding an answer by chance.
OpenTelemetry, which addresses the issue at different levels, is developing standardized semantic protocols for AI agent telemetry, so that tracking, indicators and logs can provide a consistent basis for assessing Z42Z behaviour across frameworks and suppliers. Together, these methods present an emerging model: assessment of the correctness of the conduct of AI agent and evidence of the detectability, while SLO provides operational thresholds to determine the acceptability of the conduct.
Original link:
Auto-fetched and translated by AI Atlas. All rights belong to the original author.