Skip to content

Instantly share code, notes, and snippets.

@daniel-farina
Created May 21, 2026 01:26
Show Gist options
  • Select an option

  • Save daniel-farina/26d833652765513e8a2ce4508c5c3997 to your computer and use it in GitHub Desktop.

Select an option

Save daniel-farina/26d833652765513e8a2ce4508c5c3997 to your computer and use it in GitHub Desktop.
Grok CLI 0.1.212 (darwin-aarch64) fails to launch on macOS 15.7.7 - kernel rejects code signature (load code signature error 2)

Grok CLI 0.1.212 (darwin-aarch64) fails to launch on macOS 15.7.7 - kernel rejects code signature (load code signature error 2)

Summary

The darwin-aarch64 build of the Grok CLI installed by https://x.ai/cli/install.sh is killed by the kernel immediately on launch on macOS 15.7.7 (Sequoia, Apple Silicon). Every invocation - including the grok completions {bash,zsh,fish} calls the installer makes at the end - dies with Killed: 9 before any user code runs. The same happens when invoking grok directly.

Userspace tools say the signature is fine (codesign --verify passes; signed by X.AI Corporation / Team 5Y6N3AJ54S). But the kernel refuses to load the binary, logging load code signature error 2 for every exec attempt. This strongly suggests the binary was signed using a code-signature format produced by the macOS 26 SDK / toolchain that the macOS 15 kernel does not accept, even though LC_BUILD_VERSION advertises minos 11.0.

Environment

  • macOS: 15.7.7 (build 24G720), Darwin 24.6.0
  • Architecture: Apple Silicon (arm64)
  • Shell: zsh
  • Grok CLI: 0.1.212 (macos-aarch64, auth.json (oidc))
  • Install command: curl -fsSL https://x.ai/cli/install.sh | bash

Repro

curl -fsSL https://x.ai/cli/install.sh | bash
grok

Installer output

Auth: using OIDC token from ~/.grok/auth.json.
Fetching latest stable version...
Installing Grok 0.1.212 (macos-aarch64, auth.json (oidc))...
  Downloading grok 0.1.212...
  Binary linked to /Users/web/.grok/bin/grok and /Users/web/.grok/bin/agent.
bash: line 262: 59487 Killed: 9               "$BIN_DIR/grok" completions bash > "$HOME/.grok/completions/bash/grok.bash" 2> /dev/null
bash: line 263: 59488 Killed: 9               "$BIN_DIR/grok" completions zsh > "$HOME/.grok/completions/zsh/_grok" 2> /dev/null
bash: line 267: 59490 Killed: 9               "$BIN_DIR/grok" completions fish > "$HOME/.config/fish/completions/grok.fish" 2> /dev/null
Grok 0.1.212 installed to /Users/web/.grok/bin/grok

Run 'grok' or 'agent' to get started!

Launching grok

$ grok
[1]    59567 killed     grok

Exits instantly. No stdout, no stderr, no log files written under ~/.grok/.

Diagnostics

Installed layout

$ ls -la ~/.grok/bin/
lrwxr-xr-x  1 web  staff  31 May 20 21:22 agent -> ../downloads/grok-macos-aarch64
lrwxr-xr-x  1 web  staff  31 May 20 21:22 grok  -> ../downloads/grok-macos-aarch64

Quarantine attribute - none

$ xattr -l ~/.grok/bin/grok
(no output)

So Gatekeeper quarantine is not the cause.

file and codesign -dv

$ file ~/.grok/bin/grok
/Users/web/.grok/bin/grok: Mach-O 64-bit executable arm64

$ codesign -dv ~/.grok/bin/grok
Executable=/Users/web/.grok/downloads/grok-macos-aarch64
Identifier=xai-grok-pager
Format=Mach-O thin (arm64)
CodeDirectory v=20500 size=179290 flags=0x10000(runtime) hashes=5597+2 location=embedded
Signature size=8983
Timestamp=May 18, 2026 at 2:37:57 PM
Info.plist=not bound
TeamIdentifier=5Y6N3AJ54S
Runtime Version=26.1.0
Sealed Resources=none
Internal requirements count=1 size=176

Note Runtime Version=26.1.0 - hardened runtime version corresponding to the macOS 26.1 SDK.

codesign --verify and spctl

$ codesign --verify --verbose ~/.grok/bin/grok
/Users/web/.grok/bin/grok: valid on disk
/Users/web/.grok/bin/grok: satisfies its Designated Requirement

$ spctl -a -vv ~/.grok/bin/grok
/Users/web/.grok/bin/grok: rejected (the code is valid but does not seem to be an app)
origin=Developer ID Application: X.AI Corporation (5Y6N3AJ54S)

