Insights in batch evaluation
Some evaluators go beyond scoring and provide insights. When you include one of these evaluators in a batch evaluation, the service analyzes your agent sessions, groups related problems across sessions, and returns the groups in the insightResults field of the GetBatchEvaluation response. Each insight describes a pattern, the root causes behind it, and suggested fixes, so that you can see why your agent behaves as it does and what to change.
The following evaluators provide insights. For details about each evaluator, see Insight evaluators.
| Evaluator | Insights it provides |
|---|---|
|
|
The evaluator finds failure patterns across sessions, each with root causes, suggested fixes, and the spans where the failures occurred. See Failure analysis evaluator. |
How it works
-
Start: You start a batch evaluation with an insight-providing evaluator, alone or together with other evaluators such as
Builtin.GoalSuccessRate. -
Evaluate: The service evaluates each session and records whether the session had failures.
-
Group: The service groups the failures from all sessions into insights and determines the root causes of each insight.
-
Read: You call
GetBatchEvaluationto get the evaluator summaries and theinsightResults, and you find the per-session results in CloudWatch Logs.
For example, a batch evaluation of about 14 sessions typically finishes in about 3 minutes. Run time grows with the number of sessions and the number of failure patterns found.
Start a batch evaluation with insights
Add Builtin.FailureAnalysis to the evaluators list when you call StartBatchEvaluation. The data source, time range, and output options work as described in Start a batch evaluation.
Example
You can also encrypt the results with a customer managed key by specifying kmsKeyArn. The insight results are encrypted with that key. If the key policy does not grant the service the kms:GenerateDataKey permission, StartBatchEvaluation returns a ValidationException and the service does not create a batch evaluation. For the key policy that you need, see Batch evaluation encryption.
Read the insights
Poll GetBatchEvaluation until the status is COMPLETED, COMPLETED_WITH_ERRORS, FAILED, or STOPPED. Then read insightResults from the response. For the full list of status values and response fields, see Get batch evaluation results.
Example
insightResults fields
insightResults is a list of up to 50 insights. When no session has failures, the list is empty.
The following table describes the fields of each insight.
| Field | Type | Description |
|---|---|---|
|
|
String |
The kind of insight. For |
|
|
String |
A short name for the insight. Up to 200 characters. |
|
|
String |
A description of the pattern that the insight represents. Up to 4,000 characters. |
|
|
Timestamp |
When the service generated the insight. |
|
|
Integer |
The number of sessions that the insight affects. A session can appear in more than one insight, so the counts across insights can add up to more than the number of sessions with failures. |
|
|
List |
The root causes behind the insight. Up to 50 per insight. This field is not present when the insight has no root causes. |
|
|
List |
Example sessions for the insight. Present at this level only when the insight has no root causes. Otherwise, the sample sessions are on each root cause. Up to 10 per insight. |
Each root cause has a name, an explanation, a suggested fix, and up to 10 sample sessions. Each sample session has up to 10 failure findings, which locate the failures at spans. For a readable description of an insight, see Failure insights in the failure analysis evaluator documentation.
Example response
The following example shows part of a GetBatchEvaluation response for a batch evaluation that ran Builtin.FailureAnalysis and Builtin.GoalSuccessRate. The insightResults field is trimmed to one insight with one root cause.
{ "batchEvaluationId": "MyFailureAnalysis-1a2b3c4d5e", "batchEvaluationName": "MyFailureAnalysis", "status": "COMPLETED", "evaluationResults": { "numberOfSessionsCompleted": 20, "numberOfSessionsFailed": 0, "totalNumberOfSessions": 20, "evaluatorSummaries": [ { "evaluatorId": "Builtin.GoalSuccessRate", "statistics": {"averageScore": 0.95}, "totalEvaluated": 20, "totalFailed": 0 }, { "evaluatorId": "Builtin.FailureAnalysis", "statistics": {"averageScore": 0.2}, "totalEvaluated": 20, "totalFailed": 0 } ] }, "insightResults": [ { "type": "FAILURE", "name": "Tool calls fail because of permission and quota errors", "description": "Tool calls that change the state of a service fail because the caller lacks permissions or because a quota is exceeded.", "createdAt": "2026-10-12T17:18:26+00:00", "affectedSessionCount": 3, "rootCauses": [ { "name": "Constraints are not visible to the agent before it acts", "explanation": "The agent calls tools without checking quotas or permissions first, so the call fails and the request is not completed.", "suggestedFix": "Update the tools to return current limits and permissions, and update the system prompt to check them before it changes a resource.", "affectedSessionCount": 2, "sampleSessions": [ { "sessionId": "session-0001", "lastSeenAt": "2026-10-12T17:10:37+00:00", "findings": [ { "targetId": "1a2b3c4d5e6f7a8b", "targetType": "SPAN_ID", "description": "The scale_service tool call returned an error because the requested replica count exceeded the quota.", "category": "execution-error-rate-limiting", "confidence": 0.9 } ] } ] } ] } ] }
In this example, the average score for Builtin.FailureAnalysis is 0.2, which means that failures were found in 20 percent of the sessions. For this evaluator, a higher score is worse.
Per-session results
In addition to the insights, Builtin.FailureAnalysis writes one result for each session to CloudWatch Logs, like any session-level evaluator. By default, the results go to the log group /aws/bedrock-agentcore/evaluations/batch-evaluations/results/default, in the log stream run-<batchEvaluationId>. If you set outputConfig, the results go to the log group that you specify.
Each result has the following values:
-
Score:
1.0when failures were found, and0.0when none were found. A higher score is worse. -
Label:
Failures FoundorNo Failures Found. -
Explanation: A summary of the failures in the session, or
No failures detected in this session.
The service also publishes the score as the Builtin.FailureAnalysis metric in the Bedrock-AgentCore/Evaluations CloudWatch namespace.
Job status and errors
The status of the batch evaluation and the insightResults field depend on how the run went:
| Case | Status | insightResults |
|---|---|---|
|
Failures were found. |
|
A list of insights. |
|
No session had failures. |
|
An empty list. |
|
Some sessions could not be evaluated. |
|
Insights for the sessions that were evaluated. The |
|
The service could not generate the insights. |
|
Not present. The |
|
No session could be evaluated. |
|
Not present. |
A session that has no agent spans in the selected time range fails with the message No spans were found for the session, and the batch evaluation can then end with the status COMPLETED_WITH_ERRORS. If every selected session fails this way, check the service name, log groups, and time range in your data source configuration.
When insight generation fails, the errorDetails field contains the message Insight generation failed for the Builtin.FailureAnalysis evaluator.