Skip to main content

Experiments SDK for Amazon CloudWatch Omni

Test an agent against a dataset, score it with Amazon Bedrock AgentCore evaluators, and record the run in CloudWatch Omni Experiments. The service decides pass or fail, and the experiments CLI exits with that verdict, so a CI job can gate on it.

Datasets and evaluators are AgentCore's. The agent runs on AgentCore Runtime or behind any HTTPS endpoint.

git clone https://github.com/aws-observability/cloudwatch-omni-experiments-sdk-python.git
cloudwatch-omni-experiments-sdk-python/install   # puts `experiments` in ~/.local/bin

export AWS_PROFILE=<profile>

experiments check --agent-endpoint <runtime ARN> --dataset agentcore:<datasetId>@<version>

experiments run \
  --dataset agentcore:<datasetId>@<version> \
  --agent-endpoint arn:aws:bedrock-agentcore:us-east-1:<account>:runtime/<runtimeId> \
  --service-name <service.name> --environment prod \
  --execution-role-arn arn:aws:iam::<account>:role/experiments-role \
  --rule examples/rules/pr.json

New here? Start with GETTING-STARTED.md.

Two ways to run

experiments run experiments start
Who calls the agent The SDK, from your machine or CI host The service (AgentCore batch evaluation)
Agent AgentCore Runtime or any HTTPS endpoint AgentCore Runtime only
What is scored The dataset's cases Every session in the agent's trace log groups
Guide Client-side runs Hosted runs

To try an agent on your machine without the Experiments service, use experiments run --local: it scores with your own code evaluators (no AWS at all) or AgentCore evaluators (on the spans in the workspace's .omni folder), computes the verdict itself, and keeps the run in .omni for the Amazon CloudWatch Omni extension for VS Code. See Local mode.

What it calls, and what you pay for

The SDK has no service of its own. It calls AWS APIs in your account, with your credentials, and the Experiments service makes some calls with the experiment's execution role. Each call is billed to your account at that service's price, where the service charges for it:

Service What is called When
CloudWatch Omni Experiments Creates experiments and runs, reports results, reads verdicts check, run, start, wait, get, list, stop, delete, delete-run, update; not with --local, and not the agentcore-* commands
Amazon Bedrock AgentCore Runtime Invokes your agent (InvokeAgentRuntime), once per turn of each case run with a runtime ARN; start, where AgentCore's batch evaluation invokes it with the execution role
Amazon Bedrock AgentCore Evaluations Scores each case with the evaluators you name (Evaluate); a hosted run starts a batch evaluation, which scores every session in the trace log groups run (with --local, only for AgentCore evaluators), start. check sends one empty Evaluate per evaluator to test the permission, which AgentCore refuses as invalid
Amazon Bedrock AgentCore (resources) Reads runtimes, datasets and evaluators (GetAgentRuntime, GetDataset, ListDatasetExamples, GetEvaluator, and the list calls) The agentcore-* commands and check; run reads its AgentCore dataset and its evaluators
Amazon CloudWatch Logs Reads your agent's spans (Logs Insights on aws/spans and the agent's log group); run results are written to a log group in your account run (not --local, which reads spans from .omni), start, check
Amazon CloudWatch telemetry queries With trace stats on, the service queries the agent's spans after each run ends, with the execution role; the queries are billed to your account Runs of an experiment created or updated with --collect-trace-stats

A hosted run (start) scores every session in the trace log groups, not only your dataset, so a busy agent means a large run. experiments check shows how many sessions that is before you start. An HTTPS agent is called directly and costs whatever its own hosting costs.

See the pricing pages for Amazon CloudWatch and Amazon Bedrock AgentCore.

Commands

Each one, with examples: Command reference.

