AWS bedrock-agentcore documentation change
Summary
Added CLI and SDK examples for configuring gateway targets and online evaluations in A/B testing workflows
Security assessment
Adds operational examples without security context. Includes signing parameters but these are standard AWS configurations, not security fixes.
Diff
diff --git a/bedrock-agentcore/latest/devguide/ab-testing-3p-agents.md b/bedrock-agentcore/latest/devguide/ab-testing-3p-agents.md index 9732b915e..07f9192cf 100644 --- a//bedrock-agentcore/latest/devguide/ab-testing-3p-agents.md +++ b//bedrock-agentcore/latest/devguide/ab-testing-3p-agents.md @@ -115,0 +116,20 @@ To register a Lambda function URL as a target, set `protocolType` to `CUSTOM` an +###### Example + +AgentCore CLI + + + + agentcore add gateway-target \ + --name customer-support-control \ + --gateway cs-3p-abtest-gw \ + --type passthrough \ + --passthrough-endpoint https://<control-id>.lambda-url.us-west-2.on.aws/ \ + --passthrough-protocol CUSTOM \ + --stickiness-identifier '$context.header.x-session-id' \ + --stickiness-timeout 28800 \ + --signing-service lambda \ + --signing-region us-west-2 + +AWS CLI + + @@ -166,0 +187,43 @@ When you send traffic through the gateway, direct it to the control variant’s +###### Example + +AgentCore CLI + + +Add one online evaluation config per variant — using the `service.name` and event log group from Step 1: Instrument your agent for AgentCore observability as the data source — then start the test in `target-based` mode: + + + agentcore add online-eval \ + --name cs-control-eval \ + --evaluator Builtin.Correctness \ + --service-name customer-support-control \ + --log-group-name /aws/bedrock-agentcore/agents/cs-agent-control/runtime-logs \ + --enable-on-create + + agentcore add online-eval \ + --name cs-treatment-eval \ + --evaluator Builtin.Correctness \ + --service-name customer-support-treatment \ + --log-group-name /aws/bedrock-agentcore/agents/cs-agent-treatment/runtime-logs \ + --enable-on-create + + agentcore deploy + + agentcore run ab-test \ + --name cs-3p-abtest \ + --gateway cs-3p-abtest-gw \ + --mode target-based \ + --control-target customer-support-control \ + --treatment-target customer-support-treatment \ + --control-online-eval cs-control-eval \ + --treatment-online-eval cs-treatment-eval \ + --control-weight 50 \ + --treatment-weight 50 \ + --wait + +Use `agentcore status` to view per-variant results while the test runs and `agentcore stop` to end it. + +AWS SDK (boto3) + + +Create one online evaluation config per variant with `create_online_evaluation_config`. Set `serviceNames` to the endpoint’s `service.name` and `logGroupNames` to its event log group. Then create the test with `create_ab_test`, using `perVariantOnlineEvaluationConfig`. For the full boto3 example — including sending traffic, polling results, and stopping the test — see [Run an A/B test with target-based routing](./ab-testing-target-based.html), starting from the **Create the A/B test** step. +