#!/bin/sh set -e # Quint Agent install script # Usage: # read -rs QUINT_DEPLOY_TOKEN && export QUINT_DEPLOY_TOKEN # curl -fsSL https://get.quintai.dev | sudo --preserve-env=QUINT_DEPLOY_TOKEN,QUINT_TENANT_ORG_ID,QUINT_LICENSE,QUINT_LICENSE_FILE sh # # Set QUINT_TENANT_ORG_ID= as well to pin the host to your org: `quint # setup` writes it to config.yaml as tenant_pin_org_id (a non-UUID value stops the # install before anything is downloaded; unset, the host installs unpinned). # # Set QUINT_LICENSE= (or QUINT_LICENSE_FILE=) # to license the host: `quint setup` stores it in config.yaml as license (council 19 # C19-04). Both reach setup through the environment only, never argv, and are never # echoed. Unset, an existing license is kept and nothing else changes. # # The enrolment token is read from QUINT_DEPLOY_TOKEN or from --token-file # (a 0600 file). A token passed as a script argument is refused: an argument is # readable by every local user in `ps` for the whole install and stays in shell # history (Aikido 673380088 / EDGE-2). # --------------------------------------------------------------------------- # Banner # --------------------------------------------------------------------------- cat <<'BANNER' ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠀⠀⠀⠀⣠⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⢀⣴⠛⡄⠀⣠⠞⠁⠀⠀⠀⠀⠀⠀⣠⣾⠟⠛⠛⠛⠿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀ ⠀⠀⠀⢀⣀⣤⣶⣋⣁⣀⣱⣞⣁⣀⣀⣀⡀⠀⠀⠀⢠⣿⠃⠀⠀⠀⠀⠀⢹⣷⠀⢸⣿⠀⠀⠀⠀⣿⠀⠀⢸⣿⠀⠀⣿⡧⠚⠛⠻⣿⡆⠀⠛⣿⡟⠛⠃⠀⠀⠀ ⠀⠀⠀⠈⠉⠉⠉⢉⣽⠟⡉⠉⣩⠿⠛⠉⠁⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⢸⣿⠀⢸⣿⠀⠀⠀⠀⣿⠀⠀⢸⣿⠀⠀⣿⡇⠀⠀⠀⣿⡇⠀⠀⣿⡇⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⢀⣴⠟⠁⠀⣧⡞⠁⠀⠀⠀⠀⠀⠀⠀⠀⢻⣧⣀⠀⠀⢀⣠⣾⠏⠀⠸⣿⡀⠀⢀⡰⣿⠀⠀⢸⣿⠀⠀⣿⡇⠀⠀⠀⣿⡇⠀⠀⣿⡇⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠛⠁⠀⠀⠀⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⠛⠛⢻⣧⠀⠀⠀⠙⠛⠛⠋⠀⠛⠀⠀⠘⠛⠀⠀⠛⠃⠀⠀⠀⠛⠃⠀⠀⠘⠛⠛⠃⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ Firewall for AI Agents ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ BANNER # --------------------------------------------------------------------------- # Defaults # --------------------------------------------------------------------------- TOKEN="${QUINT_DEPLOY_TOKEN:-}" TOKEN_FILE="" API_URL="https://api.quintai.dev" # --------------------------------------------------------------------------- # Parse arguments # --------------------------------------------------------------------------- while [ $# -gt 0 ]; do case "$1" in --token) # Refused before anything is downloaded or written: the value is already in # argv (ps, every local user) and in shell history. Exit 2, as `quint setup # --token` does, so an old runbook fails loudly. Never echo $2. echo "install.sh: --token is refused (the token would be visible in ps and shell history). Use:" >&2 echo " read -rs QUINT_DEPLOY_TOKEN && export QUINT_DEPLOY_TOKEN" >&2 echo " curl -fsSL https://get.quintai.dev | sudo --preserve-env=QUINT_DEPLOY_TOKEN,QUINT_TENANT_ORG_ID,QUINT_LICENSE,QUINT_LICENSE_FILE sh" >&2 echo "or --token-file <0600 file>." >&2 exit 2 ;; --token-file) TOKEN_FILE="$2" shift 2 ;; --api-url) API_URL="$2" shift 2 ;; *) echo "Unknown option: $1" shift ;; esac done # Arguments are parsed BEFORE the root check so that a refused `--token` exits # before anything else happens — including the sudo prompt an old runbook would # otherwise reach with the secret already in argv. Parsing has no side effects. # --------------------------------------------------------------------------- # Check root # --------------------------------------------------------------------------- if [ "$(id -u)" -ne 0 ]; then echo "Error: this installer must be run as root." echo "" echo " read -rs QUINT_DEPLOY_TOKEN && export QUINT_DEPLOY_TOKEN" echo " curl -fsSL https://get.quintai.dev | sudo --preserve-env=QUINT_DEPLOY_TOKEN,QUINT_TENANT_ORG_ID,QUINT_LICENSE,QUINT_LICENSE_FILE sh" echo "" exit 1 fi # Token precedence: --token-file, then QUINT_DEPLOY_TOKEN. (A token in argv is refused at parse time.) # A value that arrived safely is never overridden by one every local user could read. if [ -n "$TOKEN_FILE" ]; then if [ ! -f "$TOKEN_FILE" ]; then echo "Error: --token-file $TOKEN_FILE is not a file." exit 1 fi # Refuse a token file other users can read: that is the argv leak by another route. # shellcheck disable=SC2012 # only the mode bits of one named file are read case "$(ls -ld "$TOKEN_FILE" | cut -c5-10)" in ------) ;; *) echo "Error: $TOKEN_FILE is readable by other users; chmod 600 it and retry."; exit 1 ;; esac IFS= read -r TOKEN < "$TOKEN_FILE" || true fi if [ -z "$TOKEN" ]; then echo "Usage:" echo " read -rs QUINT_DEPLOY_TOKEN && export QUINT_DEPLOY_TOKEN" echo " curl -fsSL https://get.quintai.dev | sudo --preserve-env=QUINT_DEPLOY_TOKEN,QUINT_TENANT_ORG_ID,QUINT_LICENSE,QUINT_LICENSE_FILE sh -s -- [--api-url ]" echo "" echo "Options:" echo " QUINT_DEPLOY_TOKEN (env) Agent enrollment token" echo " QUINT_TENANT_ORG_ID (env) Org UUID to pin this host to (from the dashboard snippet)" echo " QUINT_LICENSE (env) Tenant license (a v4.public. token), stored as license" echo " QUINT_LICENSE_FILE (env) A file holding the tenant license, instead of QUINT_LICENSE" echo " --token-file Read the enrollment token from a 0600 file" echo " --api-url API endpoint (default: https://api.quintai.dev)" exit 1 fi # Tenant pin (pin-at-bundle L3). Checked here, before anything is downloaded, so a # mistyped org stops the install with nothing changed; `quint setup` checks it again # and owns the config.yaml rules (keep an existing pin when none is supplied; a # different one re-pins the host, with a warning: D12). # The value is never echoed: a token pasted into the wrong variable would be. TENANT_ORG_ID="" if [ -n "${QUINT_TENANT_ORG_ID:-}" ]; then TENANT_ORG_ID=$(printf '%s' "$QUINT_TENANT_ORG_ID" | tr 'ABCDEF' 'abcdef') case "$TENANT_ORG_ID" in *[!0-9a-f-]*) TENANT_ORG_ID="" ;; esac if ! printf '%s\n' "$TENANT_ORG_ID" | grep -Eqx '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'; then echo "Error: QUINT_TENANT_ORG_ID is set but is not an org UUID; nothing was installed." >&2 exit 1 fi elif grep -q '^tenant_pin_org_id:' /etc/quint/config.yaml 2>/dev/null; then echo "QUINT_TENANT_ORG_ID is not set: keeping the tenant pin already in /etc/quint/config.yaml." else echo "Warning: QUINT_TENANT_ORG_ID is not set: this host will not be pinned to an org at install" echo " and will trust the org its first registration names. Copy the install snippet" echo " from the dashboard to pin it." fi # Tenant license (council 19 C19-04b). `quint setup` reads QUINT_LICENSE or # QUINT_LICENSE_FILE from its environment (C19-04); they reach this root shell only # through `sudo --preserve-env=...,QUINT_LICENSE,QUINT_LICENSE_FILE` and reach setup # by inheritance, so the license is never in any argv. Checked here, before anything # is downloaded, with setup's own format rules (one trailing newline, then one CR, # dropped; v4.public. header, 8 KiB cap, base64url and '.' only), so a malformed # value or file stops the install with nothing changed. The value is never echoed: # a token pasted into the wrong variable would be. Unset, this block does nothing. # # license_shape_ok VALUE: true when VALUE is a license by setup's rules # (cloud.NormalizeLicense). A shell function, so VALUE is in no process's argv. license_shape_ok() { _l=${1%" "} _l=${_l%"$(printf '\r')"} case "$_l" in v4.public.*[!ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-]*) return 1 ;; v4.public.*) ;; *) return 1 ;; esac [ "${#_l}" -le 8192 ] } if [ -n "${QUINT_LICENSE:-}" ] && [ -n "${QUINT_LICENSE_FILE:-}" ]; then echo "Error: both QUINT_LICENSE and QUINT_LICENSE_FILE are set; give one; nothing was installed." >&2 exit 1 fi if [ -n "${QUINT_LICENSE:-}" ] && ! license_shape_ok "$QUINT_LICENSE"; then echo "Error: QUINT_LICENSE is set but is not a license (v4.public. token, no whitespace, at most 8 KiB); nothing was installed." >&2 exit 1 fi if [ -n "${QUINT_LICENSE_FILE:-}" ]; then if [ ! -f "$QUINT_LICENSE_FILE" ] || [ ! -r "$QUINT_LICENSE_FILE" ]; then echo "Error: QUINT_LICENSE_FILE is not a readable file; nothing was installed." >&2 exit 1 fi # Size first, so an oversized file is never read; 8 KiB plus a trailing CR LF, # as setup reads it. _lic_size=$(wc -c <"$QUINT_LICENSE_FILE" | tr -d ' ') if ! [ "$_lic_size" -le 8194 ] 2>/dev/null; then echo "Error: QUINT_LICENSE_FILE is over 8 KiB, so it is not a license; nothing was installed." >&2 exit 1 fi # The trailing "." keeps the file's own trailing newlines for license_shape_ok to judge. _lic_raw=$(cat -- "$QUINT_LICENSE_FILE" && echo .) || _lic_raw="" if ! license_shape_ok "${_lic_raw%.}"; then echo "Error: QUINT_LICENSE_FILE does not hold a license (v4.public. token, no whitespace, at most 8 KiB); nothing was installed." >&2 exit 1 fi unset _lic_size _lic_raw fi # --------------------------------------------------------------------------- # Detect OS and architecture # --------------------------------------------------------------------------- OS="$(uname -s | tr '[:upper:]' '[:lower:]')" ARCH="$(uname -m)" # The published assets are named `x64`, NOT `amd64` — verified against the real # v1.1.1 release and the S3 mirror. This said "amd64", which broke Intel Macs and # x86 Linux two ways at once: the download URL 404'd (quint-darwin-amd64.tar.gz # does not exist), and `pinned_sha_for darwin amd64` fell through its case to the # empty string, silently downgrading integrity to the weaker same-origin # checksum. Apple Silicon was unaffected, which is why nobody noticed. case "$ARCH" in x86_64) ARCH="x64" ;; amd64) ARCH="x64" ;; aarch64) ARCH="arm64" ;; arm64) ARCH="arm64" ;; *) echo "Error: unsupported architecture: $ARCH" exit 1 ;; esac echo "Detected OS=${OS} ARCH=${ARCH}" # --------------------------------------------------------------------------- # Fetch latest version from GitHub releases API # --------------------------------------------------------------------------- # Must be a version that is actually ON the public mirror, since that is the # only place an outside user can download from. It was "1.0.0", which has never # been mirrored (measured: HTTP 403), so every fallback path — the one taken # precisely when GitHub is unreachable — resolved to an undownloadable version # and the install died two steps later. Keep this equal to PINNED_VERSION so the # fallback also gets the strong pinned checksum instead of the weaker # same-origin one. scripts/check-installers.sh enforces both. # # THE FALLBACK IS NOT A FALLBACK — IT IS THE ONLY PATH. The lookup below hits # api.github.com/repos/Quint-Security/proxy/releases/latest UNAUTHENTICATED, and # the repo is private, so it answers 404. Measured 2026-09-12: HTTP 404. So # $VERSION is always empty, this warning always prints, and every real install # resolves to exactly this version. That makes the pin the product version for # every stranger who runs the documented curl|sh line, which is why it being three # releases stale mattered: 1.1.16 predates the sysext-carrying package work. # The last release whose signed .sha256 line is BARE (` `, no tag). From the # next release on, release.yml writes ` /` (the mirror key), so the # release key attests (version, asset, digest) and a correctly signed OLDER release # served under a NEWER prefix is a relabel, not a release (Aikido 673380017; bug bash # 2026-10-18 BB-X-X7-1 / BB-X-X7-2, #1512). A bare line is accepted ONLY for a version at # or below this one, or for PINNED_VERSION when its digest IS the pinned digest. Refusing # bare lines for every version is a founder decision (docket D-18): it breaks every # install of an explicitly requested version <= 1.1.26. The default install is no longer # one: the pin is v1.1.30, signed in the tagged form (2026-11-05; the first tagged pin was # v1.1.27, 2026-10-26). To flip, set this to "0.0.0" in BOTH installers. LEGACY_BARE_LINE_MAX_VERSION="1.1.26" # version_is_semverish VERSION -> 0 when VERSION is x.y.z or x.y.z-: the # grammar the updater's `semverish` accepts, without the leading v. Anything else never # reaches a URL or a checksum line. version_is_semverish() { printf '%s' "$1" | LC_ALL=C grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$' } # version_le A B -> 0 when A <= B on the numeric x.y.z (a prerelease suffix is ignored, # so 1.1.26-rc1 <= 1.1.26). Both must already be semverish. version_le() { _a="${1%%-*}"; _b="${2%%-*}" _i=1 while [ "$_i" -le 3 ]; do _x="$(printf '%s' "$_a" | cut -d. -f"$_i")"; _y="$(printf '%s' "$_b" | cut -d. -f"$_i")" if [ "$_x" -lt "$_y" ]; then return 0; fi if [ "$_x" -gt "$_y" ]; then return 1; fi _i=$((_i + 1)) done return 0 } # signed_checksum_for_release CHECKSUM_FILE VERSION ASSET PINNED_DIGEST # Prints the lowercase digest of the ONE signed line that vouches for v/, # or nothing (the caller then refuses). Always exits 0: the empty output is the verdict. # The signed statement is the whole line, so: # - shasum's shape only: exactly two fields, a 64-hex digest and a filename (a leading # `*`, shasum's binary-mode marker, is stripped from the filename, nothing else); # - the filename must EQUAL `v/`: no basename, no suffix match, no # path cleaning. `v1.0.0/`, `evil/v9.9.9/` and `v9.9.9/` are # three different strings and only the last is the key the mirror was asked for; # - a BARE filename equal to vouches only when PINNED_DIGEST is set and the # line's digest IS it (the pinned fallback), or VERSION <= LEGACY_BARE_LINE_MAX_VERSION. # Mirrors internal/updater verifyChecksumFor and deploy/container/stage-pins.sh. signed_checksum_for_release() { version_is_semverish "$2" || return 0 _bare_ok="" if [ -n "$4" ]; then _bare_ok="pin" elif version_le "$2" "$LEGACY_BARE_LINE_MAX_VERSION"; then _bare_ok="legacy" fi LC_ALL=C awk -v key="v$2/$3" -v bare="$3" -v bare_ok="$_bare_ok" -v pin="$4" ' NF != 2 || length($1) != 64 || $1 !~ /^[0-9a-fA-F]+$/ { next } { f = $2; sub(/^\*/, "", f); d = tolower($1) if (f == key) { print d; exit } if (f == bare && bare_ok == "pin" && d == tolower(pin)) { print d; exit } if (f == bare && bare_ok == "legacy") { print d; exit } }' "$1" } FALLBACK_VERSION="1.1.30" VERSION="$(curl -fsSL https://api.github.com/repos/Quint-Security/proxy/releases/latest 2>/dev/null \ | grep tag_name | cut -d'"' -f4 | sed 's/^v//' || true)" if [ -z "$VERSION" ]; then echo "Warning: could not reach GitHub releases API, falling back to v${FALLBACK_VERSION}" VERSION="$FALLBACK_VERSION" elif ! version_is_semverish "$VERSION"; then # Normalised (leading v already stripped) and VALIDATED before anything is built from # it: the version names the mirror key (v/) and the signed line the # checksum step must match. A tag that is not plainly a version builds no URL. echo "Warning: GitHub releases API returned '${VERSION}', which is not a version; falling back to v${FALLBACK_VERSION}" VERSION="$FALLBACK_VERSION" fi echo "Installing Quint Agent v${VERSION} ..." # --------------------------------------------------------------------------- # Release signature verification (authenticity, not just integrity) # --------------------------------------------------------------------------- # Every release ships quint--.tar.gz, a .sha256 of it, and a .sha256.sig: a # hex Ed25519 signature OVER THE BYTES OF THE .sha256 FILE, made with Quint's release # key. A checksum fetched beside the tarball proves only that the two files agree with # each other; whoever can replace the tarball on the mirror can replace the .sha256. # The signature is what proves Quint produced them, and the daemon's own updater # (internal/updater) REFUSES any release without one. This installer applies the same # rule, for EVERY version — pinned or not — and the pinned digest below is a SECOND # factor on top of it, never the only one. # # RELEASE_SIGNING_PUBKEY_PEM MUST stay byte-identical to internal/updater/ # release-signing-pub.pem, the key compiled into the daemon. scripts/check-installers.sh # compares the two and cmd/proxy's installer tests verify a real signature with it, so # a key rotation that forgets either installer fails CI instead of failing customers. RELEASE_SIGNING_PUBKEY_PEM="-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAW+Or8EMgQZSXbnxfbYhibH9wRnZXGUjDq1VPfA/h7x8= -----END PUBLIC KEY-----" # Known-answer vector: the published v1.1.30 quint-darwin-arm64.tar.gz.sha256 (the message, # a trailing newline is appended when written) and its .sha256.sig, as served by the # mirror. Before any verifier tool is allowed to judge a download it must ACCEPT this # pair and REJECT the same pair with one hex digit of the signature changed. A tool that # cannot do Ed25519 (macOS's /usr/bin/openssl is LibreSSL 3.3 and cannot) fails the # first half and is skipped; a tool that accepts anything fails the second and is skipped. # Without this a "verify" that errors out for want of an algorithm would be # indistinguishable from a forgery, and one that prints success for everything would be # indistinguishable from a good release. SIG_SELFTEST_MESSAGE="a5425ce971fd5fef218a688240016a495755b9a7c561798a825662b5ee4775dc v1.1.30/quint-darwin-arm64.tar.gz" SIG_SELFTEST_SIG="8ff2abc8b15e3360ebe320b6d34c28c6c1a2f45954b657a1a78ee99533f5a20a65f1558e81fa0428277ee72a53f7867c53feafe297e17e19bb0c75611b66c308" # sig_hex_to_bin HEXFILE OUTFILE: the .sig is 128 hex digits; write the 64 raw bytes. # Anything else (empty, HTML from a captive portal, a truncated download) is a failure. # Octal escapes through printf are POSIX; \x and xxd are not everywhere. sig_hex_to_bin() { _hex="$(LC_ALL=C tr -d ' \t\r\n' < "$1" 2>/dev/null)" if ! printf '%s' "$_hex" | LC_ALL=C grep -Eq '^[0-9a-fA-F]{128}$'; then return 1 fi _oct="$(printf '%s' "$_hex" | LC_ALL=C awk '{ s = tolower($0) for (i = 1; i <= length(s); i += 2) { v = (index("0123456789abcdef", substr(s, i, 1)) - 1) * 16 + index("0123456789abcdef", substr(s, i + 1, 1)) - 1 printf "\\%03o", v } }')" # shellcheck disable=SC2059 # the octal escapes ARE the format printf "$_oct" > "$2" } # sig_verify_openssl PUBPEM MSGFILE SIGHEXFILE -> 0 valid, non-zero otherwise. # Needs OpenSSL >= 1.1.1 (Ed25519 + -rawin). LibreSSL is rejected by the self-test. sig_verify_openssl() { command -v openssl >/dev/null 2>&1 || return 1 sig_hex_to_bin "$3" "$3.bin" || return 1 openssl pkeyutl -verify -pubin -inkey "$1" -rawin -in "$2" -sigfile "$3.bin" >/dev/null 2>&1 } # sig_verify_python3 PUBPEM MSGFILE SIGHEXFILE -> 0 valid, 1 invalid, 2 malformed input. # RFC 8032 Ed25519 verification in the standard library only (no third-party module), for # hosts whose openssl is LibreSSL. macOS ships python3 with the Command Line Tools. sig_verify_python3() { command -v python3 >/dev/null 2>&1 || return 1 python3 - "$1" "$2" "$3" <<'PY' import base64, hashlib, sys p = 2**255 - 19 q = 2**252 + 27742317777372353535851937790883648493 d = (-121665 * pow(121666, p - 2, p)) % p def add(P, Q): A = ((P[1] - P[0]) * (Q[1] - Q[0])) % p B = ((P[1] + P[0]) * (Q[1] + Q[0])) % p C = (2 * P[3] * Q[3] * d) % p D = (2 * P[2] * Q[2]) % p E, F, G, H = B - A, D - C, D + C, B + A return ((E * F) % p, (G * H) % p, (F * G) % p, (E * H) % p) def mul(s, P): Q = (0, 1, 1, 0) while s > 0: if s & 1: Q = add(Q, P) P = add(P, P) s >>= 1 return Q def equal(P, Q): return (P[0] * Q[2] - Q[0] * P[2]) % p == 0 and (P[1] * Q[2] - Q[1] * P[2]) % p == 0 sqrt_m1 = pow(2, (p - 1) // 4, p) def recover_x(y, sign): if y >= p: return None x2 = (y * y - 1) * pow(d * y * y + 1, p - 2, p) if x2 % p == 0: return None if sign else 0 x = pow(x2, (p + 3) // 8, p) if (x * x - x2) % p != 0: x = x * sqrt_m1 % p if (x * x - x2) % p != 0: return None if (x & 1) != sign: x = p - x return x def decompress(s): if len(s) != 32: return None y = int.from_bytes(s, "little") sign = y >> 255 y &= (1 << 255) - 1 x = recover_x(y, sign) return None if x is None else (x, y, 1, x * y % p) gy = 4 * pow(5, p - 2, p) % p gx = recover_x(gy, 0) G = (gx, gy, 1, gx * gy % p) def verify(pub, msg, sig): if len(pub) != 32 or len(sig) != 64: return False A = decompress(pub) R = decompress(sig[:32]) if A is None or R is None: return False s = int.from_bytes(sig[32:], "little") if s >= q: return False h = int.from_bytes(hashlib.sha512(sig[:32] + pub + msg).digest(), "little") % q return equal(mul(s, G), add(R, mul(h, A))) try: with open(sys.argv[1], "rb") as f: pem = f.read().decode("ascii") body = "".join(l.strip() for l in pem.splitlines() if l.strip() and not l.startswith("-----")) spki = base64.b64decode(body, validate=True) # SubjectPublicKeyInfo for id-Ed25519 (RFC 8410): fixed 12-byte header then the 32-byte key. if len(spki) != 44 or spki[:12] != bytes.fromhex("302a300506032b6570032100"): sys.exit(2) pub = spki[12:] with open(sys.argv[2], "rb") as f: msg = f.read() with open(sys.argv[3], "rb") as f: sig_hex = f.read().decode("ascii").strip() if len(sig_hex) != 128: sys.exit(2) sig = bytes.fromhex(sig_hex) except Exception: sys.exit(2) sys.exit(0 if verify(pub, msg, sig) else 1) PY } # select_sig_verifier WORKDIR: pick the first tool that passes BOTH halves of the # known-answer self-test, into SIG_VERIFIER. Returns 1 when none does. SIG_VERIFIER="" select_sig_verifier() { _d="$1" printf '%s\n' "$RELEASE_SIGNING_PUBKEY_PEM" > "$_d/release-signing-pub.pem" printf '%s\n' "$SIG_SELFTEST_MESSAGE" > "$_d/selftest.sha256" printf '%s\n' "$SIG_SELFTEST_SIG" > "$_d/selftest.sig" # The same signature with its LAST hex digit changed: a correct verifier MUST refuse it. _rep=0 case "$SIG_SELFTEST_SIG" in *0) _rep=1 ;; esac printf '%s%s\n' "${SIG_SELFTEST_SIG%?}" "$_rep" > "$_d/selftest-bad.sig" for _tool in openssl python3; do if "sig_verify_$_tool" "$_d/release-signing-pub.pem" "$_d/selftest.sha256" "$_d/selftest.sig" \ && ! "sig_verify_$_tool" "$_d/release-signing-pub.pem" "$_d/selftest.sha256" "$_d/selftest-bad.sig"; then SIG_VERIFIER="$_tool" return 0 fi done return 1 } # verify_release_signature CHECKSUM_FILE SIG_FILE WORKDIR -> 0 only when the .sig is a # valid Ed25519 signature of the checksum file's bytes under RELEASE_SIGNING_PUBKEY_PEM. # Any other outcome, including "no capable tool on this host", is a refusal: the caller # must not install. verify_release_signature() { if [ -z "$SIG_VERIFIER" ]; then select_sig_verifier "$3" || return 2 fi "sig_verify_$SIG_VERIFIER" "$3/release-signing-pub.pem" "$1" "$2" } # --------------------------------------------------------------------------- # Download binary (tarball format) # --------------------------------------------------------------------------- # Asset naming verified against the real release: `quint-darwin-arm64.tar.gz`. # As of v1.1.1 it contains TWO binaries, `quint` and `quint-hook` (v1.0.0 had # only `quint`). Both the repo name (renamed quint-proxy -> proxy) and the # `quint-proxy-` asset prefix were wrong here, so every download 404'd. # PUBLIC MIRROR FIRST. Quint-Security/proxy is private, and GitHub answers 404 # (not 403) for unauthenticated requests to a private repo's release assets — so # the GitHub URL cannot work for anyone outside the org, which is every real user # of this script. Assets are mirrored to a public S3 bucket for exactly that. RELEASE_MIRROR="${QUINT_RELEASE_MIRROR:-https://quint-releases-public.s3.amazonaws.com}" TARBALL_URL="${RELEASE_MIRROR}/v${VERSION}/quint-${OS}-${ARCH}.tar.gz" TARBALL_URL_GITHUB="https://github.com/Quint-Security/proxy/releases/download/v${VERSION}/quint-${OS}-${ARCH}.tar.gz" CHECKSUM_URL="${TARBALL_URL}.sha256" SIGNATURE_URL="${TARBALL_URL}.sha256.sig" # Checksums PINNED HERE, not trusted from the mirror. # # A .sha256 fetched from the same origin as the tarball proves only that the # transfer wasn't corrupted: whoever controls that origin controls both files. The # pin below arrived over TLS from get.quintai.dev, which is the trust the user # already extended by piping this script into a shell. S3 bucket names are also # globally unique, so a deleted bucket could be re-claimed by anyone and serve this # exact URL — the pin is what makes that survivable. # BUMPED 1.1.16 -> 1.1.21 (2026-09-12) -> 1.1.23 (2026-10-06) -> 1.1.24 # (2026-10-07) -> 1.1.27 (2026-10-26; 1.1.25 and 1.1.26 were never pinned) -> 1.1.28 # (2026-11-01) -> 1.1.29 (2026-11-03) -> 1.1.30 # (2026-11-05). 1.1.22 was skipped for a measured reason: # v1.1.22's tarballs are NOT on the mirror. All twelve answer 403 (measured # 2026-09-12), because its release run's mirror job failed on a credential that # does not exist — see the mirror job in .github/workflows/release.yml. Pinning # 1.1.22 would pin a version no stranger can download. # # v1.1.30 is pinned because it is VERIFIED PRESENT, not because it is the highest # number (prereleases such as v1.1.30-rc2 are never pin targets). Measured 2026-11-05, # anonymously, all four platforms: the mirror's bytes, # the mirror's published .sha256, and the GitHub release's bytes agree; every # .sha256.sig verifies against internal/updater/release-signing-pub.pem, the key # deployed daemons compile in. Re-verify with: # scripts/publish-release-mirror.sh --tag v1.1.30 --from-release --dry-run PINNED_VERSION="1.1.30" pinned_sha_for() { case "$(printf '%s_%s' "$1" "$2" | tr '-' '_')" in darwin_arm64) printf '%s' "a5425ce971fd5fef218a688240016a495755b9a7c561798a825662b5ee4775dc" ;; darwin_x64) printf '%s' "1ec190b8cd1ab9b8477dd9e4851c378131e4f20a87da58e6865990b63cfa623f" ;; linux_arm64) printf '%s' "d256f771b108f3c4b626ebd9ea725de38069157b1f9145a4e778e86c9112a989" ;; linux_x64) printf '%s' "3ca047288219c9a55ea13b7934d8216dc358ab6731cbb3b940b998d074acaa29" ;; *) printf '' ;; esac } # A PRIVATE STAGING DIRECTORY, NOT A FIXED NAME IN /tmp. # # This installer is hard-gated to root above, and it used to download to the fixed paths # /tmp/quint-download.tar.gz and /tmp/quint-download.sha256. `curl -o` is fopen("wb"): it FOLLOWS a # pre-planted symlink and writes through it, leaving the link intact. Proven, not assumed: # # $ printf 'ORIGINAL\n' > victim.conf && ln -s "$PWD/victim.conf" ./download.tar.gz # $ curl -fsSL -o ./download.tar.gz https://example.com # $ cat victim.conf -> ... # overwritten, link intact # # /tmp is world-writable AND cleared on reboot, so the name is reliably absent at a known moment. Any # local unprivileged user could run # # ln -s /Library/LaunchDaemons/com.quint.security.plist /tmp/quint-download.tar.gz # # and the next admin running the documented `curl … | sudo sh` line would have root overwrite that file # with tarball bytes — permanently disabling the Quint sensor. For an EDR that is the whole product. # This was live: get.quintai.dev served the vulnerable script, and the release tarball URL returns 200. # # `mktemp -d` gives a 0700 directory owned by root with an unpredictable name, so there is nothing to # pre-plant. THIS IS NOT A NEW PATTERN — deploy/install.sh:574 has done exactly this all along. Two # installers, one hardened and one not, is a drift this repo has now been bitten by three times, so # scripts/check-installers.sh gains a rule for it in this same change. STAGING_DIR="$(mktemp -d)" # The temp install_executable is filling, while it fills one (a signal mid-copy must not # leave a root-owned `.quint.new.XXXXXX` in /usr/local/bin). IE_TMP="" cleanup() { if [ -n "$IE_TMP" ]; then rm -f "$IE_TMP" 2>/dev/null || true fi rm -rf "$STAGING_DIR" } # Each signal EXITS, with its own status. A trap that only cleans up returns to the script, # which then carries on: an interrupt that landed inside an `if` (the hook install) went # on into `quint setup` and printed "installed successfully" (review of #1010, reproduced # with INT and TERM under dash, bash and ksh). HUP too: the terminal closing under # `curl … | sudo sh` is the likeliest interruption. Same shape as deploy/install.sh and # scripts/install-binary-by-rename.sh. trap cleanup EXIT trap 'cleanup; exit 129' HUP trap 'cleanup; exit 130' INT trap 'cleanup; exit 143' TERM TARBALL_PATH="${STAGING_DIR}/quint-download.tar.gz" CHECKSUM_PATH="${STAGING_DIR}/quint-download.sha256" SIGNATURE_PATH="${STAGING_DIR}/quint-download.sha256.sig" echo "Downloading from ${TARBALL_URL} ..." if ! curl -fsSL -o "${TARBALL_PATH}" "$TARBALL_URL"; then # Mirror miss — try GitHub, which works only with repo access. echo "Mirror miss, trying GitHub releases ..." if curl -fsSL -o "${TARBALL_PATH}" "$TARBALL_URL_GITHUB"; then CHECKSUM_URL="${TARBALL_URL_GITHUB}.sha256" SIGNATURE_URL="${TARBALL_URL_GITHUB}.sha256.sig" fi fi if [ ! -s "${TARBALL_PATH}" ]; then echo "Error: failed to download quint v${VERSION}" echo " tried ${TARBALL_URL}" echo " tried ${TARBALL_URL_GITHUB}" echo # Be explicit about the most likely cause rather than leaving a bare 404. # Quint-Security/proxy is a PRIVATE repository, and GitHub returns 404 (not # 403) for unauthenticated requests to a private repo's release assets — so # this path cannot work for anyone outside the org, no matter what the URL says. echo " The Quint repository is currently private, so release assets are not" echo " publicly downloadable. Until public artifact hosting is in place, use" echo " the notarized installer package instead:" echo echo " 1. Get quint-.pkg from your Quint contact" echo " 2. spctl -a -vvv -t install quint-.pkg" echo " (expect: accepted / source=Notarized Developer ID)" echo " 3. Double-click it, then: sudo --preserve-env=QUINT_DEPLOY_TOKEN quint setup" echo echo " The .pkg is the supported path — it installs the kernel EndpointSecurity" echo " and NetworkExtension components that this tarball does not contain." exit 1 fi # Verify the release: AUTHENTICITY first, then INTEGRITY, then the pin. # # .sha256.sig -> "Quint produced this .sha256" (Ed25519, the key the daemon compiles in) # .sha256 -> "and these are the bytes it names" (line bound to the asset we asked for) # pinned digest -> a SECOND factor for PINNED_VERSION, carried in this script over TLS # # Every step FAILS CLOSED: a missing or unverifiable .sig, a host with no Ed25519-capable # tool, a .sha256 naming another asset, a digest mismatch, or a pin that disagrees with a # correctly signed download are all refusals. Before this change the .sig was never read, # and for any version other than PINNED_VERSION a same-origin .sha256 was the only check # (audit CI-7, 2026-10-08). Same mechanism as deploy/install.sh; check-installers.sh holds # the two together. echo "Verifying release signature ..." if ! curl -fsSL -o "${CHECKSUM_PATH}" "$CHECKSUM_URL" 2>/dev/null || [ ! -s "${CHECKSUM_PATH}" ]; then echo "Error: no checksum asset for v${VERSION} ${OS}/${ARCH} at ${CHECKSUM_URL}." echo " Refusing to install an unverified binary. Use the notarized .pkg instead." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" exit 1 fi if ! curl -fsSL -o "${SIGNATURE_PATH}" "$SIGNATURE_URL" 2>/dev/null || [ ! -s "${SIGNATURE_PATH}" ]; then echo "Error: no signature asset for v${VERSION} ${OS}/${ARCH} at ${SIGNATURE_URL}." echo " A checksum alone does not prove the release came from Quint; the daemon's own" echo " updater refuses such a release and so does this installer." echo " Refusing to install an unverified binary. Use the notarized .pkg instead." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi # `if` form, not `cmd; rc=$?`: this script runs under set -e. if verify_release_signature "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" "${STAGING_DIR}"; then SIG_RC=0 else SIG_RC=$? fi if [ "$SIG_RC" -eq 2 ] && [ -z "$SIG_VERIFIER" ]; then echo "Error: no tool on this host can verify an Ed25519 signature. Need OpenSSL >= 1.1.1" echo " (macOS's /usr/bin/openssl is LibreSSL and cannot) or python3 on PATH. On macOS," echo " python3 comes with the Command Line Tools: xcode-select --install" echo " Refusing to install a release whose signature cannot be checked. Use the" echo " notarized .pkg instead." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi if [ "$SIG_RC" -ne 0 ]; then echo "Error: signature verification FAILED for ${CHECKSUM_URL} (via ${SIG_VERIFIER})." echo " The .sha256 was not signed by Quint's release key, or has been altered." echo " The release may be tampered with. Aborting." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi echo "Release signature verified (Ed25519, via ${SIG_VERIFIER})." # The signed .sha256 is ` /` (release.yml: shasum output with the mirror # key as the filename). Bind the line to the RELEASE we asked for, as the updater does: a # correctly signed quint-linux-x64 digest must not vouch for a darwin tarball, and a # correctly signed OLDER release served under this version's prefix must not vouch for it # either. Before this change the line's path components were stripped (`sub(/.*\//, "", f)`), # so a signed `v1.0.0/`, `evil/v9.9.9/` or bare `` line vouched for # whatever sat under v9.9.9/ (bug bash BB-X-X7-2, #1512). signed_checksum_for_release # holds the exact rule and the <= 1.1.26 legacy window. The pinned fallback is v1.1.30, # whose signed lines are already in the tagged `v1.1.30/` form; a BARE line still # vouches for the pin only when its digest is the pinned digest. PINNED="" if [ "$VERSION" = "$PINNED_VERSION" ]; then PINNED="$(pinned_sha_for "$OS" "$ARCH")" fi EXPECTED="$(signed_checksum_for_release "${CHECKSUM_PATH}" "$VERSION" "quint-${OS}-${ARCH}.tar.gz" "$PINNED")" CHECKSUM_SOURCE="signed .sha256" echo "Verifying checksum ..." if [ -n "$EXPECTED" ]; then if command -v shasum >/dev/null 2>&1; then ACTUAL="$(shasum -a 256 "${TARBALL_PATH}" | awk '{print tolower($1)}')" elif command -v sha256sum >/dev/null 2>&1; then ACTUAL="$(sha256sum "${TARBALL_PATH}" | awk '{print tolower($1)}')" else # Refuse rather than pretend. Setting ACTUAL="$EXPECTED" made the comparison # below trivially pass, so the script printed a warning and then installed an # unverified binary as root. shasum ships with macOS and sha256sum with every # mainstream Linux, so reaching this branch is genuinely anomalous. echo "Error: no SHA256 tool (shasum/sha256sum) found — refusing to install" echo " an unverified binary. Install one, or use the notarized .pkg." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi if [ "$EXPECTED" != "$ACTUAL" ]; then echo "Error: checksum mismatch!" echo " Expected: $EXPECTED" echo " Got: $ACTUAL" rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi echo "Checksum verified (${CHECKSUM_SOURCE})." else echo "Error: the signed checksum file does not name v${VERSION}/quint-${OS}-${ARCH}.tar.gz." echo " A signed line naming another release, another asset, or (for a release after" echo " v${LEGACY_BARE_LINE_MAX_VERSION}) no release at all is a relabel, not this release's digest." echo " Refusing to trust a digest for some other artifact. Aborting." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi # SECOND FACTOR: the digest pinned in this script, for PINNED_VERSION only. It arrived # over TLS from a domain we control, independently of the mirror and of the release key, # so a signed-but-wrong artifact (a leaked key, an older build replayed into this prefix) # still has to match it. For any other version there is no pin; say so. PINNED="$(pinned_sha_for "$OS" "$ARCH")" if [ "$VERSION" = "$PINNED_VERSION" ] && [ -n "$PINNED" ]; then if [ "$PINNED" != "$ACTUAL" ]; then echo "Error: pinned checksum mismatch (pinned in installer for v${PINNED_VERSION})!" echo " Expected: $PINNED" echo " Got: $ACTUAL" echo " A correctly signed download that does not match this installer's pin is still refused." rm -f "${TARBALL_PATH}" "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" exit 1 fi echo "Checksum matches the digest pinned in this installer (v${PINNED_VERSION})." else echo "Warning: no pinned checksum for v${VERSION} ${OS}/${ARCH} in this installer; the" echo " Ed25519 release signature is the only authenticity check for this download." fi rm -f "${CHECKSUM_PATH}" "${SIGNATURE_PATH}" # EXTRACT INTO THE PRIVATE STAGING DIR, NOT /tmp. # # The archive was unpacked into world-writable /tmp and the members were then tested with `[ -f ... ]` # and `mv`'d to /usr/local/bin as root. `[ -f ]` follows symlinks and `mv` moves the link's target, so # a planted name is a candidate path to root-owned content. macOS bsdtar happens to REPLACE a planted # symlink rather than write through it — measured — so the archive's own members destroy the plant, but # that is a property of the extractor and of this tarball's member list, not a guarantee. Staging in a # 0700 root-owned directory with an unguessable name removes the question instead of relying on it. tar xzf "${TARBALL_PATH}" -C "${STAGING_DIR}" # install_executable SRC DEST: put an executable at DEST by RENAME from a temp file in # DEST's own directory, the same helper deploy/install.sh uses. A plain `mv` from the # staging dir is a rename only when both sit on one filesystem; with a tmpfs /tmp (common # on Linux) it falls back to a copy, so DEST is briefly partial, and a copy onto an # existing Mach-O writes into the inode macOS keeps its signature on (review of #1010). # A DEST that is a symlink or a directory is refused. install_executable() { ie_src="$1" ie_dest="$2" if [ -L "$ie_dest" ] || [ -d "$ie_dest" ]; then echo "Error: $ie_dest is a symlink or a directory; refusing to install over it" return 1 fi IE_TMP="$(mktemp "$(dirname "$ie_dest")/.$(basename "$ie_dest").new.XXXXXX")" || { IE_TMP=""; return 1; } if cp "$ie_src" "$IE_TMP" && chmod 755 "$IE_TMP" && mv -f "$IE_TMP" "$ie_dest"; then IE_TMP="" return 0 fi rm -f "$IE_TMP" 2>/dev/null || true IE_TMP="" return 1 } # As of v1.1.1 the tarball contains TWO binaries: `quint` and `quint-hook`. # The legacy `quint-proxy` name is kept as a fallback so an older release still # installs. if [ -f "${STAGING_DIR}/quint" ]; then quint_src="${STAGING_DIR}/quint" elif [ -f "${STAGING_DIR}/quint-proxy" ]; then quint_src="${STAGING_DIR}/quint-proxy" else echo "Error: could not find quint binary in tarball" rm -f "${TARBALL_PATH}" exit 1 fi if ! install_executable "$quint_src" /usr/local/bin/quint; then echo "Error: could not install /usr/local/bin/quint; the previous binary, if any, is unchanged" rm -f "${TARBALL_PATH}" exit 1 fi # quint-hook records an agent's DECLARED tool calls, which is one half of the # divergence signal. `quint setup` writes a ~/.claude/settings.json hook entry # pointing at /usr/local/bin/quint-hook, so failing to install it leaves a config # referencing a binary that does not exist: the agent exec's it on every tool # call and fails silently, while the install looks successful. That is exactly # the bug the .pkg had before v1.1.1 — do not let this copy drift back into it. if [ -f "${STAGING_DIR}/quint-hook" ]; then # A failure stops the install, as it did before install_executable (a bare mv under # set -e): `quint setup` would otherwise write the hook entry for a binary a fresh # install does not have, the drift the paragraph above forbids (review of #1010). if ! install_executable "${STAGING_DIR}/quint-hook" /usr/local/bin/quint-hook; then echo "Error: could not install /usr/local/bin/quint-hook; stopping before setup writes a hook entry for it." echo " /usr/local/bin/quint is installed; any older quint-hook there is unchanged." exit 1 fi echo "Installed hook to /usr/local/bin/quint-hook" else # Not fatal: pre-v1.1.1 tarballs genuinely do not carry it, and the kernel and # proxy lanes still work. Say so plainly rather than implying full coverage. echo "Note: quint-hook not present in this tarball — declared-intent capture" echo " (the agent-side half of divergence) will be unavailable." fi rm -f "${TARBALL_PATH}" echo "Installed binary to /usr/local/bin/quint" # /opt/homebrew/bin: never write into it, and never delete from it; only say so. # # This used to copy the binary to /opt/homebrew/bin/quint "to avoid PATH shadowing". That # directory is owned by whoever installed Homebrew (measured: amerabbadi:admin 775), and # this script runs as root, so any path it wrote there could be a symlink that user (or # anything running as them, an agent included) planted: cp, chmod and mv all follow one, # into any file or directory on the machine. Reproduced in review of #1010 with the exact # block, and main's fixed-name `cp` had the same hole. deploy/install.sh never wrote there; # it warns (check_homebrew_shadow). # # The copy earlier runs left there now shadows the new /usr/local/bin/quint on a Homebrew # PATH. Round 2 of #1010 removed it as root when it was a regular file owned by root; the # next review showed that is still root acting inside a tree the Homebrew user controls: # that user can replace /opt/homebrew/bin with a symlink to /usr/local/bin, and the root # rm then deletes the sensor binary this script just installed (reproduced in a sandbox). # And `stat -f %u` does not exist on Linux, so the ownership test never passed there. So: # a warning, with the command for the user who owns the file. Behaviour tested by # TestHomebrewShadowIsOnlyWarnedAbout (cmd/proxy). warn_homebrew_shadow() { hb="${1:-/opt/homebrew/bin/quint}" if [ -e "$hb" ] || [ -L "$hb" ]; then echo "Warning: $hb comes before /usr/local/bin on a Homebrew PATH and may shadow the" echo " version you just installed (an earlier version of this installer put a copy" echo " there). If it is that old Quint copy, remove it as the user who owns it: rm $hb" echo " If it is another program (homebrew-core's quint is an unrelated tool), leave it:" echo " Quint's own is /usr/local/bin/quint" fi } warn_homebrew_shadow # --------------------------------------------------------------------------- # No local-monitoring check. Until 2026-10-15 this told macOS users that # installing /usr/local/lib/quint_monitor.dylib and re-running `quint setup` # would enable local monitoring. It could not: this installer installs the # release tarball, which is CGO_ENABLED=0 and so has no local monitor at all # (internal/monitor is cgo only), and no build ships the dylib. # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- # Delegate to quint setup (handles everything else) # --------------------------------------------------------------------------- # quint setup handles: # - CA certificate generation and system trust # - LaunchAgent for GUI app env vars # - PAC file generation (macOS sets no system proxy; setup removes the one # older builds set: internal/platform/systempac_darwin.go) # - User config directory (~/.quint/) and CA copy # - env.sh / env.fish with agent wrappers # - Shell profile injection (.zshrc, .bashrc, fish) # - /etc/quint/config.yaml with all required fields # - LaunchDaemon / systemd service install and start # - Daemon readiness check echo "" echo "Running quint setup ..." echo "" # The token goes to `quint setup` through the environment, not argv: an argument # is readable by every local user in `ps` for the whole install. (The binary has # read QUINT_DEPLOY_TOKEN since v1.1.22, the oldest release this script installs.) # # QUINT_TENANT_ORG_ID rides the same way. A release older than pin-at-bundle ignores # it, so the result is checked below rather than assumed. # # QUINT_LICENSE / QUINT_LICENSE_FILE are not named on this line: setup inherits them # exactly as sudo preserved them (unset stays unset), and naming them would only put # an empty QUINT_LICENSE= into the environment of every unlicensed install. A release # older than C19-04 ignores them, so that result is checked below too. QUINT_DEPLOY_TOKEN="$TOKEN" QUINT_TENANT_ORG_ID="$TENANT_ORG_ID" /usr/local/bin/quint setup --api-url "$API_URL" if [ -n "$TENANT_ORG_ID" ] && ! grep -q '^tenant_pin_org_id:' /etc/quint/config.yaml 2>/dev/null; then echo "Warning: /etc/quint/config.yaml has no tenant_pin_org_id: this quint release does not read" echo " QUINT_TENANT_ORG_ID, so the host runs unpinned until it is upgraded and re-run." fi if [ -n "${QUINT_LICENSE:-}${QUINT_LICENSE_FILE:-}" ] && ! grep -q '^license:' /etc/quint/config.yaml 2>/dev/null; then echo "Warning: /etc/quint/config.yaml has no license: this quint release does not read" echo " QUINT_LICENSE, so the host runs unlicensed until it is upgraded and re-run." fi # Data-capture notice. THIS script is the one get.quintai.dev serves, so this is # the only disclosure a curl|sh installer ever sees — deploy/install.sh having # it is not enough, and this pair has drifted twice before (scripts/check-installers.sh). # # The text lives in the binary so there is one copy; older released binaries do # not know the flag, so fall back rather than dumping a flag-parser usage block # where the notice should be. if ! /usr/local/bin/quint onboard --print-disclosure 2>/dev/null; then echo "" echo " NOTICE: Quint records the text of your AI-agent prompts, the contents" echo " of files agents read, and the output of commands they run, and uploads" echo " them to Quint's cloud. Run 'quint onboard --print-disclosure' for the" echo " full notice and how to turn capture off." echo "" fi # --------------------------------------------------------------------------- # Verify # --------------------------------------------------------------------------- echo "" if /usr/local/bin/quint version >/dev/null 2>&1; then INSTALLED_VERSION="$(/usr/local/bin/quint version 2>/dev/null || echo "v${VERSION}")" echo "Quint Agent installed successfully! (${INSTALLED_VERSION})" echo "" echo " Binary: /usr/local/bin/quint" echo " Verify: quint status (and 'quint doctor' for CA/trust state)" echo " Logs: /var/log/quint/agent.log" echo "" if [ "$OS" = "darwin" ]; then echo " No system proxy is set: agents reach Quint through their own proxy settings." echo " No shell wrappers and nothing to eval. Open a new terminal, then run 'quint status'." else echo " Traffic routing is system-wide via the PAC file — no shell wrappers" echo " and nothing to eval. Open a new terminal, then run 'quint status'." fi else echo "Warning: 'quint version' check failed, but the binary was installed." echo "Check logs at /var/log/quint/quint.log for details (agent.err for a crash)." exit 1 fi