
Gate agent-written pull requests with AI code reviewers
One AI code reviewer named the bug and still approved it. See what Kiro, AWS DevOps Agent and AWS Continuum each stopped, and how to set up the gate on AWS.
Series: A study on AI in the product lifecycle (9 articles)
- …
- 7Gate agent-written pull requests with AI code reviewers This article
Global Sr. Solutions Architect, Private Equity
A coding agent added a 60-second timeout to an Amazon Bedrock client. The tests passed, and an AI code reviewer that checked the change against its spec approved it. A second AI code reviewer read the change without running it, named the one setting that makes the timeout work, and still approved it. I would have shipped it, and the timeout did nothing until the same service ran the code and blocked it. Faros AI data in the AWS DevOps blog post on gated review pipelines shows high AI adoption bringing 98% more pull requests and 91% more review time.
My view is that no single agent reviewer is enough, so let agents recommend, let a policy release or block, and keep the difficult decisions with a person. In this article, I summarize how I tested five reviewers on 33 agent-written changes, walk through six findings and what to do about each, and show how to build the release decision on AWS.
What I tested
I ran 33 agent-written changes to one consumer-facing web app, with a TypeScript and Express backend that calls Amazon S3 , Amazon Bedrock and a search index, through five reviewers. They were deterministic checks, a spec review in Kiro , the AWS agentic IDE and CLI, AWS DevOps Agent at two depths, and code review from AWS Continuum . DevOps Agent reviews code changes for production risk and can build and test them in an environment it manages. Continuum is an AWS security service that reviews pull requests for vulnerabilities, builds threat models (lists of the ways a design could be attacked) from design documents and can fix its own findings.
Reviewer | What it does | What it answers |
|---|---|---|
Deterministic checks | Runs tests, lint, type checks and a permissions check | Pass or fail |
Kiro spec review | Reads the change against its spec | GO, HOLD or NO-GO |
DevOps Agent, static depth | Reads the change | BLOCK, Deploy with caution or a standard deployment |
DevOps Agent, verification depth | Builds, runs and tests the change | BLOCK, Deploy with caution or a standard deployment |
Continuum code review | Reviews the pull request for security vulnerabilities | Findings rated CRITICAL, HIGH, MEDIUM or LOW |
The first round was 23 changes from short specs or the task title alone. The second was small features with a security edge, such as a URL import and a share link, each built as a correct copy and a copy with one planted defect. I left one more feature, download by name, out of the scores for a reason in the third finding. Of the 33 changes, 18 were bad. Eight missed something their spec asked for, four carried a risk the tests don't exercise, such as a missing timeout or a wildcard permission, and six had a security defect. I planted 10 of those defects, and the agent made the other 8. A change counted as good when it met its spec and passed hidden tests the coding agent never saw. I relabeled two changes as bad, the timeout and the URL guard, only after a reviewer's finding showed in a local test that they broke their spec. I set the tasks and approved the specs and hidden tests, which I drafted with an AI assistant.
Each AWS service ran in its documented setup. Every agent reviewer got the same spec and pull request description. Kiro and DevOps Agent also got four written rules on permissions, timeouts, retry loops and renamed fields, and DevOps Agent ran at both depths with automatic verification testing turned on. Continuum ran code review with its base set of security requirements.
A reviewer stopped a change when it answered HOLD or NO-GO, when DevOps Agent recommended anything but a standard deployment, or when Continuum rated a finding HIGH or CRITICAL. I scored every reviewer on every kind of defect, including kinds it isn't built to judge, because a release gate sees all of them, and for a defect outside a reviewer's job, not stopping it is the expected result. It's one app and small counts. Kiro ran twice, DevOps Agent twice in the first round and once in the second, and Continuum once, and no route in the app authenticates its caller. Treat the numbers as a direction to test on your own changes. Tuning I didn't do includes a spec-conformance rule for DevOps Agent, security requirements beyond Continuum's base set, a recorded baseline of accepted findings, and fix requests aimed at one finding rather than all of them.
A reviewer can name the bug and still approve it
When DevOps Agent reviewed the timeout change at static depth, which reads the change without running it, its comment told me to add
throwOnRequestTimeout . The comment wasn't marked Blocking, and GitHub showed the review's status as "change approved". In the AWS SDK for JavaScript v3, an expired timeout only logs a warning unless you set throwOnRequestTimeout . At verification depth, DevOps Agent ran the change against a server that never answers, found the call still hanging after 75 seconds, and blocked it.The same pattern showed up on a spec miss. A spec required a whole number within a fixed range, the change let 2.5 through, and all four first-round DevOps Agent reviews quoted the broken criterion and still approved the change. My four rules covered permissions, timeouts, retry loops and renamed fields, and none told DevOps Agent to treat a broken acceptance criterion as blocking. Adding that rule to its agent instructions is the first tuning step I'd try, though I haven't tested it.
A gate reads the verdict, so a finding left in a comment stops nothing. Run DevOps Agent at verification depth, because only the review that ran the code turned the timeout finding into a block. Read its full report rather than its status check, which passes on Deploy with caution. Verification depth didn't stop the numeric range either, so pair it with a spec review.
Each reviewer stops a different kind of defect
The Kiro spec review answered NO-GO on that numeric range both times. Figure 1 shows the same split across all 18 bad changes.

