I asked the census whether a service was running. By the time it answered, it was.

The census is the part of hauntty that reads a machine: its units, containers, listeners, packages. I was validating a release candidate on a hypervisor carrying 300 guests, and after one census I asked the tool what had changed on that host since the look before. One line came back that should not have existed. A new unit, podman.service, running on a guest where nobody had started it.

The guest’s journal had the rest. Started podman.service at each census, and stopped again five seconds later. My probe had connected to the container runtime’s socket to ask what was running. On that machine the socket belongs to systemd, and to systemd a connection is a request to start the service behind it. The probe had started the thing it was there to observe.

It was caught by the tool’s own diff, which is the only reason I trust the catch. The fix was a design decision more than a patch. The census now detects a runtime by its artifacts and never dials a socket that only systemd is listening on. A runtime that sits behind one is reported as absent, and its containers are read another way. Then I ran the check again on the same hardware: the service inactive before the census, inactive after a narrow one, inactive after a full one, its last start still the boot. The diff showed no unit line. That is in the validation record of the release.

An audit that changes what it audits is worse than no audit, because it is believed. This note is about that problem: how I test the read path of a tool that agents drive, what the best agent I can rent does with a shell when nobody is holding it, and how I decide what to fix. The tool is hauntty, available under Apache-2.0. The short version, with the numbers, is One AI Agent, Two Ways to Audit 400 VMs.

What the Diff Is For

That question, “what changed since the last look?”, deserves a word of its own, because it is drift detection for the part of a fleet that infrastructure as code does not see. Terraform can tell me that the machine it declared still exists. It cannot tell me what is running inside that machine this afternoon. The census can, and it keeps what it saw, so the next look returns only the difference: the container somebody started, the listener that appeared, the restart count that grew. The two belong side by side.

hauntty began in March as something smaller. Agents reached my machines with ssh host "cmd", once per step: a new handshake per command, a throwaway shell that had forgotten the last cd, the whole output poured into the model’s context, and sleep and ps in a loop to learn whether a job had finished. I wrote about that as context drift. The first version held to one rule, metadata before payload: the agent learns how big an answer is before any of it enters its context. Twenty-three tagged versions later the tool answers questions about a whole KVM fleet, and it is how the agents I work with run commands on a remote machine every day. That fleet starts in my lab and ends on another continent, part of it behind software-defined network perimeters and part of it nodes on a Tailscale network. All the tool needs is one SSH path to the host, and the session is still there when the agent comes back, with its directory, its environment and the record of every call.

Where It Reaches, and Who Holds the Reach

Reaching a fleet of guests that hold no keyThe agent holds one credential, an SSH key for the hypervisor account. The hauntty daemon on the hypervisor reads each guest through libvirt and the QEMU guest agent channel. The guests hold no SSH key and no password and every account is locked. A guest that cannot be read is named as not read and is never counted as zero.A FLEET WITH NO KEYS IN ITOne credential, for the hypervisor. Every guest is read through the channel the hypervisor already hasAgent and haunttyone SSH key, for thehypervisor accountHypervisorhauntty daemonUnix socket, no network portlibvirtguest agent channel, virtio-serial400 guests on two hypervisorsqemu-guest-agentthe only way inno SSH key, no password,every account locked8 unreadable, 4 shut off1 SSH tunnel2 guestexecNo credential of any kind exists in a guest, so there is none to steal from one and none to rotate.A guest that cannot be read is named as not read, with the cause. It is never counted as zero.The agent creates no access on the way: no key injection, no password reset, no reboot.
Reaching a fleet of guests that hold no keyThe agent holds one credential, an SSH key for the hypervisor account. The hauntty daemon on the hypervisor reads each guest through libvirt and the QEMU guest agent channel. The guests hold no SSH key and no password and every account is locked. A guest that cannot be read is named as not read and is never counted as zero.A FLEET WITH NO KEYS IN ITOne credential, for the hypervisor. Every guest is read through the channel the hypervisor already hasAgent and haunttyone SSH key, for thehypervisor accountHypervisorhauntty daemonUnix socket, no network portlibvirtguest agent channel, virtio-serial400 guests on two hypervisorsqemu-guest-agentthe only way inno SSH key, no password,every account locked8 unreadable, 4 shut off1 SSH tunnel2 guestexecNo credential of any kind exists in a guest, so there is none to steal from one and none to rotate.A guest that cannot be read is named as not read, with the cause. It is never counted as zero.The agent creates no access on the way: no key injection, no password reset, no reboot.

The agent holds one credential, an SSH key for the hypervisor account. From there the daemon reads each guest through libvirt and the QEMU guest agent, the channel I wrote about when I first ran into it. The guests in this audit had no SSH login keys or passwords. hauntty opens no network port, stores no credential and implements no cryptography of its own. What the account cannot do over SSH, the tool cannot do.

