Building trust in AI agents: A production-ready evaluation framework with Amazon Bedrock AgentCore
https://aws.amazon.com/blogs/machine-learning/building-trust-in-ai-agents-a-production-ready-evaluation-framework-with-amazon-bedrock-agentcore/📌 AWS 揭露內部教訓:Agent 答得流暢,不代表答得對
TL;DR:AWS 分享用 Bedrock AgentCore 建立 Agent 持續評估框架的實戰經驗,核心問題是傳統監控抓不到「答錯但看起來很確信」的失敗。
傳統軟體壞掉的時候會大聲抗議:拋錯誤、當機、紅燈亮起。AI Agent 不會。它會用流暢、自信的語氣,給出一個看起來完全正常的答案,而這個答案可能是錯的。等到有人類發現問題,信任已經先碎了。
🤔 監控全綠,答案卻是錯的
AWS 的 Sales, Marketing, and Global Services(SMGS)Operations 團隊建置了一套服務全球 AWS Field Sales 的多 Agent 系統,讓業務人員能用自然語言、透過 Amazon Quick 詢問業務問題。背後由多個專職子 Agent 協作:Performance Insights Agent 負責依地區範圍產出營收與績效的敘事型洞察,Customer Insights Agent 整合產品使用狀況、支援歷程、合約狀態與互動資料,拼出完整的客戶視角,Data Insights Agent 則是讓業務團隊用白話查詢結構化分析資料的 text-to-SQL agent。所有答案都依使用者所屬地區與角色權限做範圍限制,業務團隊會拿這些數字去規劃客戶策略、準備會議,所以答案必須是對的。
上線前評估 Customer Insights Agent 時,團隊發現:在多次執行過程中,監控訊號始終是綠燈,但那只代表系統「有回應」,不代表回應「是對的」。如果這些錯誤沒被攔下來就上線,業務人員引用了灌水的數字,付出代價的是他們在客戶面前的信譚。
🧩 風險不會隨著發布結束,反而隨著每次變動而增加
這個風險會隨著新 Agent 加入、資料、prompt、程式碼或模型的每一次變更而擴大,甚至在完全沒有發版的情況下也會擴大,因為上游資料管線每週都會刷新。更麻煩的是「協調發布」本身的風險:當一次資料變更、工具變更,以及對應的 prompt 更新本該同時上線,卻分批落地時,系統會在所有變更到齊之前,以不匹配的狀態運作。
📊 一次版本錯位,通過率從 78% 掉到 38%
在一次 pre-production 測試中,光是這種不匹配的時間窗口,就讓通過率從 78% 直接摔到 38%。這個數字具體說明了為什麼「上線前評估一次就算了」是不夠的,必須有一套框架能持續判斷答案是否有憑有據、是否正確,並能把每一次失敗往回追溯到根因究竟出在資料、prompt 還是 Agent 程式碼。
🧩 以 AgentCore Evaluations 為核心骨架,橫跨五個評估維度
團隊用 Amazon Bedrock AgentCore 的 Evaluations 能力作為整套品質體系的連結組織,搭配 Amazon Bedrock Guardrails 處理安全性、Amazon CloudWatch 負責指標與告警追蹤、Amazon S3 與 Amazon Redshift 做評估結果持久化、Amazon Quick 呈現儀表板,以及 AWS Lambda 執行客製化的評估邏輯。
文章把 Agent 評估拆成五個維度:安全性(是否在界定的行為邊界內)、品質(回應是否正確、連貫、有憑有據)、效能(是否夠快夠穩定)、成本(是否能有效率地規模化運作),以及操作可控性(能否快速偵測、診斷並修復問題)。安全性是第一優先,沒有任何 Agent 可以在不符合安全門檻的情況下上線或持續運作;品質則是五者中最難做好、也最需要獨立框架支撐的一環。
💡 三層評估:工具、Agent、多 Agent 協作
這套框架同時套用在三個層級:工具層級(每個能力,例如客戶去重工具或圖檢索工具,都有自己的評估契約)、Agent 層級(每個子 Agent 做端到端評估),以及多 Agent 層級(跨 Agent 邊界的協作路徑要評估連貫性、路由是否正確、整合結果是否準確)。文章強調這套九階段的評估流程會同時作用在這三個層級上,而且這個心智模型不只適用於這套系統,也適用於任何要新建或整合的生產級 Agent。
這也呼應了文章對 Agent 本質的定位:傳統軟體是確定性的,相同輸入必然得到相同輸出;機器學習模型引入了機率性輸出,催生了 MLOps;而 Agent 疊加了第三層複雜度:自主、多步驟的推理,問題從「有沒有壞掉」變成「整條推理鏈上的每個決策是否合理」。Agent 是非確定性的,同樣的輸入可能走不同的推理路徑,而且會在路由、工具選擇、結果整合上做連鎖決策,任何一步悄悄出錯都可能污染後面所有環節,最致命的是它會靜靜地劣化:延遲不變、錯誤率不變,但回應品質正在流失,因為 Agent 依然「有回應」,只是「回應錯了」。
🎯 實務啟示
如果你的團隊正在把 Agent 推向生產環境,這篇文章最值得帶走的一句話是:品質不該是最後一道 QA 關卡,而該是 Agent 本身的作業系統,被持續測量、自動防護,並隨著每一次互動改善。具體做法上,值得參考的是把評估契約下放到工具層級,而不只是在整個系統跑完之後做端到端驗收,這樣才能在問題擴散之前,精準定位到底是哪一個工具、哪一次 prompt 變更出了錯。
🔗 來源
- 標題:Building trust in AI agents: A production-ready evaluation framework with Amazon Bedrock AgentCore
- 作者/機構:Rui Li, AWS
- 連結:https://aws.amazon.com/blogs/machine-learning/building-trust-in-ai-agents-a-production-ready-evaluation-framework-with-amazon-bedrock-agentcore/
#AIAgents #AWS #BedrockAgentCore #AgentEvaluation #MLOps #ProductionAI #LLMOps #AgenticAI #QualityAssurance #CloudAI
原始資料 AWS ML · 收集於 2026-10-17
摘要原文
Every organization racing to deploy AI agents faces the same reckoning: an agent that demos beautifully can quietly degrade in production, and by the time a human notices, the trust is already broken. Where traditional software fails loudly, agents fail softly. They return an answer that looks confident, reads fluently, and is wrong. When that answer drives a real business decision, the cost is not a broken feature. It’s a broken relationship with the user. That’s the quality problem at its core. The challenge is therefore not building agents that work once, but proving they keep working, at scale, across every sub-agent, every workflow, and every release. The teams that win the agent era will be the ones who treat quality not as a final QA step but as the operating system of the agent itself: continuously measured, automatically defended, and improved with every interaction. In this post, we show how we built a continuous quality loop for production-ready agentic solutions at scale using Amazon Bedrock AgentCore. The solution uses Amazon Bedrock AgentCore and other AWS services for internal use, so sellers and sales leaders can ask business questions in plain English from Amazon Quick. Behind that single experience, several specialized sub-agents work together: the Performance Insights Agent for territory-scoped revenue and performance, the Customer Insights Agent for customer intelligence, the Data Insights Agent for text-to-SQL over foundational datasets, and direct dashboard access. Answers are scoped to each user’s territory and role-level security. Field teams use these answers to assist in planning account strategy, prepare for customer meetings, so the numbers must be right. The most damaging failure is not a crash. It’s a fluent, confident answer that is quietly wrong. Before launch, when we evaluated the Customer Insights Agent, we found exactly that: Through the different runs, monitoring stayed green. It told us the system had responded, not whether the answer was right. Had these errors shipped uncaught, the field would have paid for them. A seller who repeats an inflated figure can lose credibility with the customer. This is exactly why we caught it before launch. The risk doesn’t end at launch: it grows with every new agent and every change to data, prompts, code, or models. It also grows without any release, because upstream pipelines refresh the data every week. Coordinated releases introduce a related risk: when a data change, a tool change, and a paired prompt update are meant to ship together but land apart, the system runs mismatched until all changes catch up. In one pre-production test, that mismatch window by itself dropped the pass rate from 78 percent to 38 percent. To catch failures like these, before every release and continuously in production, we need a framework that can show whether answers are grounded and correct, and trace each failure back to its root cause in the data, the prompt, or the agent’s code. At AWS, the Sales, Marketing, and Global Services (SMGS) Operations team developed a production multi-agent system serving AWS Field Sales worldwide. It serves two distinct audiences. For field sales teams, it replaces hours of manual data analysis with on-demand, conversational intelligence, helping sellers understand the health of their business, surface risks and opportunities, and take action faster. For leadership, it powers business management cadences including Weekly Business Reviews (WBRs), surfacing the signals that matter across the portfolio without requiring manual report preparation. The same agentic system serves both the seller on the front line and the leader reviewing performance at scale. The agentic system orchestrates a growing portfolio of specialized sub-agents, each owning a distinct capability domain. Among them: the Performance Insights Agent generates natural-language business intelligence narratives from complex sales data, turning raw metrics into actionable seller insights. The Customer Insights Agent assembles a 360-degree view of each customer by synthesizing signals across product usage, support history, contract status, and engagement data, helping sellers understand where a customer is in their journey and what they need next. The Data Insights Agent is a text-to-SQL agent that account teams use to query structured analytics data in plain English without writing a single line of SQL. These three agents are the ones referenced throughout the rest of this post. Coordinating these agents reliably at scale made one thing clear: agentic quality wasn’t an operational concern to manage later. It was the prerequisite for operating. A single degraded sub-agent can silently corrupt every response downstream, and traditional monitoring won’t catch it. That reality made a full lifecycle evaluation framework not optional but necessary. AgentCore Evaluations, a capability of Amazon Bedrock AgentCore, is the connective tissue powering it, alongside Amazon Bedrock Guardrails (safety), Amazon CloudWatch (metrics, alarms, tracing), Amazon Simple Storage Service (Amazon S3) and Amazon Redshift (evaluation persistence), Amazon Quick (dashboards), and AWS Lambda (custom evaluators). In this post, we share how we tackled the hardest operational challenges in running AI agents at enterprise scale, and how Amazon Bedrock AgentCore Evaluations became the backbone of agent quality. Specifically, we cover: Traditional software is deterministic: the same input produces the same output. Machine learning (ML) models introduced probabilistic outputs, and MLOps emerged to manage their training, versioning, monitoring, and re-training. AI agents add a third layer of operational complexity: autonomous, multi-step reasoning, where the question shifts from “did something break?” to “is the agent making sound decisions across its entire reasoning chain?” Agents inherit the hard problems of both predecessors, and introduce some new ones. They’re non-deterministic, following different reasoning paths for identical inputs. They make cascading decisions across routing, tool selection, and synthesis, where a single step can fail quietly and corrupt everything downstream. Most critically, they degrade silently: latency stays low, error rates stay flat, yet the quality of agent response erodes, because the agent is still responding . It is just responding wrong . Agent evaluation is the practice of catching exactly that. It spans five dimensions: safety (is it behaving within defined boundaries?), quality (is the agent producing correct, coherent, grounded responses?), performance (is it fast and reliable enough?), cost (is it running efficiently at scale?), and operational control (can we detect, diagnose, and remediate issues quickly?). A mature evaluation practice addresses five continuously, throughout the full agent lifecycle. In this post, we share how we operationalize five evaluation dimensions across a production multi-agent system. Safety and security is our first priority. No agent ships, and no agent keeps running, if it can’t meet its safety bar. Quality gets the most space in this post because it’s the hardest of the five to get right and benefits most from a dedicated framework, but it doesn’t outrank safety. Performance, cost, and operational control are woven into every stage of the lifecycle alongside both. Critically, this framework applies at every level of the agent hierarchy. At the tool level , each capability (a customer disambiguation tool, graph retrieval tool) has its own evaluation contract. At the agent level , each sub-agent is evaluated end-to-end. At the multi-agent level , orchestration paths are evaluated for coherence, correct routing, and synthesis accuracy across agent boundaries. The nine stages apply at three levels simultaneously, and this hierarchy is not specific to this product. It’s the right mental model when we build or integrate new production agents.
由 claude-code/sonnet 自動生成