Figure 1: Bad changes each reviewer didn't stop, by kind of defect, where fewer is better.
Kiro and DevOps Agent together, counting a change as stopped when either one stopped it, stopped all 18 and 4 of the 15 good changes. Adding Continuum stopped no extra bad change and two more good ones. That rests on a small sample, and DevOps Agent's verdict changed between runs on three spec misses, which is why Figure 1 shows a range for it.
Read each column against the reviewer's job. At verification depth DevOps Agent stopped every operational risk and security defect. Spec conformance isn't its main job, though it had the spec. Continuum, which didn't get my four rules, stopped every security defect.
Pair a reviewer that reads the change against its spec with one that runs the code, and measure each reviewer by kind of defect, because one overall stop rate hides the kind it misses. Keep Continuum in the set. It was the only reviewer to name the missing check on download by name, and its threat model works on the spec before any code exists.
A spec review checks what the spec spells out
The spec for the URL import said to block private and cloud metadata addresses. The agent's guard checked the host name as typed, and the Kiro spec review approved it in both runs. DevOps Agent and Continuum both pointed out that a host name that resolves to 169.254.169.254, or the same address in IPv6 form (
::ffff:169.254.169.254 ), gets past the check, and a local test confirmed four ways around it.For download by name, I left the security requirement out of the spec on purpose. Both copies the agent built had no check on the name, so I had no correct version to score. The Kiro spec review approved both, and only Continuum named the gap.
Expect a spec review to check what the spec spells out and to miss how a requirement can be bypassed. Give the protocol-level checks to the runtime and security reviewers, and write the security requirement into the spec, as the last finding shows.
A stop on a good change can still be a real finding
Continuum stopped 6 of the 15 good changes and DevOps Agent stopped 4. I checked every finding behind those stops against the code, and none was false. Five of Continuum's six were gaps the app already had. No route authenticates its caller, so 35 of Continuum's 40 second-round findings said an endpoint has no authentication. A context hint, a note in the repository saying authentication is handled outside the service, still left 38 of 43.
DevOps Agent's stops were functional bugs the specs didn't cover, such as common words emptying advanced search results, and a fallback to an anonymous user copied from existing code. In the first round, none of the DevOps Agent findings I checked were wrong about how the AWS SDK or a service behaves.
A block on every HIGH finding would have stopped every good change in the second round. Decide once whether to fix or accept the findings the codebase already has, and until then send HIGH findings to a person.
A reviewer's fix is another agent-written change
Continuum can also fix its own findings, pushing a commit to the change's branch about 2 minutes after a pull request comment asks. I asked it to fix all findings on each pull request, which on this app included the missing authentication, and scored 8 of those fixes with the same hidden tests and reviewers.

