读见

Grafana 将 SLO 与错误预算应用于 AI 智能体行为

原题Grafana Applies SLOs and Error Budgets to AI Agent Behaviour

约 5 分钟约 1,167 字原文英文

推荐理由把任务完成度转成服务目标,有助于看见响应正常却回答变差的渐进漂移。运维团队可据此讨论行为评估、质量预算和回归修复的优先级。

读前速览

5 个要点

Grafana 提出将 SLO 和错误预算应用于 AI 智能体行为,把幻觉、任务完成度、有害性和成本转化为可度量的 SLI,从而让团队能够发现传统可观测性所遗漏的渐进式质量漂移。

  1. 传统可观测性无法判断 AI 智能体行为是否良好,只能判断它是否做出了响应。

    延迟、错误率和 token 数量无法说明答案是否正确、是否基于所提供的上下文、是否有用。Grafana 的解决方案是对行为本身进行评估,并将结果转化为可针对 SLO 追踪的 SLI。

  2. 质量应作为多个独立行为来衡量,而非一个聚合分数。

    Grafana 认为质量是多维度的:一个智能体可能有据可依但成本高昂,有帮助但偶尔有害,或者准确但缓慢。分别度量让团队可以针对不同行为设定不同目标,而不是将重要故障隐藏在单一综合数字中。

  3. 错误预算将智能体质量转化为决策机制,而不仅仅是一个百分比。

    当预算尚有剩余时,团队可以尝试新的提示词、模型或智能体行为;随着预算被消耗,优先级转向修复。这反映了 SRE 长期以来在可靠性与开发速度之间的权衡。

  4. 错误预算燃烧率让渐进式行为漂移以告警无法做到的方式变得可见。

    智能体可以持续成功响应,但答案在模型、提示词或检索变更后逐渐变得不那么有用,每天退化零点几个百分点。单次糟糕的交互在 30 天目标面前是隐形的,但持续下降会稳步消耗预算。

  5. 最难的问题是定义可接受的行为,而 SLO 的好坏取决于其底层度量。

    与可用性目标不同,对于智能体应达到 85%、95% 还是 99% 的任务完成度或有据性,几乎没有共识。Grafana 建议通过评估建立基线并逐步收紧目标,同时警告说分类错误的 LLM 评判器或设计不佳的评估可能制造虚假的精确性。

完整摘要

Grafana Labs 提出将可靠性工程概念——评估、服务等级目标(SLO)和错误预算——应用于 AI 智能体行为。其核心论点是:传统可观测性可以确认智能体快速响应且没有技术错误,但无法判断答案是否正确、是否有据可依、是否有用。Grafana 的方法是对行为本身进行评估(有据性、任务完成度、有害性、PII 泄露、提示词注入抵抗力),使用 LLM 评判器或确定性检查,然后将结果转化为针对 SLO 度量的 SLI,例如 30 天内 95% 的对话被判定为已完成任务。剩余的 5% 成为错误预算,决定团队是可以继续实验还是应转向修复。该方法被认为对渐进式漂移尤其有价值——模型、提示词或检索变更每天侵蚀零点几个百分点的质量——而非突发性故障。Grafana 承认难点在于定义可接受的行为,因为这方面的共识远少于可用性目标,并警告说 SLO 的好坏取决于其底层的评估。文章将此与 Anthropic 的 pass@k 与 pass^k 评估实践以及 OpenTelemetry 的智能体遥测语义约定并列讨论。

Grafana Labs is proposing a familiar reliability engineering approach for one of the less familiar problems in modern software: how to measure whether an AI agent is actually behaving well. In a recent article, the company describes using evaluations, service-level objectives (SLOs) and error budgets to turn behaviours such as hallucination, task fulfilment, toxicity, and cost into measurable targets that can be monitored over time.

The idea addresses a fundamental limitation of conventional application observability. Traditional metrics can tell engineers that an agent responded quickly, encountered no technical errors, and consumed a certain number of tokens, but none necessarily indicate whether its answer was correct, grounded in available information, or useful to the user. Grafana's approach is to evaluate the behaviour itself and turn the result into an SLI that can be measured against an SLO.

The first step is evaluation. An evaluation examines an agent interaction and determines whether it met a particular behavioural criterion. Grafana describes examples including whether a response was grounded in its supplied context, fulfilled the user's request, contained toxic content, exposed personal information, or succumbed to prompt injection. Evaluations can use another language model as a judge, but deterministic checks such as regular expressions can also be used where the behaviour can be identified without an LLM.

This is an important distinction from trying to create a single "agent quality score." Grafana argues that quality is multidimensional: an agent might be well grounded but expensive, helpful but occasionally toxic, or accurate but slow. Treating these as separate measurements allows teams to establish different objectives for the behaviours that matter to a particular application rather than hiding important failures inside an aggregate score.

Once a behaviour can be measured, conventional SRE concepts become applicable. Grafana gives the example of setting an SLO requiring 95% of conversations to be judged as fulfilled over 30 days. The remaining 5% becomes the error budget: the amount of unacceptable behaviour the team has explicitly decided it can tolerate within that period.

