Create online evaluation
The CreateOnlineEvaluationConfig API creates a new online evaluation
configuration that continuously monitors your agent's performance using live traffic.
This asynchronous operation sets up the service to evaluate agent traces as they are
generated during normal operation.
When you create an online evaluation, you specify a unique configuration name, the
data source to monitor (either a list of CloudWatch log groups or an agent endpoint), and a
list of evaluators to apply (up to 10, combining built-in and custom evaluators). You
also provide an IAM service role ARN for execution. The enableOnCreate
parameter is required and determines whether the evaluation starts running immediately
upon creation (executionStatus = true) or remains disabled until explicitly
enabled (executionStatus = false).
Topics
Execution status control
The executionStatus parameter determines whether the evaluation job
actively processes traces:
-
ENABLED – The evaluation job runs continuously, processing incoming traces and generating evaluation results.
-
DISABLED – The evaluation configuration exists but the job is paused. No traces are processed or evaluated.
Evaluator protection
When you create an evaluation configuration with executionStatus set
to ENABLED, the system automatically locks any custom evaluators you've
selected. Once locked:
-
No modifications allowed – You cannot update the evaluator's configuration, prompts, or settings. Clone a new evaluator if you need to make changes.
-
No deletion allowed – You cannot delete the evaluator while any evaluation job is using it (running).
Code samples for Starter Toolkit, AgentCore SDK, and AWS SDK
The following code samples demonstrate how to create online evaluation configurations using different development approaches. Choose the method that best fits your development environment and preferences.
Console
You can create online evaluation configurations using the Amazon Bedrock AgentCore console's visual interface. This method provides guided forms and validation to help you configure your evaluation settings.
To create an AgentCore online evaluation
-
Open the Amazon Bedrock AgentCore console.
-
In the left navigation pane, choose Evaluation.
-
Choose Create evaluation configuration.
-
(Optional) For Evaluation name, enter a name for the online evaluation configuration.
-
(Optional) To enable the evaluation configuration after it's created, select the checkbox under the evaluation name.
-
(Optional) For Evaluation configuration description, enter a description for the AgentCore evaluation configuration.
-
(Optional) For Session idle timeout, enter a duration between 1 and 60 minutes. The default is 15 minutes.
-
-
For Data source, choose one of the following:
-
Define with an agent endpoint – Choose an agent that you previously created on AgentCore Runtime, or create a new agent by choosing Agents. Then, choose an endpoint from the agent.
-
Select a CloudWatch log group – Select up to 5 log groups. Enter the service name used by your agent for observability. For agents hosted on AgentCore Runtime, service name follows the format <agent-runtime-name>.<agent-runtime-endpoint-name>. For agents running outside AgentCore Runtime, service name is configured in OTEL_RESOURCE_ATTRIBUTES environment variable.
-
-
For Evaluators, select up to 10 evaluators per evaluation configuration, including built-in and custom evaluators.
-
(Optional) For Filters, add up to 5 filters to identify which sessions to evaluate.
-
(Optional) For Sampling, choose a percentage between 0.01% and 100% to control the percentage of sessions that are evaluated. The default is 10%.
-
For Amazon Bedrock IAM role, choose one of the following:
-
Use an existing role – Select an IAM service role that already has the required permissions.
-
Create a new role – Create a new IAM service role.
-
-
Choose Create evaluation configuration to create the AgentCore online evaluation configuration.