Figure 2: What the fixes corrected, broke and changed beyond the finding. The last two rows are download by name and a good change.
The fixes corrected 3 of the 6 security defects, such as restoring the share link's 15-minute lifetime. The URL guard fix edited the controller and left every bypass open. The owner-check fix left that defect in place and instead fixed a different finding, hardcoded service endpoints, in 8 files outside the spec. Four fixes broke the change's own tests. One added an authentication middleware, a reasonable answer to the missing-authentication findings but outside the spec, and the Kiro spec review stopped it in both runs. Continuum's re-review still raised a HIGH on 7 of the 8. On 4 it was the authentication the app has never had, on 3 it was the defect the fix left in place, and none came from the fix itself.
Send a security agent's fix back through the same reviewers and release decision as any other agent-written change, and ask for one finding at a time when you want a fix you can review.
A threat model on the spec names most defects before any code exists
I gave Continuum threat modeling only the six second-round specs, in a separate workspace with no code and no earlier findings. Each threat model took 11 to 18 minutes, and 5 of the 6 named the class of defect the code later carried. That included both specs with no stated security requirement, with threats such as "Unvalidated filename composed into object-store key enables prefix escape". The one miss was an error response leaking internal details. The recommendations were specific enough to write into a spec, such as capping the share link's expiry inside the function that creates it and asserting the cap in tests.
Continuum design review, which checks a document against the security requirements you enable, named the class on 3 of the 6. Two others already stated the control, which it confirmed, and it accepted the URL import's planned guard. It runs only in the Continuum web app, with no API.
Run a threat model on each spec and add its recommendations as acceptance criteria. That gives the coding agent the requirement it would otherwise skip, and gives the spec review a criterion to hold the change to. Treat design review as an optional manual pass.
How do you build the release decision on AWS?
Steps 2 to 5 follow controls 2 to 5 of the AWS gated review post, which keeps a person on every change. My version sends a person only the changes the agents can't settle.

Figure 3: Threat model the spec, let three agents recommend, let policy release or block, and let a person decide the rest.
- Run a Continuum threat model on each spec, and add its recommendations to the acceptance criteria before the coding agent starts.
- Run deterministic checks in Kiro hooks , which run commands on agent events, and in an AWS CodeBuild build that reports to each pull request. Make every check report a failure when its tool doesn't run.
- Add three read-only reviewers that emit findings and never approve. One is a Kiro agent given the spec, the rules and the diff, answering GO, HOLD or NO-GO. One is DevOps Agent at verification depth, with automatic verification testing turned on for the repository,
review_depth: verification-testingin.aws-code-review.yamlon the branch you merge into, and your rules in its agent instructions. One is Continuum code review, with any security requirements of your own added to its base set. Any agent's fix, Continuum's included, goes back through these steps as a new change.
- Put policy in code as a required check that waits for all three reviews, in a CodeBuild step or an AWS Lambda function using Cedar or Open Policy Agent , two open source policy languages. Block on a failed check, a NO-GO or a DevOps Agent BLOCK. Hold on a HOLD, any HIGH or CRITICAL finding, or a review that hasn't finished in time, and release the rest. Never let a HOLD release on its own, because a HOLD means the reviewer can't tell from the spec whether the behavior was intended, and only a person can. A gate on GitHub sees DevOps Agent's status as approved or blocked, and Deploy with caution shows as approved.
- Send every held change, and every change to steering files (the instruction files Kiro reads), policy or permission files, to a person who approves on the pull request before merge. That person also checks the DevOps Agent report for released changes marked Deploy with caution or with a comment marked Blocking. An AWS CodePipeline manual approval records who released it to production. Settle the inherited findings first, meaning the ones the codebase already had before the change, as the fourth finding describes.
The timeout I would have shipped stops on DevOps Agent's BLOCK. I replayed this policy on the recorded verdicts for my 33 changes, with the first run of each reviewer and DevOps Agent's status read as a gate would read it. It releases 9, blocks 21 and sends 3 to a person, and the second runs give the same counts. All 18 bad changes are blocked, along with 3 good ones, two for lint errors and one for the anonymous fallback. The 3 that reach me are good changes with inherited HIGH findings. Once those findings are accepted, the policy would release 12, and the report check would send one of them to a person, the share link DevOps Agent marked Deploy with caution. The first round recorded only approved or blocked, so its caution results are unknown. I didn't run the policy as a live gate or measure the approvals.
As a first step, check whether any pipeline gates on the DevOps Agent status alone. Then measure each reviewer on 20 recent agent-written changes by the bad ones it lets through and the good ones it stops. A reviewer can only hold a change to criteria someone wrote down, which is why the spec comes before the build in this series, in Write a spec your coding agent can build in one pass .
Who makes the release decision on agent-written changes on your team today, the engineer who ran the agent, a separate reviewer, an automated policy, or do you not ship them yet?
Further reading
- Building a gated review pipeline for AI coding agents on AWS (AWS DevOps blog)
- Reviewing code changes (AWS DevOps Agent User Guide)
- Write a spec your coding agent can build in one pass (AWS Builder Center)
- Secure AI-generated code across the SDLC on AWS (AWS Builder Center)
Series: A study on AI in the product lifecycle (9 articles)
- …
- 7Gate agent-written pull requests with AI code reviewers This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article