Manage an A/B test
Update an A/B test to start it, pause it, or stop it. You use the UpdateABTest operation to change execution status.
Note
The AgentCore CLI lifecycle commands (view, pause, resume, stop, promote, archive) identify a test by its job ID passed with -i, --id, not by name. Get the ID from agentcore run ab-test --json (the id field) or by listing tests with agentcore view ab-test. The job ID uses the format name-suffix. For example: customerSupportTargetTest-Ab1Cd2Ef3G. Job records are stored locally as JSON under .cli/jobs/ab-tests/ in your project.
Code samples
View, pause, resume, and stop
Example
Promote the treatment variant
When the results are statistically significant, promote the treatment variant. promote stops the test and writes the treatment variant into agentcore.json; run agentcore deploy afterward to roll it out.
Example
Delete an A/B test
Delete an A/B test and its associated metadata. The test must be in STOPPED execution status before it can be deleted. Deleting a test does not affect the configuration bundles, AgentCore Gateway, or online evaluation configuration that the test referenced.
Example
Execution status transitions
| From | To | Description |
|---|---|---|
|
|
|
Start the test. The AgentCore Gateway begins splitting traffic. |
|
|
|
Pause the test. Traffic stops splitting; all traffic routes to control. |
|
|
|
Resume a paused test. |
|
|
|
Stop the test permanently. Traffic routing ends immediately. |
|
|
|
Stop a paused test permanently. |