The AI Agents Helping Us Review, Test, and Improve Edera
Why We Built AI Agents for PR Review and QA
We are a small engineering team at Edera, and we are trying to accomplish quite a lot. We are building a container runtime that runs each container inside its own lightweight VM, which we call a zone, on Xen or KVM. Our engineering work spans the Rust control plane, Linux kernels, hypervisors and the integrations that make all of this work in Kubernetes. Testing a product like this means testing not just the individual components, but also how they interact.
As much as we want to move fast, we don't want to compromise on the quality of what we deliver or slow down the pace of delivery. I strongly believe AI is a tool, and getting the best out of it requires technical expertise and a good understanding of the problem we are trying to solve. There is an opportunity here to review and test what we build in much more depth, while giving our engineers more time to focus on complex engineering problems.
That was my motivation for building these AI agents at Edera. We now have two agents that run as part of our PR review workflow, one looking at the change itself and the other looking for gaps in how we test it. The latter feeds into our nightly QA agent. The QA suite covers 178 adversarial scenarios across Xen and KVM, installing the latest build on a fresh VM for each attempt. We also have two QA agents for our Xen and Linux trees. They exercise IOMMU, DMA and paravirtual driver code in an emulated hardware lab, and we have already merged fixes in both trees based on their findings.
As we expanded QA, we also wanted to reduce the time it takes to investigate a reproducible finding and prepare a fix. That led to the bug factory, which investigates confirmed QA findings and, where our policy allows it, opens a PR with a proposed fix and a regression test. We have also automated some of the other work that takes up engineering time, including proposing backports, auditing our public docs against released code, triaging end-to-end test failures and keeping our PRs tracked in Linear.
The goal is to help our engineers do considerably more while continuing to raise the bar on the quality of our engineering. They provide an additional, consistent layer of review and testing alongside the work our engineers do. None of these agents can approve or merge a change. The bug factory proposes product code changes through PRs that go through the normal CI and human approval process. Our engineers remain responsible for evaluating the findings and deciding what goes into the product.
Here is what we have built so far, how it works and what we have learned along the way.
The Engineering We Built Around the Models
The first version used a general-purpose model to review diffs and run tests. We use standard Claude models through GitHub Actions. A significant amount of the engineering has gone into the systems around the models, including repository-specific knowledge, deterministic decision-making, validation against our PR history, tests for the agents themselves and the permissions we give them. We build these agents on the assumption that the model can be wrong or manipulated. The comparisons below illustrate a minimal model-only workflow versus the engineering we have added, rather than a comparison with specific AI products.
The QA Agents
For nightly QA to actually save our engineers time, we need to be able to reproduce and verify what it reports. A basic model-only workflow might run a few commands, read the output and decide whether the test passed. That makes the model the test oracle, and we cannot count on it making the same decision on every run. We use the model to write and maintain the scenarios and the runner through reviewed PRs. The result of each test is determined by code.
The Review Agents
For PR review, the model needs more context than the diff and the surrounding code. We give it repository-specific information about which tests run at each stage of CI and in which environments. This helps it evaluate whether the behavior introduced or changed by a PR is actually exercised by a test.
We maintain these agents the same way we maintain the product. Every time one misses something or generates a false positive, we look at whether we need to change a review rule, add a test or fix the implementation itself. Those changes go through the same PR review process as our product code.
Rules Every Agent Follows
Giving these agents access to our repositories and engineering workflows introduces risks of its own, especially given the kind of product we build. We assume the model will get things wrong and that any diff, log line or documentation page it reads could contain instructions intended to manipulate it. We enforce the following constraints through permissions, tool restrictions and tests, rather than relying on instructions in the prompt.
Advisory only. The review agents provide comments for engineers to evaluate. They cannot approve or merge changes, and the bug factory can only propose changes through PRs. Our existing CI, release processes and human review requirements continue to apply.
Restrict write access. In our shared review workflow, backport agent, bug factory and weekly triage agent, the model runs with a read-only token. A separate job that does not run a model publishes its output. Where write access is needed, we restrict it to specific operations.
Restrict the tools available to the model. The docs audit has no file-write tool, and the backport agent can read and search files but has no shell. We restrict the commands available to agents that need a shell, rather than trusting the model to decide which commands are safe.
Restrict what the agents can do in Linear. All access goes through a wrapper that executes pre-written, reviewed GraphQL operations and rejects anything else. The model cannot arbitrarily modify or delete tickets, and we handle ticket text as data rather than shell input.
Decisions are made in code. The decisions that determine whether the QA agents file a ticket are implemented in deterministic code with unit tests. This includes failure classification, reproduction, fingerprinting, deduplication and the nightly ticket cap. The agents write and maintain the scenarios and the runner through reviewed PRs, but we do not make a model call between a failure and filing a ticket. The bug factory also has a policy enforced independently of the model that determines whether a proposed fix is eligible and limits its scope.
We can disable the agents without a code change. Each agent has a report-only or dry-run mode that we can enable through a repository variable or a dispatch input.
The Nightly QA Agent
We wanted to do considerably more testing of the actual product we build and ship, including scenarios that would be impractical to run on every PR. Our nightly QA agent takes the latest build from a green main branch, installs it on freshly booted machines and exercises the product under adverse conditions. The suite includes 178 scenarios across 26 failure classes on both Xen and KVM, including daemon restarts with zones running, upgrades, concurrent lifecycle races, real-world images and less frequently exercised configurations.