A guest that cannot be read, because it is shut off, its agent is stopped or command execution is blocked, is named once per answer with the reason. It is a third state. It is never counted as clean.

Now the cost of that design, stated as plainly as the security notes of the release state it. Inside the boundary SSH already protects there is one level of trust. Whoever can act as the daemon’s account can drive every session of that daemon, with that account’s rights: its sudo and its libvirt access. That same path can run commands as root in each reachable guest whose agent permits execution.

Who ran this command: today and plannedToday SSH authenticates the operator account, the daemon socket is owner-only with no per-client identity, and the command record carries session, command and exit code. Planned: each agent presents a short-lived SPIFFE identity, the daemon verifies it, a policy decides which identity may run which verb, and the record names the identity.WHO RAN THIS COMMAND?What the record can prove today, and what workload identity adds. The second row is planned, not builtTODAY, v0.11.4Agents A and Bsame operator accountSSHauthenticates the accountDaemon socketowner-only, no client identityCommand recordsession, command, exit codePLANNEDAgent with an SVIDshort-lived, per agentDaemon verifiesthe SPIFFE ID on connectPolicywhich identity, which verbCommand recordnames the identity
Who ran this command: today and plannedToday SSH authenticates the operator account, the daemon socket is owner-only with no per-client identity, and the command record carries session, command and exit code. Planned: each agent presents a short-lived SPIFFE identity, the daemon verifies it, a policy decides which identity may run which verb, and the record names the identity.WHO RAN THIS COMMAND?What the record can prove today, and what workload identity adds. The second row is planned, not builtTODAY, v0.11.4Agents A and Bsame operator accountSSHauthenticates the accountDaemon socketowner-only, no client identityCommand recordsession, command, exit codePLANNEDAgent with an SVIDshort-lived, per agentDaemon verifiesthe SPIFFE ID on connectPolicywhich identity, which verbCommand recordnames the identity

Here is why that matters for the callers that come next. Put two agents under one account: one I trust to audit, one I allow to make changes. Today they are the same identity. The record of every command tells me what ran, with its session and its exit code. It cannot prove which of the two ran it, and nothing stops the auditor from sending a change. In security terms that is accountability and least privilege missing for a non-human operator. The design that closes it is on the roadmap and not in this release: each caller presenting its own short-lived identity in the SPIFFE model, verified by the daemon, checked against a policy that says which identity may run which verb, and written into the record. Until then I use the tool where one level of trust is acceptable: one operator, or a team that already shares the account.

At 400, It Tied

The benchmark behind this release is one audit of a lab-controlled fleet: 400 guests on two hypervisors, some of them carrying container stacks with findings planted for the audit to find, a few shut off or unreadable on purpose. Six read-only questions, one bounded change with proof, a report of what changed, and a list of what could not be checked. The agent on both sides was Claude Opus 5.5 in Claude Code. That is not a weak baseline: the pairing sits tied for second on the public Terminal-Bench 4.1 board, and over plain SSH it got this audit right.

The first time I ran it, against the previous development build, hauntty did not lead. $1.67 a run through the tool against $1.64 over plain SSH. I stopped that series before it finished, so it is context and not a result. What I did next is the part I would defend: I read what the agents had done, command by command, and treated every wasted turn as a defect in my tool and not in the agent.

One example, end to end. In every hauntty run the agent opened the long contract to hunt for a fact the census did not hold. So the tool got a card of about one kilobyte that lists every fact a question can name, and a refusal that names the nearest key or says “not a census fact, use run” instead of leaving the agent to search. On the next day’s runs the long contract was opened in none of three runs, and the card was read in all three. The card is one measured change among a larger set that came out of the same reading: container facts the audit needed, answers sized to the question, eleven one-line rules in the brief.

Then the same audit again, same model, same fleet, three runs per arm, alternating. $1.25 against $2.04. 374 seconds against 623. 21.7 tool calls against 40.3, and 1.11 million tokens processed against 2.53 million. On those measures every hauntty run came in below every SSH run. All three hauntty runs scored 86 of 86. Two of the SSH runs lost an item: one missed a proxy whose backend did not exist, the other named a readable guest as unreadable.

Both approaches reached the fleet about twenty times per run. Plain SSH required more local tool calls.

Figure 1. Mean tool calls over three runs per arm, split by where the work happened.

The detail that explains it is in the calls. Both agents reached the fleet about twenty times a run, by the same route. The SSH agent then spent another twenty calls at its own terminal: a collection script, archives copied back, and its own parsers written and run over them, then run again after the change. The hauntty agent asked for answers. Each extra model turn brought earlier output back into context. Across the audit, the harness cut processed tokens by 56% and model spend by 39%.