This approach matters less for the percentage itself than for the decision-making model it creates. When sufficient error budget remains, teams can experiment with prompts, models, or agent behaviour. As the budget is consumed, the priority can shift towards improving quality rather than introducing additional changes. This is conceptually the same trade-off SRE teams have long used to balance reliability against development velocity. Grafana's existing SLO tooling similarly defines an SLO through an SLI, target, and time window, with the error budget calculated from the gap between the target and 100%.

The approach becomes particularly useful when agent behaviour changes gradually rather than failing dramatically. A conventional alert might identify a sudden spike in failed requests, but an agent can continue responding successfully while its answers become subtly less useful. A model change, prompt modification, retrieval change, or shift in user behaviour might cause quality to deteriorate by a fraction of a percentage point each day.

Grafana argues that monitoring error-budget burn can make this type of drift visible. A single poor interaction may not matter against a 30-day objective, but a persistent decline can steadily consume the available budget. That provides a different signal from traditional infrastructure monitoring: the concern is not necessarily whether one execution failed, but whether the aggregate behaviour of the system is moving outside an agreed reliability envelope.

The hardest part may not be creating the SLO, but deciding what constitutes acceptable behaviour. Unlike availability targets, where organisations have decades of operational experience to draw upon, there is considerably less consensus around whether an agent should achieve 85%, 95% or 99% fulfilment or groundedness.

Grafana's approach is to establish a baseline through evaluations and then use historical results to help recommend an appropriate target. The target can subsequently be tightened as the agent matures. The concept also reflects a broader change in what observability needs to cover. Grafana's own Agent Observability work grew from the problem of monitoring its Grafana Assistant as prompt, model, and tool changes made traditional monitoring insufficient. In community discussions, Grafana engineers have distinguished between offline evaluations, which validate changes against known scenarios, and online evaluations, which assess behaviour against real production interactions.

Traditional observability generally asks whether the system is available and performing within technical limits. AI systems introduce another layer: whether the system's decisions and outputs remain within acceptable behavioural boundaries. That creates a feedback loop between evaluation, observability, and engineering change that more closely resembles continuous quality measurement than conventional application monitoring.

There is also an important limitation. An SLO is only as useful as the measurement underneath it. If an LLM judge consistently misclassifies responses, the resulting error budget may provide a false sense of precision. Similarly, a poorly designed evaluation can reward an agent for producing outputs that technically satisfy a criterion while failing to satisfy the user's actual intent.

This means organisations still need representative evaluation datasets, clear definitions of acceptable behaviour, appropriate deterministic checks where possible, human review for ambiguous cases, and ongoing validation of the evaluators themselves. The SLO provides the governance mechanism, but it does not make the underlying quality measurement inherently correct.

SLOs have traditionally provided a common language for engineering teams to balance reliability and change: define what matters, measure it, establish an acceptable threshold, and use the remaining error budget to guide decisions.

>Applying the same thinking to AI agents extends that model from system reliability to behavioural reliability. An agent can be technically available while being operationally unreliable because its answers are increasingly inaccurate, ungrounded, expensive, or unsafe. Treating those behaviours as measurable service objectives gives engineering teams a mechanism for detecting that degradation and deciding when experimentation should give way to remediation.

The significance is therefore not simply that Grafana has added another AI metric. It is that a mature SRE principle is being adapted to an environment where the system can remain "up" while becoming progressively less trustworthy. For organisations moving AI agents into production, that distinction may become one of the more important parts of AI observability.

Grafana's SLO approach is part of a broader industry effort to make agent behaviour measurable, although other organisations are approaching the problem from different directions. Anthropic, for example, has developed more formal evaluation practices for agents, using defined tasks, repeated trials and multiple graders to measure whether an agent consistently achieves its intended outcome. Its distinction between pass@k, which measures whether an agent succeeds at least once across multiple attempts, and pass^k, which measures whether it succeeds consistently across all attempts, is particularly relevant to production agents where reliability matters more than finding an answer eventually.

OpenTelemetry is approaching the problem at a different layer, working on standardised semantic conventions for agent telemetry so that traces, metrics and logs can provide a consistent basis for evaluating agent behaviour across frameworks and vendors. Together, these approaches illustrate an emerging pattern: evaluations determine whether an agent behaved correctly, observability provides the evidence, and SLOs provide the operational threshold for deciding whether that behaviour is acceptable.

值得记下

传统指标可以告诉工程师智能体响应迅速、没有遇到技术错误、消耗了一定数量的 token,但这些都不一定能说明其答案是否正确、是否基于可用信息、是否对用户有用。
当智能体行为是逐渐变化而非突然失败时,这种方法变得尤为有用。
SLO 的价值取决于其底层的度量。
一个智能体可以在技术上可用,但在运营上不可靠,因为其答案越来越不准确、缺乏依据、成本高昂或不安全。
评估决定智能体行为是否正确,可观测性提供证据,SLO 提供判断该行为是否可接受的操作阈值。