Let your coding agent do the install, and make it check the hash first

All articles

You already have a coding agent open in a terminal. It can run commands, read output and follow written steps. Installing a tool is exactly that kind of job, and it is a better job for the agent than for you clicking through a wizard, as long as it does one thing before it runs anything: check that the file it downloaded is the file that was published.

Here is how that works for DevThrottle, and why the check is the part not to skip.

The prompt

The download page hands you a prompt to paste into the agent you already have:

Install DevThrottle on this machine. Follow https://devthrottle.com/docs/install#install-agent exactly: download the headless installer for this platform and the release manifest, verify the installer SHA-256 against the manifest, and stop if it does not match. Then run install, and tell me the version you installed.

It points the agent at the written steps instead of restating them, so the steps the agent follows are the ones on the page, and it names the hash check out loud so the agent cannot treat it as optional.

What the agent does

  • Downloads two files. The headless installer, which is the same install engine the graphical wizard uses with no window at all, and the release manifest, which lists every file in the release with its SHA-256.
  • Compares the hash. It hashes the installer and compares the result with the manifest's entry for that file. A mismatch means stop, not retry with a warning.
  • Runs prereqs, then install. prereqs only reports whether a coding agent is on the machine. It installs nothing, and on a machine with no agent it exits non-zero, so a script that stops on any error must not stop there. install lays down the app and its command-line tools for your user, with no admin rights. Both take --json for output an agent can read.
  • Leaves the runtime alone. The Director and the Launcher carry their own .NET runtime. An agent that installs one out of habit is doing work the install does not want.

The check, in PowerShell

On Windows the whole verification is a few lines. The manifest is JSON with the files keyed by name, so the expected hash is one property away:

$src = "https://devthrottle.blob.core.windows.net/download"
$exe = "devthrottle-setup-cli-win-x64.exe"
curl.exe -L -o $exe "$src/$exe"
curl.exe -L -o release-manifest.json "$src/release-manifest.json"

$expected = (Get-Content release-manifest.json -Raw | ConvertFrom-Json).assets.$exe.sha256
$actual   = (Get-FileHash $exe -Algorithm SHA256).Hash
if ($actual -eq $expected) { "MATCH - safe to run" } else { "MISMATCH - do not run it" }

Get-FileHash prints upper case and the manifest stores lower case. PowerShell's -eq ignores case for strings, so the comparison holds. We ran this against the live manifest: the real file matched, and the same file with one byte added did not.

Why the check matters more when an agent does it

A person who downloads an installer in a browser gets some screening on the way: the browser and Windows both weigh the file before it runs. A file fetched with curl from a terminal skips that, which is part of why an agent install is quick and has nothing to click. It also means the hash is the check. Without it, the agent runs whatever arrived.

Agents are also very good at carrying on. Faced with a mismatch and a goal of "install this", the path of least resistance is to note the warning and run it anyway. That is why the prompt says stop, in plain words.

The one step that needs you

Everything above runs unattended. Signing in does not: signin opens the website in your browser, you sign in or create an account, and it hands the session back to the machine. That is the only point where the agent should wait for you.

The full steps, including the Mac and Linux headless installers, are on Installing with an AI coding agent. If you would rather click through it yourself, step 1 of the path is Install and connect.

Talk to usBook a 20-minute call