Evaluate skill-equipped agents with Strands Evals and Amazon Bedrock AgentCore
https://aws.amazon.com/blogs/machine-learning/evaluate-skill-equipped-agents-with-strands-evals-and-amazon-bedrock-agentcore/📌 Agent 選對了技能,卻沒照著做?AWS 推出 Skill 評測新解法
TL;DR:Strands Evals 與 Amazon Bedrock AgentCore Evaluations 新增 skill 專屬評測器,能抓出「選錯技能」與「半途而廢」兩種隱藏失敗。
一個 agent 產出流暢、看似合理的回應,不代表它真的用上了你精心設計的領域知識——這正是 skill 架構帶來的新盲點,而一般的輸出品質評分完全看不出來。
🤔 把所有流程塞進一個 system prompt,遲早會撐不住
合規檢查、文件處理流程、升級政策、工程慣例……把這些通通寫進一個 system prompt 或應用邏輯裡,維護與更新的成本會迅速失控。Skill 是一種模組化的替代方案:一個 skill 是可重複使用的一組指令,通常存放在 SKILL.md 檔案裡,教會 agent 執行特定領域任務,例如遮蔽合約敏感資訊、核對發票,或遵循團隊的 pull request 慣例。因為 skill 遵循開放的 Agent Skills 標準,可以跨相容 harness 移植,agent 在執行時也只載入當下需要的那個 skill,而不必把所有程序都塞進核心指令。
這種 skill 組合性帶來兩種一般輸出品質指標抓不到的失敗模式:agent 呼叫了不適合這個任務的 skill;或者 agent 呼叫對了 skill,卻跳過或只部分遵循了其中的指令。兩種情況都可能產出流暢、看似合理的回應,卻根本沒有真正用上你預先設計好的領域知識。想抓出這類問題,評測就不能只看最終回應。
🧩 三個 skill 評測器,分別盯緊不同環節
Strands Evals SDK 與 Amazon Bedrock AgentCore Evaluations 為此加入了三種 skill 導向的評測器:
- Skill Selection Accuracy:檢查每個被呼叫的 skill 是否適合任務,agent 是否選對了正確的 skill。
- Skill Instruction Following:評估 agent 對該 skill 規定步驟的完整遵循程度,採五級評分——Fully Followed(1.0)、Mostly Followed(0.75)、Partially Followed(0.5)、Minimally Followed(0.25)、Not Followed(0.0),達到 Mostly Followed 以上才算通過。
- SkillInvoked:純粹的確定性檢查,不呼叫任何模型,是 Strands Evals 專屬的功能。
文中舉了一個 HR 助理 agent 的例子:它同時具備 PTO(特休)規劃與員工福利兩個 skill。若員工詢問牙科、視力福利,agent 是否呼叫對了 benefits skill,屬於 Skill Selection Accuracy 要抓的路由問題。而當 agent 正確呼叫了 PTO 規劃 skill,該 skill 要求依序辨識 employee_id、檢查 PTO 餘額、對照最新 HR 政策核對 rollover 規則、才能提交 PTO 申請——如果 agent 檢查了餘額卻跳過 rollover 規則,依然可能給出看似合理的回應,但已經違反了規定流程,這正是 Skill Instruction Following 要揪出的執行失敗,並能指出具體是哪一步被跳過。
💡 兩種失敗,兩種不同的修法
選錯 skill 通常指向 skill 描述彼此重疊或定義模糊;指令遵循不完整,則可能需要更清楚的步驟拆解、不同的 skill 結構,或換一個能力更強的 agent 模型。由於 judge-based 評測器會針對每個被呼叫的 skill 回傳結果,即使是多 skill 串接的執行流程,依然可以逐一診斷——你能明確定位是哪個 selection 或 instruction-following 的結果拉低了整體分數。如果整趟執行完全沒有呼叫任何 skill,judge-based 評測器就不會產出分數,這時建議搭配 SkillInvoked 用在已知 routing 需求的 regression test 上。
AgentCore Evaluations 可以直接讀取既有的 OpenTelemetry traces,支援即時評測、對已儲存 session 做批次處理,也能對線上流量持續取樣。每個評測結果都會附上 spanContext,包含辨識出的 skill invocation 所在的 sessionId、traceId、spanId。除了兩個內建的 skill 判斷型評測器,開發者還能在 TOOL_CALL 層級自訂評測器,樣板可以引用 {invoked_skill}、{skill_content} 這類 skill 佔位符——引用了哪個佔位符,也決定了這個評測器會在什麼時機被觸發。
🎯 實務啟示
如果你的 agent 架構已經在用 skill/plugin 這類模組化方式注入領域知識,光看最終輸出的品質分數並不足夠——你需要額外檢查「有沒有選對 skill」與「有沒有照著 skill 的步驟走完」這兩層。對正在建置 HR、法遵、客服等企業級 agent 的團隊來說,這套 Skill Selection Accuracy/Skill Instruction Following/SkillInvoked 的組合,提供了一個相對具體、可落地的評測起點。
🔗 來源
- 標題:Evaluate skill-equipped agents with Strands Evals and Amazon Bedrock AgentCore
- 作者/機構:Sangmin Woo(AWS ML Blog)
- 連結:https://aws.amazon.com/blogs/machine-learning/evaluate-skill-equipped-agents-with-strands-evals-and-amazon-bedrock-agentcore/
#AWS #AgentCore #StrandsEvals #AIAgents #LLMOps #AgentEvaluation #OpenTelemetry #SkillMd #GenAI #AIObservability
原始資料 AWS ML · 收集於 2026-09-22
摘要原文
General-purpose agents handle a broad range of tasks, but you still need them to follow the procedures that run your business: compliance checks, document-processing workflows, escalation policies, engineering conventions. Encoding all of that in one system prompt or in application logic gets hard to maintain and update. Skills are a modular alternative. A skill is a reusable set of instructions, usually stored in a SKILL.md file, that teaches an agent a domain-specific task like redacting a contract, reconciling an invoice, or following a team’s pull-request conventions. Because skills follow the open Agent Skills standard, they are portable across compatible harnesses, and the agent loads only the skill it needs at runtime instead of carrying every procedure in its core instructions. A skill packages one or more tools with the context an agent needs to use them correctly: This modular approach helps teams specialize agents faster, reuse proven procedures across agents and workflows, keep behavior consistent, and update domain-specific guidance without fine-tuning the underlying model or rewriting the agent’s core logic. This skill composability in agents introduces two failure modes that general output-quality metrics can miss: the agent invokes a skill that is not appropriate for the task and the agent invokes the right skill but skips or only partially follows its instructions. Both failures can produce a fluent, plausible response without having used your pre-determined domain knowledge. An evaluation therefore cannot examine the final response alone. To make these failures measurable, Strands Evals SDK and Amazon Bedrock AgentCore Evaluations , a capability of Amazon Bedrock AgentCore, add skill-focused evaluators: In this post, you will learn how to evaluate skill selection and instruction following from a recorded trajectory in Strands Evals, add deterministic routing checks to a test suite, evaluate skill behavior from OpenTelemetry traces with AgentCore Evaluations, and interpret per-skill results to choose the right fix, all through the AgentCore CLI. An agent receives a task and a catalog of skills, chooses a skill, loads it, and acts. The run is recorded as a trajectory in Strands Evals or an OpenTelemetry trace in your observability layer. This record can now be used for all three skill evaluators. Skill Selection Accuracy checks whether each invoked skill fits the task and whether the agent invoked the correct skill. The following figure shows how the agent chooses a skill from the 1:n skills provided to it. Skill Selection Accuracy then scores whether the selected skill is the correct one for the task. You can find the prompt template and the rubric of this evaluator in the prompt template documentation . Figure 1: Skill Selection Accuracy checks whether the agent chose an appropriate skill for the task Skill Instruction Following asks how fully the agent followed that skill’s prescribed steps. You can find the prompt template and the rubric for this evaluator in the prompt template documentation . Figure 2: Skill Instruction Following measures how completely the agent followed the skill’s steps SkillInvoked is deterministic. It calls no model and is specific to Strands Evals. An overview of these skill evaluators is demonstrated diagrammatically in the following figure. Figure 3: Overview of the three skill evaluators Consider an HR assistant agent with skills for paid time off (PTO) planning and discussing employee benefits. An employee asks about their dental and vision benefits. If the agent invokes the benefits skill, it may produce a more polished response. If the tool call succeeded but the agent chose the wrong playbook, Skill Selection Accuracy isolates that routing decision. Now suppose the agent correctly invokes the PTO-planning skill for a related request. The skill instructs the agent to identify the employee_id , check the PTO balance, check the rollover rules against the latest HR policy, and then submit a PTO request if the conditions allow. If the agent checks the PTO balance but skips the rollover rules, the agent might still return a plausible response while violating the prescribed process. Skill Instruction Following isolates that execution failure and identifies the skipped step. The failures require different fixes. An inappropriate selection often points to overlapping or ambiguous skill descriptions. Incomplete instruction following might call for clearer steps, a different skill structure, or a more capable agent model. Because judge-based evaluators return per-invoked-skill results, multi-skill runs remain diagnosable: you can identify which selection or instruction-following result lowered the aggregate score. If no skill is invoked, the judge-based evaluators don’t produce a score. Pair them with SkillInvoked when a regression test has a known routing requirement. To follow the Strands Evals section, install the SDKs: You also need a recorded agent run. The skill evaluators accept either a Strands Evals Session or a raw message list as the trajectory. At launch, skill extraction recognizes signals from the Strands AgentSkills plugin, Claude Code, Claude Agent SDK, OpenAI Agents SDK, Codex, Gemini CLI, OpenHands, Google ADK, and generic SKILL.md file reads. To follow the AgentCore Evaluations section, you need: The examples in this post use the AgentCore CLI: Strands Evals is useful when you control the test cases and can rerun the agent during development or continuous integration. Check out the complete Strands evals code sample created for the HR assistant agent in the complete code sample . The skill evaluators read the run’s trajectory. TracedHandler collects the agent’s spans and attaches them as the trajectory: Suppose the agent loaded pdf-table-extraction , ran pdftotext -layout , but never opened the extracted file or located the table boundaries. A simplified report: Skill Instruction Following uses five ratings: Fully Followed (1.0), Mostly Followed (0.75), Partially Followed (0.5), Minimally Followed (0.25), and Not Followed (0.0). It passes at Mostly Followed or better. AgentCore Evaluations works directly with existing OpenTelemetry traces, supporting on-demand evaluation, batch processing of stored sessions, and continuous sampling of live traffic. Telemetry is organized into sessions, traces, and spans. Because skill evaluators operate at the tool-call level, each result includes a spanContext with the sessionId , traceId , and spanId of the recognized skill invocation. A skill invocation is recognized through either a SKILL.md filesystem read, which works across frameworks, or a native skill-loading tool in Strands Agents, LangGraph Deep Agents, Google ADK, or the Claude Agent SDK. AgentCore Evaluations includes two built-in judge-based evaluators for skills. To score something the built-ins don’t cover, create a custom evaluator at the TOOL_CALL level. Tool-level templates can reference skill placeholders: For example, a template that checks one specific property of a skill run: The placeholders you reference also decide when the evaluator runs. A template containing {invoked_skill} runs only on skill-invocation spans, and one containing {skill_content} additionally requires the loaded body. The following commands target the separate skill-enabled runtime. Substitute the runtime name from skills-evaluation/ agent_config.json ( agent_id or agent_arn ) for <skill-runtime> . Strands.SkillInvoked is client-side only and has no CLI equivalent.
由 claude-code/sonnet 自動生成