spctl "rejected ... not an app" is expected for a bare CLI binary and is not what's killing the process.

Mach-O load commands - minimum OS

$ otool -l ~/.grok/bin/grok | grep -A4 LC_BUILD_VERSION
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 11.0
      sdk 26.1

$ vtool -show ~/.grok/bin/grok
...
Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 11.0
      sdk 26.1
   ntools 1
     tool LD
  version 1230.1

So minos = 11.0 (advertised compatible with macOS 11+) but built/linked with sdk = 26.1 and the linker (LD 1230.1) shipped with that toolchain.

Kernel log - the actual cause

log show --predicate 'eventMessage CONTAINS "grok"' --last 10m (relevant lines):

2026-05-20 21:22:29.290616-0400  kernel: proc 59278: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:29.292978-0400  kernel: grok-macos-aarch64[59278] Corpse allowed 1 of 5
2026-05-20 21:22:29.293921-0400  kernel: proc 59279: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:29.294194-0400  kernel: grok-macos-aarch64[59279] Corpse allowed 2 of 5
2026-05-20 21:22:29.297344-0400  kernel: proc 59282: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:29.297531-0400  kernel: grok-macos-aarch64[59282] Corpse allowed 3 of 5
2026-05-20 21:22:39.515613-0400  ReportCrash: ASI found [ReportCrash] (sensitive) 'Pid 59279 'grok-macos-aarch' CORPSE: Extracting
Pid 59278 'grok-macos-aarch' CORPSE: Extracting
Pid 59282 'grok-macos-aarch' CORPSE: Extracting'
2026-05-20 21:22:44.250986-0400  kernel: proc 59369: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:49.954073-0400  kernel: proc 59487: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:49.957010-0400  kernel: proc 59488: load code signature error 2 for file "grok-macos-aarch64"
2026-05-20 21:22:49.959900-0400  kernel: proc 59490: load code signature error 2 for file "grok-macos-aarch64"

Every exec produces load code signature error 2 from the kernel, and the process is killed before its code ever runs. That is consistent with the kernel's signature loader (AMFI / csops) rejecting the embedded code signature format itself - not with a content/hash mismatch, and not with quarantine/Gatekeeper.

Likely cause

The binary is signed using code-signature features produced by the macOS 26 SDK / codesign toolchain (note CodeDirectory v=20500, Runtime Version=26.1.0, linker LD 1230.1). The macOS 15 kernel rejects that signature blob at load time, even though:

  • userspace codesign --verify says it's valid,
  • LC_BUILD_VERSION advertises minos 11.0,
  • there is no quarantine attribute.

This effectively makes the darwin-aarch64 build of grok 0.1.212 unrunnable on every macOS version below 26 (Tahoe), despite the install script happily installing it on those systems.

Impact

  • All current Apple Silicon Macs that have not upgraded to macOS 26 (Tahoe) - which is the large majority right now - cannot run the installed grok CLI at all.
  • The install script silently "succeeds" (the binary lands on disk, symlinks are created) but grok immediately dies with Killed: 9, which is confusing to debug for end users because there is no error message and codesign/xattr look clean.
  • The install script's own post-install grok completions ... invocations also fail and surface as Killed: 9 lines mid-install, further muddying the user experience.

Suggested fixes for xAI

  1. Build/sign the darwin-aarch64 release artifact with an older SDK + codesign toolchain (e.g. macOS 15 / Xcode 16) so the resulting code signature is loadable by macOS 11-26 kernels, matching the advertised minos 11.0.
  2. Have the installer detect macOS version and refuse to install (with a clear error) when the host kernel cannot load the artifact's signature, instead of silently leaving a broken binary on disk.
  3. Have the installer at least surface the post-install grok completions failures, rather than redirecting their stderr to /dev/null, so the failure mode is visible.

Workarounds tried / suggested

  • Removing quarantine - N/A, no quarantine attribute is present.
  • spctl --add / right-click "Open" - N/A, the rejection is by the kernel signature loader, not Gatekeeper.
  • Strip + ad-hoc re-sign (codesign --remove-signature then codesign -s - --force --options runtime) - may work around the signature-format rejection but voids the Developer ID identity and may still fail if hardened-runtime entitlements depend on the original cert.
  • Install an older Grok CLI version - if a pre-0.1.212 build was signed with an older toolchain, it may run. The installer currently only fetches "latest stable", so this isn't a first-class option.
  • Upgrade to macOS 26 (Tahoe) - works but is a heavy-handed requirement that isn't documented anywhere in the install flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment