Security Software Factory: Hermes in the critical CVE patch loop
How an autonomous agent prepares our patch PRs every day, and how we teach it to do them better.
Did you also spend the end of October patching? Security alerts kept coming, with fixes to roll out in every ecosystem.
A quick recap for anyone who missed an episode:
- PHP2Shell: two critical flaws in the PHP core. Without authentication, someone can run code remotely.
- Node2Shell / HTTP2Shell: a single vulnerability, in Brotli (a compression library), which you find in Node.js, Bun, Python, .NET and many others.
- eMudhra: eight keys from an Indian certificate authority were compromised. With these keys, someone could issue fake certificates and pose as a service.
- Ruby / GitLab: several flaws in Onigmo (the Ruby regex engine). Here too, remote code execution is possible.
And it didn't stop there: in mid-November, it was Java's turn, with Java4Shell.
We had to keep up. And who found it fun?
In our company, we share the same feeling, and let's be honest: we didn't have much fun. The Brotli CVE alone hit nearly ten of our images at once.
For some flaws, the fix already existed. But one CVE could hit several images, and so call for several updates. For a week, we patched by hand: for each affected service, read the security report, find the version that fixes it and make the changes. The next day, new CVEs came in, and we started again.
So we asked ourselves: what if we automated this patch process, to help us keep up? We already had an autonomous agent at hand: Hermes.
So we could give it this work and leave the final decision to a platform engineer on the team. That is the idea of a software factory: a tooled chain that takes each change all the way to production, with checks at every step. In its agentic version, agents take their share of the work in this chain and go through the same checks as we do.
The diagram above shows our patch loop in this form, from the Trivy scan (an open source vulnerability scanner) to production, with Hermes in the middle.
Below, I cover:
- why we chose an agent over a script or Renovate;
- how it works, from scan to prod;
- how Hermes learns from its mistakes;
- a few metrics, and what comes next.
Why an agent
We are a Platform Team in the Team Topologies sense. We offer the other teams services like Retool, Metabase, Dify or Prefect, which we deploy and host in Kubernetes. We also give them shared resources, standardized and secured, so they can deploy and run their own applications. It's up to us to keep these services up to date, and above all to patch them as fast as we can when a flaw comes out. We deploy them with Helm (the Kubernetes package manager): private charts, our own, or remote charts published by the vendor.
But why give this work to Hermes, a non-deterministic process, rather than to a script? To answer, you need to understand the kind of upgrades we do.
An upgrade takes more than a version bump. You have to track the chart version and the image version, and sometimes add a block, remove a resource or run a database migration. All of this is in the changelog and calls for a decision, which a script can't make. That's why we chose Hermes.
What about Renovate?
We could have relied on Renovate (the tool that bumps our dependencies). With the osvVulnerabilityAlerts option, it suggests vulnerability fixes based on OSV (an open vulnerability database). The catch is that OSV lists npm, PyPI, NuGet or Go packages, and no Docker images. So Renovate sees nothing of what's inside an image, neither its Debian packages nor its Python packages.

Renovate is still useful to spot new versions, with a 7-day delay we chose, the best practice for a cooldown. But it only proposes version changes, of the image or of the chart, without doing the real upgrade. We come back to this at the end, with the next cron.
From scan to prod, step by step
The starting point
We start from a scan we already had. Every day at 9 AM, Trivy scans the images running in production, ours as well as the vendors' ones, and publishes its report in a GitHub issue. When we extended it to all production pods, the report went up to more than a hundred CRITICAL vulnerabilities and a few thousand HIGH (the two highest severity levels in Trivy).

Choosing what to patch
At 10 AM, the cron wakes Hermes up. It reads the report, keeps the CVEs that have a fix and picks the target version. If the vendor hasn't published anything yet, it waits.
Picking the target took some tuning. On Metabase, Hermes went for the latest version, even though it was a new major version. We gave it a rule: "Aim for the smallest jump that fixes it, within the same major version, then the latest published patch of that line." That way we do fast recovery: we aim for the patch that fixes it before deploying a new version.
Preparing the patch

If Renovate has already opened a PR, Hermes finishes it: it updates the chart, the values and the image up to the version that fixes it. Otherwise, it opens its own draft PR, without waiting for the 7 days of Renovate. It follows a private skill, derived from the one the team already uses for Helm upgrades.
The checks before review
Hermes works like a colleague, but with more limited access to the cluster. Once the PR is ready, it can run the lint. The diff stays out of its reach: comparing what runs in the cluster with what the PR proposes means reading the secrets. These secrets hold critical data, like database passwords, and we didn't want an agent to have access to them.

