Skip to content

hauntty v0.11.4

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 21:30

hauntty lets an operator, or an AI agent working for one, ask a whole KVM fleet a question (hosts, VMs, the containers in them, units, ports, packages, GPUs) and act on exactly the machines the answer names, through the SSH already in place: no new port, no new credential, nothing installed in any guest. 0.11.4 is the first release since 0.2.0, and with it hauntty is being opened under Apache-2.0.

How this release was made: measure, read what the agents did, change the tool, measure again

The day before this release was cut, we ran a 400-VM audit with the same model twice: once over plain SSH, once through the previous development build of hauntty. It tied: $1.67 per run through hauntty against $1.64 over SSH. (That series was stopped before it finished; it is context, not a result.)

So we read what the agents had done, command by command, and changed the tool wherever it had cost them turns. One example, end to end:

  • What the agents did. In all three runs through hauntty, the agent opened the long contract (hauntty guide --contract) to hunt for a fact that the census does not hold.
  • What we changed. hauntty ask --keys now prints, in about 1 KiB, every kind and key a question can name. A refused key names the nearest one, or says the fact is not in the census and to use run. The brief tells the agent to read the card.
  • What we measured again. In the next day's runs the long contract was opened in 0 of 3 runs, and the keys card was read in 3 of 3.

Then the same audit again, same model, same fleet, three runs per arm:

Per run plain SSH hauntty (0.11.4 release candidate)
Model cost $2.04 $1.25 (39% lower)
Elapsed time 623 s 374 s (40% less)
Tool calls 40.3 21.7
Items correct, of 86 85, 86, 85 86, 86, 86

Both agents reached the guests the same way, through the hypervisor. The SSH agents spent their extra calls collecting raw output into files and writing parsers for it; the hauntty agents asked for answers.

What these figures do not show: a lab-controlled fleet and one task, which the release candidate was tuned on (its changes came from that task); three runs per arm, where p = 0.10 is the floor of the exact test (the direction held in every run, the size is not pinned down); one of the two hypervisors still ran an older daemon; and the SSH arm itself moved between the two days, from $1.64 to $2.04, so part of the gap is day-to-day variation. Not everything moved, either: in every run the agent still ran one command per item inside a guest. Conditions, every run and the earlier studies: docs/results.md.

What you get

  • Answers, not raw output. hauntty ask takes the machines and the questions, opens and reuses its own sessions, reaches each guest through the hypervisor's qemu-guest-agent, collects only what the questions need, and answers in grouped lines: machines with the same answer are one line, and a machine that could not be read is named with the reason, never counted as clean.
  • Act on what an answer named. hauntty run '{{a2}}' --change '…' --verify changes exactly those machines and proves the result; changed shows what moved since the first look; fill writes a report whose machine lists come from the answers.
  • Facts a fleet audit asks for: containers with restart count, exit status, address and published binding; listening ports with what started them; units, packages, kernel errors; GPUs on the host, split into MIG instances or passed whole to a guest.
  • Bounded by design: a deadline per machine on fleet reads, with late machines named; a deadline that ends the whole command; guest replies bounded and compressed inside the guest; a census that starts nothing.
  • A contract for agents in the binary: hauntty guide (about 3.5 KiB, eleven rules), hauntty ask --keys, and a one-line note on stderr when the tool sees a rule broken.
  • A shell that keeps its state underneath, for one-host work: sessions with their own directory and environment, a record of every command, secrets fed on stdin and kept out of the record.

Battle-tested managing 300 VMs on one host with three GPUs, in full passthrough and through MIG slices (passthrough was validated with an earlier version; no MIG slice inside a VM was tested); the audit above ran across two hypervisors.

Security, plainly. hauntty adds no security machinery of its own: SSH is its only transport, and it opens no listening port, stores no credential and implements no cryptography. Inside that boundary there is one level of trust: whoever can act as the daemon's account can drive every session of it. Use it where that is acceptable, one operator or a team that already shares the account. Per-caller identity (SPIFFE, issued by SPIRE), attestation per session and a multi-tenant gateway are on the roadmap, not in this release. SECURITY.md

Next: a change stated as the state wanted (hauntty ensure, with undo), rehearsed on a canary and proved per machine, is built and goes into the next version. ROADMAP.md

Install and verify

Put the binaries for your platforms next to each other on the machine the agent runs on; connect copies the matching one to each host.

TAG=v0.11.4
mkdir -p ~/.local/bin
gh release download "$TAG" -R sch0tten/hauntty -D ~/.local/bin -p 'hauntty-*64' -p SHA256SUMS -p SHA256SUMS.sigstore.json
cd ~/.local/bin
shasum -a 256 --check --ignore-missing SHA256SUMS        # Linux: sha256sum --check --ignore-missing SHA256SUMS
cosign verify-blob SHA256SUMS \
  --bundle SHA256SUMS.sigstore.json \
  --certificate-identity https://github.com/sch0tten/hauntty/.github/workflows/release.yml@refs/tags/v0.11.4 \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
for f in hauntty-*64; do gh attestation verify "$f" --repo sch0tten/hauntty; done
chmod +x hauntty-*64
ln -sf "hauntty-$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" hauntty
hauntty version

SHA256SUMS lists the binaries, their SBOMs (hauntty-<os>-<arch>.spdx.json) and the licence files, and is signed by the workflow that built this release. A rebuild with make build-all in a clone at this tag, with the Go version go.mod states, is expected to give the same digests.

Then one question, offline, on the sample census of this version:

curl -fsSLO https://raw.githubusercontent.com/sch0tten/hauntty/v0.11.4/internal/census/testdata/contract/fleet.json
hauntty --profile agent inventory --from fleet.json --ask 'unit state=failed'

It names a failed data.mount unit and the machines it could not read, and exits 1 because one host of the sample could not be read. Then a read-only question about a host of yours: hauntty ask <host> --once 'unit state=failed'.

What changed since 0.2.0, in full: CHANGELOG.md.