Skip to content

Releases

hauntty v0.11.4

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.

v0.2.0 — durability hardening + deterministic execution gate

Choose a tag to compare

@sch0tten sch0tten released this 31 May 19:08

Hardens hauntty into a solid multi-session ops tool and adds a deterministic completion gate. Every operational bug below was reproduced (on a remote 12-core host and a local go build -race daemon) and fixed with a regression test.

Highlights

  • Foreground-group monitoring — the /proc monitor tracks the terminal foreground process group (tpgid) instead of all bash children. Fixes wrong PIDs, masked read -p prompts, and background-job confusion at the root.
  • Self-healing sessions — a shell that dies (e.g. ran exit) is rebuilt under the same SID; no more [alive] sessions that silently swallow commands.
  • Safe recovery — runaway commands are killed by their foreground process group (real exit code preserved, e.g. 143); recovery never sends a blind exit.
  • Deterministic gate — hauntty wait --pid/--seq blocks locally on the remote /proc, replacing sleep N; ssh host "ps aux | grep proc". A command's & jobs are surfaced as background_pids.
  • Verified wrapper injection (readiness nonce, no 100 ms race), wrapper-captured cwd (no PTY pollution), per-exec hard deadline plumbed through the protocol.
  • Race-clean concurrency — connection-safe encoder, locked session state, serialized PTY writes.

Validation

  • 21 tests under go test -race driving real bash.
  • Remote host under 16-way CPU saturation: 10 sessions spawned concurrently, 90 mixed concurrent commands — 0 failures, 0 dead sessions, 0 log anomalies.

Compatibility

Wire-protocol changes are additive (new fields omitted when empty); backward compatible apart from the new wait op.

Install

go install github.com/sch0tten/hauntty@v0.2.0

Or download a prebuilt static binary below (linux/amd64, linux/arm64). Verify with hauntty_0.2.0_checksums.txt.

Full notes: CHANGELOG.md · Threat model: SECURITY.md

v0.1.1

Choose a tag to compare

@sch0tten sch0tten released this 11 Mar 17:48

Update Security considerations on README, work in progress for next minor release, considering adding an mTLS layer option but worried about the overhead.

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@sch0tten sch0tten released this 11 Mar 15:40

hauntty v0.1.0

Stateful, observable shell sessions for LLM agents.

A single static Go binary that gives LLM agents a real shell on remote hosts: persistent PTY, structured output, deterministic process monitoring via /proc, all over one SSH tunnel. Self-deploying — hauntty connect user@host and it's running.

Highlights

  • Metadata-first execution — every command returns seq, rc, stdout_lines, stderr_lines, cwd before the payload. The agent decides what to read.
  • Persistent PTY sessions — CWD, environment, and shell state survive across commands. No more re-establishing context on every invocation.
  • Parallel sessions — up to 16 independent sessions per host, each with its own shell state and audit log.
  • Deterministic process monitoring — /proc-based classification (running, waiting_input, io_wait, idle, done). No regex heuristics.
  • Self-deploying — hauntty connect user@host SCPs the binary, starts the daemon, forwards the socket. Zero dependencies on the remote.
  • Corpus log — centralized JSONL audit trail across all sessions, filterable by time, host, session, or failure status.
  • Context window efficiency — up to 99% reduction in tokens consumed vs raw SSH, measured on real diagnostic workloads.

Build

git clone https://github.com/sch0tten/hauntty.git
cd hauntty
make build          # local with version stamping
make build-all      # + cross-compile linux/amd64 + linux/arm64

Apache License 2.0