So we moved the diff into the pipelines. Hermes waits for their result, then goes through its checklist: the lint passed, the diff is computed, the target image is scanned, the versions that change are reviewed, and depending on the service, a few extra scripts run. The result ends up in the PR description.
Last check: a sub-agent reviews each PR and gives a verdict, "ok" or "needs work" with the reason.
The PR format
At first, we used an existing PR skill, with three sections: Summary, Evidence and Merge Danger. As it was, it didn't help us that much. We kept the three sections, but changed what goes in them:
- Summary: in three parts
- Version: from X to Y, for the chart and for the image;
- Changelog: one line per version, then the breaking changes;
- Security: the version that fixes it, and the number of CRITICAL and HIGH;
- Evidence: the checklist of what Hermes actually did, with a confidence score;
- Merge Danger: a blocker or an issue to take into account before merging.
The same PR, before and after, with made-up data:

We wanted to be able to check each point of the checklist and get a sense of the confidence score. A box that wasn't done stays empty, with its reason.
Who decides?
All Hermes PRs are in Ask mode, in the Ship / Show / Ask sense: we open the PR and wait for a review before merging. We want to keep a human in the loop, so someone from the Platform team always merges it, as is or after a fix.

How the agent learns
A new vulnerability comes out, Hermes proposes a patch. In the best case, the PR is perfect and we merge it right away. In practice, that was rarely the case. And when we complete the PR ourselves before merging it, Hermes sees nothing of what we added. It will make the same mistake the next day. So we had to bring it back into the loop.
For this, we plugged a webhook into Hermes. You just mention Hermes in a comment on one of its PRs, open or merged. The webhook wakes it up: it reads the PR and our comment again, then writes the lesson into its harness, meaning its skills, its scripts and the prompt of its cron. This harness is versioned in Git: each lesson becomes a commit, which we can review or revert, and Hermes replies on the PR with the commit link.
We also set up a "Hermes feedback" issue template. If Hermes is stuck or can't do the update, it opens an issue, to keep a record of our feedback. The issue only gets closed once its harness is up to date.
In 11 days, the cron got 11 new rules, each one after a mistake, like aiming for the smallest jump within the same major or treating a database migration as one-way.
A few metrics
Between October 27 and November 13, we cut the number of CRITICAL on third-party production images in half. The October 27 peak follows the extension of the scan to all production pods. The drop comes first from the patches we did by hand, then from the Hermes cron, in place since November 4.

On the PR side, the cron opened or completed 11 of them, and the team merged 7.
Every morning, Hermes posts a recap on Slack: one line per image whose update fixes at least one vulnerability, then the PRs and their status. Here is an example, with made-up data.

Next steps
The next cron will pick up the Renovate PRs that the CVE cron doesn't handle, to do the real upgrade there too.
Then there's evaluation. We want to make sure Hermes really learns from our feedback and doesn't make the same mistake again. Each piece of feedback says what it should have done, which gives us a base to evaluate its skills and the tools it uses.
What we take away
- Part of our job is to automate what can be automated, and patch management fits well. Above all, we lighten our cognitive load: the repetitive work no longer goes through us, and we keep our attention for the review.
- We won't get perfect PRs on the first try. We always have to give the agent feedback: that's how it learns.
- The software factory checks (diff, scan, review, human merge) apply to Hermes as they do to us.
Sources
Alerts and fixes
- Microsoft MSRC, PHP2Shell, Brotli and eMudhra, for the incidents mentioned in the introduction and their fixes.
- The Ruby team, Onigmo fixes related to GitLab CVEs, for the regex engine vulnerabilities and fixed versions.
- CISA, Java4Shell: immediate patching guidance, for the November alert and remediation recommendations.
Tools and documentation
- Hermes Agent, official documentation, for an introduction to the agent used in this patch loop.
- Trivy, container image scanning, for the scanner that produces the vulnerability report.
- Renovate, osvVulnerabilityAlerts option, and the OSV database it queries.
- Renovate, Minimum Release Age, for configuring the cooldown. The 7-day delay is our team's choice.
- Helm, the Kubernetes package manager.
Approaches and further reading
- Atlas AI SDLC (in French), for its depiction of an agentic software factory, from signal to production, with the same checks for humans and agents.
- Team Topologies, for the team types.
- Rouan Wilson, Ship / Show / Ask.
- William Woodruff, We should all be using dependency cooldowns, for the cooldown principle and the supply chain risk it aims to reduce.
- Mehdi Houacine, Réflexions - Agentic Software Factories (in French), for the signal, triage, build, validation loop.