We don't file a product ticket for a failure during setup. A product failure results in a ticket when all three confirmation attempts on fresh machines match, or when the same fingerprint appears on 3 of the last 14 completed nights.
How The Nightly QA Run Works
There are four stages, each implemented as a subcommand in a single Rust binary. The planning stage selects the scenarios scheduled for that night (some run nightly and some weekly) and verifies that the build artifacts exist. It also checks the capabilities available on each test machine. If a scenario requires Kubernetes or a host we can reinstall and that capability is unavailable, it is marked as blocked rather than skipped or passed.
For every attempt, the execution stage boots a new NixOS VM from the same Nix flake we use for end-to-end tests, either as a KVM host or a Xen dom0. The runner executes the scenario over SSH and collects evidence in a shared directory. Nothing is carried over from a previous attempt. We run attempts in parallel.
If an attempt fails, we run three confirmation attempts on fresh machines. The comparison stage applies the reproduction rule, updates a ledger of failures that didn't reproduce and compares the Xen and KVM results for scenarios where we expect the two backends to behave the same way. The final stage deduplicates against open tickets, applies the nightly cap and files the tickets.
What the Nightly QA Suite Tests
Each scenario is a manifest with setup, exercise and assertion steps, most of which call small probe scripts. The probes use the same product CLI commands an operator would use. Here are some of the classes we cover.
- Install and upgrade, including following the published install docs word for word and reinstalling over an existing install.
- Restart survival, including killing or restarting the daemon while zones are running and checking what survives.
- Lifecycle races, creating and destroying zones rapidly and concurrently and reusing names.
- Resource limits, including requesting resources the host cannot provide and checking that the request is rejected with a clear error.
- Isolation, covering VMM confinement, shipped security defaults and workload identity credentials that expire.
- Images, using a pinned corpus of real images that exercise properties missing from our minimal test images. This includes a 22-layer 2 GiB image, a USER set in the image config, layers that white out directories, a vendor registry and OCI import.
- Coverage gaps, including features that are off by default and assertions that could pass even when the behavior under test is incorrect.
An image pull can fail for reasons that have nothing to do with Edera. The probe repeats the pull using an independent OCI client. If the independent client succeeds and Edera fails, we classify it as a product failure. If both fail, we classify it as infrastructure. The control has to download every layer. Successfully fetching a 3 KB manifest doesn't tell us whether the hundreds of megabytes across 22 blob requests can actually be pulled.
One check verifies that the published zone kernel actually contains our patches. A successful kernel build alone does not tell us that. The scenario reads /proc/kallsyms inside a running zone and checks for symbols introduced by our patches, with separate expectations for each architecture.
How Nightly QA Avoids False Positives
Finding more failures is useful to us only if engineers can spend their time on actual product issues rather than trying to figure out whether a test machine was broken. A lot of our work on this agent has gone into keeping the false positives down and making the findings reproducible.
- We classify failures based on which phase failed, rather than parsing error messages.
Setup and ambiguous failures are tracked separately as infrastructure or inconclusive outcomes. Failures during exercise or assertion are candidates for product findings and are subject to the reproduction rules. - We file a product ticket only if all three confirmation attempts fail with the same fingerprint.
- For intermittent issues, we file a ticket if the same fingerprint appears on 3 of the last 14 nights on which the scenario completed. This gives weekly and nightly scenarios the same opportunity to reproduce a failure and ensures that a week of broken test machines doesn't count as a week without the issue.
- The fingerprint is a SHA-256 over a normalized observation with timestamps, IDs and counts stripped out.
Probes keep values that change every night, such as pod names, out of the fingerprinted output. A repeat adds a comment to the existing ticket. - We redact credentials from logs and system dumps before uploading evidence. This includes handling structured formats such as the systemd journal without corrupting the diagnostic data.
- The runner verifies the build and publication status of the artifacts under test before filing findings.
- Every ticket has the product commands an engineer can run to reproduce the issue.
A small wrapper around the CLI records every product command the probe executes.
The ticket renderer rejects internal scenario IDs and speculation about the root cause.
What Nightly QA Has Found and Fixed
The nightly agent has already identified issues in resource validation and zone lifecycle behavior that we have fixed. The scenarios that caught them now run on both Xen and KVM to verify that the fixes continue to hold.
We also test and maintain the QA agent itself. If a scenario is wrong, we investigate and fix it just as we would an issue in the product. We need to be able to trust the tests as much as the code they exercise.
We also looked at how the agent could complement our customer modeled testing on managed Kubernetes, OpenStack and bare metal. The two approaches exercise different aspects of the product, and that comparison helped us expand the environments and scenarios in nightly QA.
We can also use what we learn during a PR review to decide what we should test that night. If the test gap review identifies a gap and leaves a marker on a PR, the QA agent picks it up and runs the scenarios that cover the gap, even if they were not scheduled. If it files a ticket, it links back to the review.
QA for Our Xen and Linux Trees
Testing the product as a whole was only part of what we needed to do. We ship our own Xen tree and Linux kernels for the host and the zones. Both trees are public. Given the amount of work we do in the hypervisor and kernels, we wanted to test those changes directly in addition to testing the product as a whole. We now have two QA agents that boot these trees in an emulated hardware lab every night. They use the same rules for filing findings as the product QA agent, including three matching confirmation attempts, the 3-of-14-nights ledger for intermittent failures, fingerprint deduplication and a nightly cap.
We handle findings through our internal engineering and security review processes before sharing details publicly.
Xen QA
The Xen agent builds our tree with the exact configuration we ship and boots it under QEMU. Test kernels from the Xen Test Framework (XTF) and our own cases run against it, with the shipped release build and a debug build side by side.
Much of the hypervisor code we want to test requires hardware that isn't available on our CI runners, so we emulate it in the lab. A q35 machine with intel-iommu,intremap=on gives Xen a working VT-d with interrupt remapping. A reserved memory region declared on the Xen command line acts as an RMRR. QEMU's edu device performs DMA through the emulated IOMMU, and a PCIe-to-PCI bridge exercises requester-ID aliasing. We can now exercise IOMMU setup, device assignment and DMA remapping every night on a regular CI runner without needing a server with VT-d hardware.
We use nested KVM where hardware virtualization is needed. Some XTF tests also require specific Xen boot options, such as hvm_fep for the forced-emulation-prefix test. We account for those requirements when deciding which cases are applicable to an environment, and exclude boot options from fingerprints so changes to the lab do not create duplicate findings.
Findings from the lab have already led to fixes in our Xen tree, with regression coverage in the relevant scenarios.
Linux QA
Our kernel tree carries patches on top of upstream covering balloon and memory-hotplug behavior, NUMA-aware allocation, a paravirtual IOMMU driver, 9p session transfer, MSI under PV and more. We wanted automated runtime tests that exercise those changes directly.
The lab runs our shipped Xen with our host kernel as dom0, on an Ubuntu userspace built with mmdebstrap, and our zone kernel as a domU with a busybox initrd and a small command agent that talks over xenstore. Cases are shell scripts plus C programs that run inside the guest. They cover event channels, grant tables, a hostile block and network frontend that feeds malformed ring state to dom0's backends, VFIO with the edu device, a filesystem model checker, memory pressure, and a hypercall fuzzer.
Each kernel is also built in a debug variant with KFENCE, UBSAN, kmemleak, lockdep, SLUB debugging and fault injection. We run KASAN builds in a PVH lab with nested hardware virtualization because of the limitations of the Xen PV boot path in that configuration.
The lab has already helped us identify and validate fixes involving memory management and Xen paravirtual driver behavior. For example, we can exercise ballooning under memory pressure and verify the behavior before and after a change directly in the lab. We have merged fixes based on these findings into our kernel tree.
Pull Request Agents
While the QA agents give us broader coverage of the product, we would obviously rather catch an issue before the change merges. Two agents give engineers an additional, consistent layer of review on PRs. They each publish their findings in a separate section of the same review.
PR Review
The review agent reads the diff and as much of the surrounding code as it needs to. We focus on findings with a concrete impact on correctness, security, isolation or compatibility, including tests that would pass even if the code were broken. Style and naming are outside its scope because we already have linters for that.
For every finding, we require the agent to trace the condition in the code or configuration to the resulting product behavior and explain its actual impact. Saying that a setting is ignored is not sufficient to call it a finding. If the agent cannot establish the impact, it reports the observation separately without assigning a severity. An engineer evaluates the findings.
We test the review rules themselves against graded examples of acceptable and unacceptable findings. We also enforce length limits in CI. Engineers should be able to read the review quickly and understand what needs attention.
A couple of examples of findings addressed before the respective PRs merged.
- The software bill of materials for a proposed image did not include its base images.
We corrected that before merging the change. - The agent flagged a proposed CI workflow restructuring that GitHub would have rejected.
We corrected the workflow before merging.
As with any review, the findings need to be evaluated in context. Our engineers bring their knowledge of the codebase and the intended behavior to that discussion, and retain responsibility for the review and approval of changes.
Test Gap Review
Reviewing the implementation itself wasn't enough. We also wanted to answer a question about every PR that isn't answered by a line coverage percentage. What behavior in this change could break without a single test failing? The test gap agent identifies that behavior, proposes a scenario and specifies which layer it should be tested at. We maintain a map in the repository of what our PR CI actually runs, including which end-to-end suites run on each hypervisor and which paths are exercised only in the merge queue. This allows the agent to identify gaps even when the test itself already exists.
Before enabling the agent, we ran it against previously merged PRs where we already knew the outcomes. We wanted to see whether it would identify known test gaps without being told what to look for, and whether it would stay quiet on changes that had nothing to flag. We used those results to refine the review rules.
One example of what we mean by a hollow test is an IPC namespace sharing check that compares namespace inode numbers after the containers have exited. Since the kernel can reuse those numbers, equal values alone do not prove the containers shared a namespace. We have a rule requiring the agent to consider what else could make two compared values equal.
This is where the review and QA work come together. When the agent finds a gap, it leaves a small machine-readable marker in the review. The nightly QA agent collects those markers and runs the matching scenarios that night.
Publishing Reviews Across Repositories
Both agents can finish within seconds of one another on a new push. GitHub concurrency groups retain only one pending job and cancel the older one, so using them to serialize the publishers could silently drop a review. Instead, each publisher finds or creates a review with a marker, inserts its own section and reads the review back. If both created a review, we keep the older one.
We initially built both agents for our main repository and now use a single reusable workflow in our Xen and infrastructure repositories as well. Each consuming repository supplies a short caller workflow, a file defining its review focus and a map of which tests run where. This allows us to extend the same review process to our other repositories without maintaining a separate implementation for each one.
The Bug Factory: From QA Finding to Proposed Fix
As we expanded our QA coverage, we also wanted to reduce the time it takes an engineer to investigate a finding. There is a fair amount of work between getting a reproducible failure and understanding its root cause, writing a fix and testing it. The goal was to automate as much of that work as we could while retaining the normal engineering review and approval process.
The bug factory investigates confirmed QA findings and, where our policy allows it, proposes a fix. It runs once a day after the nightly QA tickets have been filed and picks up a small number of unassigned findings. For each eligible fix, it also writes a regression test, runs an automated review and opens a PR for engineering review.