Not everything moved, and the part that did not is the part I am least done with. In every run the agent still ran one command per item inside a guest at least once, and still asked again where one question would have done. A rule the agent ignores is not yet a mechanism.

Two cautions belong beside the numbers. The plain SSH side cost $1.64 on the first day and $2.04 on the second, with nothing changed on that side, so part of the gap is the baseline moving. The tool’s own fall, from $1.67 to $1.25, is the cleaner figure. And the release candidate was built from what agents did on this very audit, so this is a result on the task the build was tuned on. An earlier study on 250 guests and three tasks, with an earlier build, showed cost down 58%, tool calls down 42% and tokens processed down 60% against plain SSH on the same model. It is a different build, fleet and task family, and I do not pool it with this one. The measured results carry every run and every limit.

What the Model Did Not Bring

Put the transcripts side by side and the pattern repeats. Each row is something I watched an agent do with a shell, what the harness does in its place, and the rule behind it. None of the rules is new. They are what more than twenty years of running machines teaches, usually once.

What the agent did with a shellWhat the harness doesThe old rule behind it
Wrote a collector, a parser and a diff on every run, then ran them againOne census, many questions; identical facts across machines grouped into one lineCompute where the data is. Do not ship the fleet to the analyst.
Opened a connection to port 22 to see if a guest answered, and started sshdDetects a service by its artifacts, and never dials a socket that only systemd listens onLooking is not free. On a systemd host a connection can be a start command.
Started one process per item to read its stateOne call per kind of thingProcess creation is the expensive part. One process per item turns a sweep into a load test.
Fanned out with a worker count fixed up front, 24 in most runs and as high as 40One guest per host core, halved when the kernel reports CPU or memory pressureThe guests share the host’s cores. Past that count, parallelism is queueing.
Polled for completion with sleep and pswait blocks on the kernel’s own record of the processAsk the kernel, not the terminal.

The fourth row is one I measured before I believed it. Wider is not faster: reading 12, 32 and 64 guests at once on one hypervisor took 16, 21 and 28 seconds for the same sweep, because the work is CPU inside guests that share the host’s cores.

The third row I tested directly, because the model has changed so much this year. I gave the same prompt, one script to read the state of a machine’s units, to the Opus that was current in March and to Opus 5.5. The March model wrote one systemctl call per unit in all three answers, and the script took 2.65 to 3.50 seconds on a machine with 280 units. Opus 5.5 wrote a single call, and its script ran in about a second. It also wrote six to ten times as many tokens to get there, and the call cost about 1.4 times as much. That is a real improvement, shown on one prompt and one machine, and I give it as a demonstration and not a benchmark. But inside the full fleet audit, with twenty other things on its mind, the same Opus 5.5 still wrote the per-unit loop.

None of this is knowledge the model lacks. Ask it what socket activation is, or what Linux pressure stall information measures, and it will explain both correctly. It did not act on either one, and a prompt that said “read-only” did not make it. Knowing a primitive and knowing when it is about to hurt you are different things. The second is what years of operating real machines leave behind, and that is the part I could bring.

Six Machines, One Installer

The rule in that second row is older than this release, and I did not learn it from a transcript. An early field note records hauntty’s own probe doing it to one guest: it invoked a command to see whether a tool was present, and the command installed the tool. Since then the census has carried the rule in code. Detect by artifact, and never invoke a command that can install itself.

Then, in an earlier benchmark, an agent working over plain SSH wanted to know whether LXD was present on the fleet, and ran sudo -n lxc list. On stock Ubuntu lxc is an installer shim. It installed the LXD snap on six machines and started its daemon, and the daemon lowered two AppArmor kernel controls at run time. A read-only question had changed a kernel security setting on a hypervisor. That run scored 27 of 27. A score does not see side effects.

What happened next is the part worth keeping. The agent reported what it had done, in its own summary. I verified the state on every machine. The removal waited for my approval, and nothing was undone before I gave it. Afterwards the check covered all nine machines of that fleet: no units or files left, and the kernel controls back to the distribution’s values. Since then every arm of every benchmark names the hazard in its task.

No guard fixed that by itself, and I would not want one that did. The agent did nothing a careful person might not have done. The control that worked was the oldest one there is: a report, a human decision, a recovery that was checked. The control that would have prevented it is the one in code, because a sentence in a prompt holds only for as long as the reader knows which commands have side effects.

Written With Agents, Held by Tests

hauntty is designed as a closed-loop tool for real use: its users are agents, and it is improved from what those users report. I opened it only now because I wanted the evidence for that claim before I made it. That is a habit from a few ISO 27001 and SOC 2 implementations, where a control you cannot show evidence for does not exist.

