Building vquery: how AI helped us secure ESXi
In six weeks, one engineer working with an AI coding agent built vquery: agentless security for VMware ESXi and vCenter, now watching every real vCenter in our lab. This post covers what it does, how the AI helped build it, and what it found. The blind spot ESXi hosts are where the VMs run, yet the

In six weeks, one engineer working with an AI coding agent built vquery: agentless security for VMware ESXi and vCenter, now watching every real vCenter in our lab. This post covers what it does, how the AI helped build it, and what it found.
ESXi hosts are where the VMs run, yet they rarely get the scrutiny a laptop or a cloud account gets. You can't install an agent on them, so they stay out of view.
Our own lab showed the problem. Under three real vCenters we had 37 ESXi 6.7 hosts, a release that is out of support. Scripts logged in as root so often that the first pull from each vCenter hit our 200,000-event cap, almost all of it root and DCUI logins and logouts. Nobody had been looking, because nothing was set up to look.
vquery reads everything it needs from the vCenter APIs, with a read-only account, so there is nothing to install on ESXi. It pulls inventory, settings, permissions and events, streams them through Kafka, and stores them in ClickHouse for fast SQL.
It answers the questions a security team and the people who run vSphere ask every week:
Nothing is hard-coded. Every page has a Setup tab where a team switches rules off, changes weights and thresholds, or adds its own, then previews the effect on every vCenter before saving.
Every stage is its own small service, 13 in all. Each can be stopped, replayed or scaled without touching the others.
Data only flows one way, from vCenter to the UI. Each processing app reads its own Kafka topics and writes its results back to Kafka, where ClickHouse picks them up.
A customer points vquery at their vCenters, and the findings appear after the first pull.
A security tool that loses data or goes down quietly is worse than none, so most of the engineering went into what happens when things fail.
Every page answers one question at a glance, then lets you drill down to the asset, its history and the evidence. A selector at the top narrows any page to one vCenter. These screenshots are from our lab: 8 vCenters, 1,214 ESXi hosts and about 25,000 VMs, real and simulated. IP addresses and account names are blurred.
Counts of vCenters, hosts and VMs, one sentence on what matters now, and the top insights. Known-exploited vulnerabilities come first, then hygiene such as outdated VMware Tools or disconnected hosts.
Open findings, critical ones, those on CISA's exploited list, exposed VMs and those with a fix available, plus the trend of new versus closed. The exploited-CVE table shows each flaw's impact, how many hosts it touches and which build fixes it.
A pass rate for each standard, the trend of checks that started failing or passing, and a click-through to every rule and every asset that fails it.
Hosts ranked by how easy they are to break into. A host with an exploited CVE, SSH on and lockdown mode off goes to the top, with the patch that closes it.
Findings, exposure, identity and configuration combine into one score per asset, grouped into domains such as runtime and identity. Each top asset lists exactly which factors put it there.
Alerts per day by severity, the MITRE ATT&CK techniques behind them, and each alert with its evidence. The Baselines tab learns what is normal for each vCenter at each hour and flags what isn't.
Ten intrusion playbooks, each matched step by step against detections by the same person or on the same host. A chain shows the stages it walked, its blast radius and the response steps.
Accounts, roles and permissions turned into plain findings: administrator rights given to a person rather than a group, rights never used, service accounts used in a browser, and logins that never succeed.
Every package installed on every host, flagged when it is a look-alike, unsigned, added recently, or present on only some hosts of a cluster.
199 ready-made questions in 16 tabs, from "which datastores are below 20% free?" to "which host certificates expire within 90 days?". Each answers across every vCenter at once, can be edited, and can raise a Jira ticket with the evidence.
At 06:00 UTC vquery runs every question against each vCenter and writes a report in four priorities: Fix now, Fix soon, Plan and Housekeeping. A calendar marks the days with Fix now findings, and each report shows what is new and what was fixed since yesterday.
For any host: will its VMs move, is there room for them elsewhere, and what would an upgrade to ESXi 8.0 need, including unsupported hardware and old packages.
Each host's settings compared with its cluster's golden value, such as the ESXi build or lockdown mode, so one forgotten host stands out.
Powered-off, orphaned, unused and oversized VMs, old snapshots and unused templates, with the storage, vCPUs and memory each would free. It exports to CSV.
Backup tools found by their accounts and logins, and each VM's newest backup snapshot, so unprotected VMs show up per vCenter.
Critical detections, attack chains, exposure, vulnerabilities and compliance, and changes and logins for the week, built every Monday and raised as a Jira ticket.
Every vCenter event, searchable by type, user and severity, with a link to what changed. Investigate runs your own read-only SQL over every table, with ready-made starting points.
Add a vCenter with a read-only account, test the connection, and see each one's pull status and the schedule for the next 24 hours.
The split was simple: the human set the goal and made the calls, and the AI did the building. From 10 October to 18 November that came to 296 commits across Mirage and vquery. vquery alone is 16 Go programs (about 35,000 lines), 163 test functions and 54 UI components.
Testing security code on production vCenters is slow and risky, and you can't make a real one misbehave on demand. So before vquery, the AI built Mirage, a simulator that serves five vCenters (6.7, 7.0, 8.0 twice and 9.1), each on its own IP and speaking the real SOAP and REST APIs.
To keep it honest, the AI copied the real event catalogs from our lab's ESXi 6.7 hosts and vCenter 8.0.3, about 2,200 event types, using read-only access. It also generated the API shapes from VMware's own SDK bindings. Mirage knows which settings and CVEs each simulated vCenter has, so every vquery result can be checked against that answer key.
The real lab vCenters came next: 8.0.3 with 3 hosts, 8.0.2 with 33 hosts and about 495 VMs, and a third 8.0.3. Their passwords are encrypted on the vquery server, and the key never leaves it. Where real vCenters behaved differently from Mirage, the AI wrote the gap down and fixed both sides.
The design docs are part of each change rather than an afterthought. The Kafka doc lists every topic, writer and reader, and the AI updates it in the same commit that changes them.
Pointed at our three real vCenters, vquery found that 37 of 38 ESXi hosts run an out-of-support release, and every one of them has lockdown mode off. These figures were read from the vquery server on 1 December 2026; they cover 38 hosts and 552 VMs.
The alerts were real activity, not noise from the tool. The top ones were host firewall changes, permission and role changes, commands run inside VMs, SSH sessions opened on hosts, and the ESXi Shell being turned on.
The IT Help report on the 8.0.2 vCenter (33 hosts) took about 15 seconds. It sorted the work into 9 Fix now, 16 Fix soon, 17 Plan and 18 Housekeeping items. That matched the review we had written by hand earlier.
A security tool has to be secure itself. In November, an AI code review of a different project flagged vquery's query runner. We checked it, and the finding was real.
The query runner (port 8071) ran any SQL it was sent, with no login. A single curl from anywhere on the lab network could query all 71,066 VMs vquery tracks.
We asked the AI to confirm it, then look for anything else like it. It ran four scanners over the code (gitleaks, govulncheck, gosec and osv-scanner) and also read the code for services listening with no login. The worst find was Kafka. Anyone on the network could list all 51 topics, read every record, and write fake ones that vquery would have believed.
The fix shipped in one commit and was live the same day:
After the deploy, the original curl got HTTP 401, and a Kafka listing with no login showed 0 topics. All app containers stayed up with no restarts, and ClickHouse kept up with Kafka (0 lag).
One gap remains: Kafka traffic is still not encrypted. Passwords are safe, but the records could be read by someone listening on the lab network. Turning on TLS needs certificates, and it's the next step.
The AI made us fast. Speed alone wasn't what made it safe; the guardrails around the AI did that.