Set AWS Ops Agent Review Depth for GitHub Pull Requests and Verify Testing

Set AWS Ops Agent review depth for develop and main, compare two GitHub pull requests, and use the execution journal and Tests tab to verify what actually ran.

AWS Ops Agent review depth for illustrative order-service PRs, with two target-branch policy folders and the deeper path on main.AWS Ops Agent review depth for illustrative order-service PRs, with two target-branch policy folders and the deeper path on main.
Illustrative order-service case. Each target supplies its own policy. Main requests verification testing, and the Tests tab shows executed tests when results exist. Based on the AWS Ops Agent User Guide.

Two GitHub pull requests carry the same agent-authored change. You want a static review on develop and verification testing on main. Both commits can show a passing AWS status even if only one was tested. To verify AWS Ops Agent review depth, start with the policy on each target branch, then match each review report to the commit it evaluated. The Tests tab is where you look for evidence of executed tests and their outcomes.

This tutorial is for a platform engineer who can edit review settings in an AWS Ops Agent Space and land configuration changes in a private GitHub test repository. You will install the complete policy, open two pull requests with equivalent changes, and run a third case with automatic testing disabled. The repository, branch names, pull request numbers and commit prefixes below are illustrative. The observations describe what to look for in your environment.

AWS announced general availability of Code Change Risk Analysis on December 2, 2026, including branch-specific review depth. Some GitHub integration labels still use the previous DevOps Agent name. The AWS Cloud Operations Blog describes the name change, and the User Guide gives the current commit status name used later in this exercise. AWS launch announcement · AWS Cloud Operations Blog

AWS What's New announcement for general availability of AWS Ops Agent Code Change Risk Analysis.
Amazon Web Services announced general availability of Code Change Risk Analysis on its What's New page. · Original source

Prepare the private order-service repository

  1. Use a private, disposable GitHub repository named order-service in the exercise and connect it to your Agent Space through an existing GitHub App registration. Use an approved installation with the access needed to surface review output in GitHub. The AWS connection guide documents the read-and-write registration, including the ability to post inline comments. A repository connected through personal access token registration lacks the webhook events needed for this automated exercise. Confirm the connection in the Agent Space you plan to use to read results. AWS GitHub connection guide
  2. Start from a buildable, trusted test application with a local test for order confirmation text and equivalent application files on develop and main. Use a repository whose build and tests can run without production credentials, an internal package mirror or a live order system. For this case the application formats an order confirmation using a synthetic order identifier, ORD-1001. Keep the existing build entry points so the comparison changes the review depth while leaving the project structure familiar to the verification environment.
  3. In the Agent Space, go to Capabilities, find the GitHub connection in Pipeline, and choose Edit. In Code Review and Automated Testing, record the current values for order-service. For the illustrative starting state, Auto trigger change review is off, Automatic verification testing is off, there are no trigger filter groups, and neither branch has a review policy file. Record your actual starting values for cleanup, including the previous file contents on each branch if a file already exists. AWS GitHub connection guide
  4. Check that the AWS status is advisory in the test repository. Leave it outside the required checks on both targets and keep any existing human review and CI requirements in force. If the disposable repository inherits a requirement for the AWS status, choose an approved test repository where it is advisory. For a separate exercise on observing ruleset behavior before enforcing a merge gate, see Test Claude Approvals Before It Gates GitHub Merges.

AWS describes Code Change Risk Analysis as a review of standards, dependencies, access controls and production-environment risks. Verification testing adds a managed build and execution phase. The focused question in order-service is whether the agent entered that phase and recorded any tests for the commit under review. A synthetic repository still lets you answer that question even when there is little production context for the broader risk analysis. If this repository was just connected, AWS says initial indexing takes approximately one to two hours. Treat indexing as setup context and use the actual reports to establish what happened. AWS Code Change Risk Analysis overview

Before asking a coding agent to prepare either change, give it the exact before and after strings and the scope of the edits. This exercise uses the same application behavior and expected text on both branches. A written acceptance case also gives you something specific to compare with the tests AWS chooses to run. Spec-Driven Development