An agent that works through the tool hands off a note on what failed or surprised it. Thirty-four of those reports are on file. I reviewed most of them myself. The others I gave to a harnessed agent with a plain instruction: read the hand-off, find the bug, apply the fix. What I held it to was the outcome, a release that shipped and an operation that kept working. What a report turns up becomes a measured item in a ledger, and the fix is AI-assisted, written against that measurement and reviewed by a reader with no view of how it was written. The orchestration is mine, and so is every feature request since the first version: what the tool should do next, what it is allowed to cost, and what does not ship.

None of that loop runs on trust. An AI-assisted fix is a claim, and the tree is built to check claims: about 119,000 lines of Go, half of them tests, with 1,105 test functions and 23 fuzz targets. The tests ran under the race detector on Linux and on macOS, statement coverage measured 83.7% on macOS, and the end-to-end suite, which drives the built binary over real SSH against generated hosts, passed 67 of 67. Before the repository opened those ran on my own machines, and the workflows that run them in public ship in the tree. On top came what no pipeline replaces: two live rounds on real hardware before the tag, which found seven defects and then nine, each fixed with a test. The Podman line at the top of this note was one of them.

The practices are not mine, and I do not claim the scale of the projects I took them from. I claim their habits: the race detector, native fuzzing and golden files from the Go project, an end-to-end suite on the real artifact from Kubernetes, and the sign-off on every commit that Kata Containers and Trustee asked of me when I contributed to them.

What I Will Not Ship Yet

The next version is about the change itself, and it is the one decision here I have not made lightly. Today a change is a command sent to the machines an answer named, with a check I write by hand: the tool evaluates a question before and after, and shows what moved. There is no rehearsal and no undo.

The next verb states a change as the state I want. The tool reads the current state and plans: already so, will change, cannot, unread. Then it rehearses on one machine, a canary: check, apply, verify, apply again and confirm nothing happens, undo, verify the undo. Only then does it roll out, in waves that stop on the first failure, keeping the previous value and a proof per machine. It is written and tested. It has not run on real machines, so it is not in a release, and the roadmap says so.

I am holding it for the same reason the Podman line bothered me. An undo that nobody has run is a hope, not a control. The rehearsal on a canary is the operator’s proof that the way back works on this fleet, today, before the change touches the second machine.

One more place this is going. Sentinel is a private prototype of mine for workload identity and attestation, listed on the Work page. Its nodes run no sshd: each node dials out and parks a connection, and an operator reaches it through a stream opened back down that connection. The outbound tunnel is Sentinel’s. The command execution at the far end is hauntty’s, and in Sentinel’s test suite an unmodified hauntty exec runs end to end through that tunnel while the node holds no listening socket. Identity per caller, issued by SPIRE, is what joins the two, and it is roadmap for both.

Keep It Honest

  • One audit, one model, three runs per arm. The evidence is the ordering, every hauntty run below every SSH run on cost, time, tool calls and tokens. The size of the gap is not pinned down: with three runs per arm the exact test cannot give less than p = 0.10.
  • A lab-controlled fleet: throwaway guests, one distribution, one container runtime, idle machines, findings I planted. The release candidate was tuned on this task, and one of the two hypervisors ran an older daemon.
  • Claude Opus 5.5 got this audit right over plain SSH. Nothing here says the model is poor at the work. The board standing is the public Terminal-Bench 4.1 board as I read it on December 3, 2026. Boards move.
  • The comparison of the March model with Opus 5.5 is one prompt on one machine, three answers each, unscored.
  • Scoring is automatic, against the fleet’s state read before and after each run, then audited by me. The audit was not blind.
  • Three things the census still cannot answer, so every hauntty run scripted them: what a reverse proxy points at, the software version inside a container, and which container holds which GPU slice.
  • The task’s wording, the prompts and the scoring rules are not published. They describe my lab, and they are what a build could be tuned against. The conditions and the limits are.
  • Sentinel is a private prototype, validated on test suites I wrote myself and not externally red-teamed.

What I Take From It

The old way to hitch a horse, as the textbook story goes, was a strap across the throat: the harder the animal pulled, the more it choked on its own effort. The collar moved the load to the shoulders. Same horse, a much heavier plow.

The lesson I did not expect is how little of this was about the model. The same model, the same fleet and the same audit cost $2.04 one way and $1.25 the other, and the difference was what stood between the model and the machines. AI assistance made this tool faster to build than I could have built it alone. What it did not supply was the list of things that go wrong on a real floor, the budget, and the refusal to ship. That is the work that is left for an engineer: build the thing the agent works through, measure it honestly, and fix it when your own diff says the audit changed the fleet.

Horsepower was never the constraint. The hitch was.

Sources