Command What it does
experiments check Checks credentials, the API, the agent, the dataset and the agent's spans. Read-only
experiments run Calls your agent, scores the results, reports them
experiments start Starts a hosted run (--wait to wait for the verdict)
experiments wait Waits for a hosted run to end
experiments get Shows an experiment, or one run
experiments list Lists experiments, or one experiment's runs
experiments stop Stops a run
experiments delete Deletes an experiment and its runs
experiments delete-run Deletes one ended run and its results
experiments update Changes an experiment's name, description or configuration
experiments agentcore-runtimes Lists your AgentCore agent runtimes, or shows one with the flags a run takes. Read-only
experiments agentcore-datasets Lists your AgentCore datasets, or shows one with its versions and examples. Read-only
experiments agentcore-evaluators Lists the AgentCore evaluators you can use, or shows one's configuration. Read-only

Exit codes: 0 passed (or no rule), 1 failed, 2 did not finish, 3 usage or setup error (including a mistyped flag), 130 interrupted. Ctrl-C during run stops the run (exit 2, or 3 if no run was created yet) and during wait or start --wait stops waiting (exit 2; the run carries on); a second Ctrl-C exits 130 at once. Ctrl-C during any other command exits 130.

Documentation

Topic
Getting started Setup to a CI gate in four steps
Client-side runs How run works: scores, case statuses, timeouts, stopping
Hosted runs How start works, and what to know before the first one
Local mode run --local: a local agent, code or AgentCore evaluators, no Experiments service; runs kept in .omni for the CloudWatch Omni VS Code extension
Agents AgentCore Runtime and HTTP agents: spec, auth, streamed replies
Rules What a run must clear to pass
Datasets AgentCore datasets and local files
Permissions IAM for hosted runs, and execution roles
Command reference Every command, with its flags and an example of what it prints
AgentCore resources agentcore-runtimes, agentcore-datasets, agentcore-evaluators: finding the ids a run takes
Managing experiments get, list, stop, delete, delete-run, update, and the API model
Trace stats Statistics from the agent's spans for each run: turning them on and reading them
Examples One worked example per kind of run

Requirements

  • An instrumented agent. AgentCore scores the agent's own spans (ADOT/OpenTelemetry or OpenInference), with session.id set. An uninstrumented agent's cases come back SPANS_MISSING.
  • Python 3.10 or newer on the machine. ./install finds one (on PATH, or a mise, uv, pyenv or Homebrew install) and gives the command its own environment, so there is no pip or venv step. See GETTING-STARTED.md for updating, uninstalling and the Python package, and DEVELOPMENT.md to work on the SDK.

Development

See DEVELOPMENT.md and TESTING.md.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for omni-experiments 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omni-experiments 1.0.0
File Size Uploaded Provenance Actions
omni_experiments-1.0.0.tar.gz 399.9 kB With provenance Details for omni_experiments-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omni-experiments 1.0.0
File Interpreter ABI Platform Actions
omni_experiments-1.0.0-py3-none-any.whl Python 3 none any Details for omni_experiments-1.0.0-py3-none-any.whl

Total release size: 567.0 kB

Release files / omni_experiments-1.0.0.tar.gz

Download URL omni_experiments-1.0.0.tar.gz
Size 399.9 kB
Tags Source
SHA-256 checksum
How to use checksums
09ab5448c01275b755bc1e8b2b3256c284aec66d13f9ee7fdd4de36dab25152a
BLAKE2b-256 checksum
How to use checksums
0ea2e78f707e6525c19509246b4d44ad3c9a3cca488c6604ef3e12e3fcaa8d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / omni_experiments-1.0.0-py3-none-any.whl

Download URL omni_experiments-1.0.0-py3-none-any.whl
Size 167.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a90280a2373dce9344c7ea99f208694b34dfec0e6aef5634c0a2ef9ea58c2be
BLAKE2b-256 checksum
How to use checksums
446e08fe2df65a3390b4191dd86e804640e4ad5e4d95f0e9182d56b0ada5f6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for omni-experiments 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for omni_experiments-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page