We run each case across separate sessions, each with its own permissions.
- Investigate. A read-only session classifies the finding as a product bug, a bug in the QA agent's own scenarios or an infrastructure problem. It establishes the cause from code and logs and says what a fix would touch.
- Decide. The policy is enforced in code. Only eligible product and QA agent issues can be patched. Findings labeled as security concerns get a diagnosis only, and the policy limits the size and scope of proposed fixes.
- Repair. A second session writes the smallest fix and a regression test. It can edit files in its workspace and has no shell, so it runs nothing.
- Verify. A separate job compiles and lints the candidate using commands selected by the controller. The job has no secrets and does not execute any tests.
- Review. A third session reviews the candidate using the same rules as our PR review and test gap agents. If it finds issues, it sends them back to the repair session, with up to three revisions allowed.
- Publish. If the candidate passes review, we create a branch and open a PR. Regardless of whether we have a fix, we publish one comment on the Linear issue with the diagnosis.
Separating Code Generation From Execution
The factory reads ticket text, logs and diagnostic evidence, so we treat that input as untrusted. The model sessions have restricted access to the workspace. Generated changes are not executed as tests inside the factory workflow. The first execution of its generated tests takes place in the PR CI environment.
Compiling a candidate can execute build scripts, which is why our policy protects build scripts, cargo manifests, lockfiles and build-time crates from modification. We also protect the factory policy, the review rules, CI workflows and QA exceptions. Proposed changes that modify protected files are rejected.
We have tests for each of these protections and use deliberate mutations to verify that the tests catch violations.
Why It Opens Pull Requests Itself
A PR is already how we review and test every change, so we use the same workflow for a proposed fix from the factory. It goes through CI, automated review and human approval before it can merge. The factory cannot approve or merge its own PR, and we can run it in diagnosis-only mode or disable it without a code change.
Testing The Factory
Before enabling the factory in CI, we ran it manually against existing QA findings. We tested both paths through the workflow, including cases where the factory should stop at a diagnosis and cases where it can propose a fix and regression test. The point is to give the engineer a useful starting point, even when the factory cannot safely propose a change.
Automating Some Of The Other Engineering Work
Backport Candidates
It is not just reviewing and testing changes that takes up engineering time. We maintain supported release lines alongside main and have a weekly agent that goes through merged changes and proposes backports. An engineer still decides whether to take each one.
The job has three stages. A script gathers every PR merged to main since the last run, including its diff and the history of the files it changed. The model evaluates each change using read and search tools only and returns its decisions in a defined JSON schema. The final stage, which does not run a model, opens a cherry-pick PR for each proposed backport and assigns it to the author of the original change. If an engineer decides against the backport, they close the PR.
The model has no shell. The gather script also accounts for both rebase and squash merges so each proposed backport includes the entire change.
Docs Audit
Once a week, the docs audit agent extracts claims about product behavior from our public documentation and checks them against the code at the latest release tag, rather than the development branch. It has no tools to modify the docs.
If the agent finds a discrepancy between the documentation and the released code, it files a ticket. If it cannot verify a claim from the code, it reports that rather than saying the documentation is incorrect.
Weekly Test Triage
We also have a weekly triage agent for our EKS and Nix end-to-end suites. It separates one-off failures from persistent ones and checks whether a fix has already been merged, so engineers can focus on failures that still need attention.
Code sorts every failing test, per branch and hypervisor, into failed once, new, recovered, or active, meaning two or more failures and fewer than two passes. The model, with read and search tools only, checks whether a pull request already fixes each active failure. Code then verifies every fix it claims. A fix counts only if its pull request targets the failing branch and no failing build already contains its merge commit.
We file the remaining failures in Linear, assign each to the engineer who wrote most of the test and close the ticket when the test has passed twice.
Linear Tracking
If a PR has no Linear issue key, the tracking job creates an issue, assigns it to the author and closes it when the PR merges.
The version we are rolling out to Xen, Linux and infrastructure doesn't use a model. We don't need a model to create a Linear issue from a PR title and description, so there is no reason to use one here. For our public repositories, this also removes the model prompt that a PR could inject instructions into.
What We Learned Building AI Agents for QA
Replay against historical data before enabling an agent. We run the review agents against past PRs where we already know the outcomes. It is just as important to verify that the agent stays quiet on clean changes as it is to verify that it catches issues. Otherwise, engineers will eventually stop reading its reviews.
Update the examples when changing review rules. We found that models can follow an example even when it contradicts the written rule. We now update the rule and its example in the same commit and test the example against the rule.
Make sure the agent can access its configuration. We resolve settings in an earlier step and pass the values into the prompt explicitly rather than assuming the model has access to its environment variables.
A successful workflow does not necessarily mean the agent ran. An action can exit successfully without producing a review, so each agent checks the action's outputs to distinguish a declined, failed or completed run, and explicitly reports when a run stops early.
Test the tool allowlists. An agent's instructions and the tools it is actually allowed to use need to agree. We test those together rather than granting additional permissions just to get a run to complete.
Separate infrastructure failures and ambiguous results from confirmed product findings. Test environments can fail for reasons unrelated to the product. We keep those outcomes visible and apply the reproduction rules before reporting a product issue.
Treat fingerprints like an interface. If we change the normalization rules or the output of a probe, we can end up refiling every open finding affected by that change. We review any probe output that goes into a fingerprint with the same rigor as a schema change and count the affected open tickets before merging.
Make the findings useful to the engineer investigating them. A list of internal probe scripts executed on a VM that no longer exists is not a useful reproduction. We record the actual product commands the probes execute and use those in the tickets, along with the evidence needed to investigate the issue.
What Comes Next
There is still quite a bit we want to do with this. We have expanded nightly QA to include customer modeled scenarios on Xen and KVM Kubernetes nodes with containerd and CRI-O, as well as dual-stack, ipvlan and NFS clusters. We maintain a mapping between the customer modeled checks and the corresponding QA scenarios, and test that mapping as the suite evolves.
We want to continue expanding coverage across different hardware and deployment environments, develop the workflow from identifying an issue in QA through investigation and proposing a fix, and keep improving the quality of our reviews.
What makes this effort particularly exciting is what it enables us to do as a small engineering team. We can review changes in more depth, exercise more of the product and get reproducible findings to engineers. We have a lot we want to build, and we want to keep delivering more while improving the quality of our engineering.

-3.avif)