Put the review policy on both targets

  1. Save the following file as .aws-code-review.yaml in the root of order-service. Use your normal configuration change process to land it on develop and main. Open each target branch in GitHub after the configuration lands and inspect its root. Confirm the filename and values on each branch independently.

    version: 1
    reviews:
      default:
        review_depth: static-analysis
      overrides:
        - when:
            target_branch: main
          review_depth: verification-testing
    
  2. In Code Review and Automated Testing, enable Auto trigger change review and Automatic verification testing for order-service, then choose Save. For the illustrative repository, leave trigger filter groups empty so applicable pull request events can match both branches. If you already have filters, inspect the branch and event clauses before opening the PRs. Use an event that matches for both targets, or arrange equivalent scope in the disposable repository. AWS combines the clauses within a group with AND and combines multiple groups with OR. AWS GitHub connection guide

  3. Reopen the connection and check the saved row for order-service. Both toggles should be on. The verification capability is available for the repository, while the YAML chooses which target requests that depth. The exercise uses the default managed verification environment because its application has no internal build dependencies. AWS review documentation

The default applies when no override matches. develop therefore uses static-analysis, which reviews the change without building or running it. A PR targeting main matches the literal target_branch rule and requests verification-testing. AWS evaluates overrides in order and uses the first rule whose conditions all match. A single exact branch name makes it easy to check the intent by inspection and avoids confusing YAML branch patterns with the regular expressions used by the integration’s event filters. AWS review documentation

For a pull request, AWS reads the policy from the target branch. If you put the new YAML in a feature branch and open a pull request to introduce it, that pull request is reviewed under the configuration already on the target. Land the configuration first. This matters especially when main already has the file and develop was cut before it landed. Inspect the visible copy on develop to determine the policy for PRs into that branch. If you are changing a repository with an existing set of ordered overrides, treat this complete example as a policy for the disposable repository. Preserve the existing branch rules as a separate record and inspect their ordering before proposing changes there. AWS review documentation

AWS Ops Agent review depth decision for develop and main, including the repository switch fallback on main.AWS Ops Agent review depth decision for develop and main, including the repository switch fallback on main.
Illustrative branch policy. With a valid file and an eligible automated review, the main override requests testing. The repository setting determines whether that depth can run. Source is the AWS Ops Agent User Guide.

Open the paired pull requests and compare reports

  1. From the updated develop, create exercise/confirm-develop. From the updated main, create exercise/confirm-main. Have your coding agent apply the following change independently on each branch. Inspect both diffs before opening the PRs. If your sample application uses a test that checks exact confirmation text, the expectation should change alongside the formatter. Check that both diffs are limited to the formatter and its test.

    Task: order-service confirmation wording
    
    Input: ORD-1001
    Old formatter result: Order ORD-1001 received
    New formatter result: Order ORD-1001 confirmed
    
    Change the formatter's fixed word from received to confirmed.
    Update the existing order confirmation test for ORD-1001 to expect
    Order ORD-1001 confirmed.
    Keep the order identifier and all other behavior as-is.
    
  2. Open exercise/confirm-develop into develop and exercise/confirm-main into main as separate pull requests. Use the same readiness state for both. In GitHub, record each PR’s URL, base branch and current head commit SHA. The numbers and shortened SHAs in the table stand for the actual values you record. Check the files changed in each PR again. Unexpected diffs can mean you started one source branch from the wrong base.

  3. In the Ops Agent web app, open Changes. Find the report for each pull request and record its link. Compare the repository and change identity against GitHub and confirm the reviewed commit wherever the report context or its linked change identifies it. Use the execution journal to establish which review depth ran. The guide documents the journal as a trace of evaluation and tool use. It gives neither a guaranteed field label for the head SHA nor a fixed journal message for every run, so leave the commit match unconfirmed if you cannot establish it from the available evidence. AWS review documentation

  4. For the matched main change, open the Tests tab when present. If GitHub offers a View test report link in a review comment, it leads to that tab. The tab lists executed tests and their pass or fail outcomes when results exist. Record the test name or description and its outcome as shown. If AWS ran a different test from the existing ORD-1001 assertion, record only the coverage you can verify. A failed test still demonstrates execution and gives the reviewer a concrete result to investigate. AWS review documentation

Input Action Expected result
task:order-depth-develop-01, order-service PR #41, illustrative head 9f31c20, exercise/confirm-develop into develop, ORD-1001 wording change Open the PR with both capabilities enabled and the policy already on develop. Match the report to PR #41 and its reviewed commit, then inspect the execution journal. Illustrative expectation for develop is the static-analysis default. Expect a static review without a managed build or test execution for this change.
task:order-depth-main-01, order-service PR #42, illustrative head ab4d802, exercise/confirm-main into main, equivalent ORD-1001 wording change Open the PR with both capabilities enabled and the policy already on main. Match its report and journal to PR #42 and its reviewed commit. Inspect the Tests tab for executed cases and outcomes. In this illustrative case the main override selects verification-testing. If the run produces test results, the Tests tab lists what executed and the outcome of each listed test.
task:order-depth-main-off-01, order-service PR #43, illustrative head d72b900, exercise/confirm-main-off into main, equivalent ORD-1001 wording change Save the repository with Automatic verification testing off and Auto trigger change review on. Open a fresh PR from the same main baseline and inspect its matched report. In this illustrative case the policy still requests verification-testing. The effective review is static, and the report explains why verification testing was unavailable.

AWS gives typical review times of about five minutes for static code analysis and about eleven minutes for reviews including verification testing. These figures can help decide when to check back, especially if both requests were opened minutes apart. AWS also says review time depends on the size and complexity of the change. Use the journal and test results to classify a run even when the main report happens to finish first. AWS review documentation

Two horizontal bars from zero comparing AWS typical review times, about five minutes for static analysis and eleven minutes with verification testing.Two horizontal bars from zero comparing AWS typical review times, about five minutes for static analysis and eleven minutes with verification testing.
AWS documents typical review times of about five minutes for static analysis and eleven minutes with verification testing. These are vendor estimates. AWS Ops Agent User Guide, accessed December 2, 2026.

Both PRs intentionally have the same change summary, and a subsequent push can create a newer review for the same PR. AWS says that when you push new commits, the automated review focuses on changes since the previous review and carries forward applicable findings. A rebase onto a new base causes it to review the whole change again. Pair the report with the commit you are discussing before you carry a test outcome into a review comment. The PR number tells you which discussion to return to, and the commit match tells you which version of the proposed change the evidence covers. AWS review documentation

A passing aws-devops-agent/code-change-risk-analysis commit status is compatible with static analysis, verification testing and several incomplete review outcomes. AWS says the status fails only for a BLOCK recommendation. A review that fails, times out or is canceled can also post a passing status with a comment asking for manual review. Read the recommendation for release risk, the journal for review activity and the Tests tab for concrete execution outcomes. For how to handle an advisory review in the merge decision, see AI PR Review Agent Policy. AWS review documentation

Diagnose a missing run or missing tests

  1. No report for the PR. Start at the GitHub connection. Check the repository is private, the App installation covers it, and the repository is connected to the Agent Space whose Changes view you opened. Check whether Auto trigger change review was on when the PR event occurred. Inspect any trigger groups for the actual base branch and event. A group limited to main explains a missing develop report even if the YAML is valid on both. Once corrected, open a fresh matching PR to establish a new trigger. A clean PR with no inline findings can still have a review, so check the Changes view before diagnosing a missing run. AWS documents inline findings and says there is no overall summary comment. AWS GitHub connection guide · AWS review documentation
  2. A report exists and the depth looks wrong. Inspect the journal before editing the branch. An invalid YAML file or unsupported value can cause AWS to choose the depth and record the problem in the journal. An unknown condition can cause AWS to skip that rule and check the remaining ones. Compare the actual target branch file against the complete example, including the exact key target_branch and the value verification-testing. If the file is missing from the root of the target, AWS can choose the depth in the absence of explicit configuration. Land the corrected policy on the target and collect a fresh PR review to verify the repair. AWS review documentation
  3. Reproduce the documented static fallback. Let PRs #41 and #42 finish first. In the connection settings, uncheck only Automatic verification testing for order-service and save. Leave both branch policies in place. From the unchanged main baseline, create exercise/confirm-main-off with the same wording change and open the illustrative PR #43. In the matched report look for the explanation that verification testing was unavailable and confirm static analysis. This distinguishes a repository capability decision from a bad YAML file. The main rule remains valid in this case. To confirm recovery, restore the testing toggle, save, and open a fresh matching main PR with the same change if you need a new observation after reenabling it. AWS GitHub connection guide · AWS review documentation
  4. Verification was selected, but there are no results. First establish that the report belongs to the intended PR and commit and that the run has finished. AWS describes a sequence in which it clones the code, determines build tools and dependencies, and, after a successful build, generates a testing plan and runs it. Read the journal for the last stage with evidence and any reported error. If the build stops at dependency setup, the repair belongs there. If the application depends on an internal artifact store, AWS documents associating a Release Management environment that can reach it through a VPC. For the disposable example, keep the existing build self-contained and fix only the build input identified by the report. If the run ends without executed test results and the journal gives no cause, record testing as unconfirmed and retain the report link for follow-up. AWS review documentation

An on-demand chat review can help isolate whether AWS can read or test the change. Keep it separate from the automatic PR example. AWS documents that a depth specified in chat or through MCP overrides the repository configuration. For chat reviews of a branch or commit, a target-branch override matches only if you name a base. A successful explicit verification request therefore establishes that the requested path can run. You still need a matching GitHub event and report to show the branch policy worked on its own. AWS review documentation

When sharing what happened, use the report and the journal to make the claim as narrow as the evidence. For example, if execution stopped during dependency setup, record that verification was selected and that there are no test results for the matching commit. If a test ran and failed, record the actual name and outcome and keep the failure available for investigation. That gives a teammate a trace to follow if the same failure happens again. You Can’t Replay What You Can’t See

Restore both branch policies and repository settings

  1. Save the report links and the commit identities you confirmed before closing the exercise PRs without merging their application changes. For the two baseline cases, retain the static path and the main test outcomes if present. For the disabled capability case, retain the report’s fallback explanation. That gives another engineer enough information to distinguish all three cases later, even if the head branches are removed.
  2. If auto-trigger was originally off, restore that toggle before opening any cleanup pull requests to avoid triggering exercise reviews on them. In Capabilities, reopen the GitHub connection for editing and update the order-service row. Choose Save. AWS GitHub connection guide
  3. Restore each target branch’s previous policy through its normal change process. In the illustrative starting state, remove the exercise YAML on both develop and main. If either target previously contained a file, restore that branch’s exact previous content. Compare the root of each actual target with your starting record after the restore lands. A policy restoration visible only on an open pull request has yet to take effect. Keep any repository branch protections in force during cleanup. AWS review documentation
  4. Restore the remaining original order-service settings in the GitHub connection and choose Save. In the example, both toggles end up off and the trigger filters were empty throughout. Where you temporarily changed filters, restore the original branch and event conditions as well. Reopen the connection to check the saved values against your starting record. AWS GitHub connection guide

You can now describe each outcome at the level the evidence supports. For develop, the configured default calls for static analysis. For main, the valid override requests verification and the matched Tests tab results show what was exercised, if results were produced. The third case explains how the same policy produces a static run when the capability is off. If a teammate is separately checking how another workflow reports results on a PR, the same attention to the underlying report applies to GitHub coverage uploads.

Sources

  1. AWS What’s New — Code Change Risk Analysis general availability
  2. AWS Ops Agent User Guide — Reviewing code changes
  3. AWS Ops Agent User Guide — Connecting GitHub
  4. AWS Ops Agent User Guide — Code Change Risk Analysis
  5. AWS Cloud Operations Blog — AWS Ops Agent: The Next Evolution of AWS DevOps Agent

Many assistants.
One place to remember.

Bring your AI sessions, context, and usage together with Automater.

Meet Automater