You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review hardening for #404 (thanks Codex + two deep review passes):
- tmpfs over ~/.grok/bin and ~/.grok/downloads whenever a host dir is
mounted at /home/deva/.grok. Reproduced against real 0.2.93: a mounted
config.toml without postinstall's `[cli] installer = "npm"` marker
flips the updater to installer=internal, and `grok update` re-creates
both dirs ON THE HOST MOUNT — a Linux binary that shadows a macOS
host CLI via the host npm trampoline. Updater writes now die with
the container; verified live (mount stack + host-side clean).
- api-key mode mounts no ~/.grok, per the #403 spec. grok credential
priority is model.api_key > model.env_key > session token >
XAI_API_KEY, so anything a mounted config carries can outrank — and
bill instead of — the exported key. Blank auth.json overlay kept as
defense for explicit -v mounts.
- docker-entrypoint.sh: grok version header, verbose diagnostics, and
binary presence check (#403 scope, was missing).
- test-mount-shape.sh: grok in hybrid/default loops; new assertions for
the update guard and api-key no-mount.
- docs/authentication.md, CHANGELOG, DEV-LOGS: correct the false
"grok update is a no-op" claim; document the real behavior.
Refs #403
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: DEV-LOGS.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,12 @@
17
17
- Why: xAI shipped an official coding-agent CLI (x.ai/cli, npm @xai-official/grok); deva should launch it like claude/codex/gemini. Not to be confused with community superagent-ai/grok-cli (npm grok-dev) — different product, same bin name.
18
18
- What:
19
19
- agents/grok.sh: oauth default (mount ~/.grok) + api-key (XAI_API_KEY); appends --always-approve (grok's bypassPermissions alias) since the container is the sandbox
20
-
- deva.sh: canonical entry .grok, autolink ~/.grok, XAI_API_KEY env handling, blank-overlay /home/deva/.grok/auth.json for api-key mode (grok prefers session token over env key — overlay makes the key actually win)
20
+
- deva.sh: canonical entry .grok, autolink ~/.grok, XAI_API_KEY env handling. api-key mode mounts NO ~/.grok (grok credential priority: model.api_key > model.env_key > session token > XAI_API_KEY — anything a mounted config carries can outrank the exported key; per #403 spec and Codex review). Blank auth.json overlay kept as defense for explicit -v mounts
21
21
- install-agent-tooling.sh pin_grok_platform_binary: grok's npm bin is a trampoline that resolves ~/.grok/bin/grok FIRST, and postinstall parks the ~125MB real binary there (self-update dir); a host mount would shadow it (macOS binary -> exec format error). Move the binary to ~/.local/bin, repoint the npm bin, rm ~/.grok/bin
- Result: deva.sh grok works with both auth modes (dry-run verified: mount + env + overlay wiring); grok pinned at 0.2.93; make versions-up picks up new upstream releases
22
+
- deva.sh append_grok_update_guard: the reverse hole, found in review and reproduced against the real 0.2.93 — a mounted config.toml without the postinstall's `[cli] installer = "npm"` marker flips the updater to installer=internal, and `grok update` re-creates ~/.grok/bin + ~/.grok/downloads ON THE HOST MOUNT (Linux binary shadows a macOS host CLI via the host trampoline). Fix: tmpfs over both dirs whenever a host dir lands at /home/deva/.grok; updater writes die with the container
23
+
- docker-entrypoint.sh: grok version header, verbose diagnostics, ensure_agent_binaries
- Result: deva.sh grok works with both auth modes (dry-run + mount-shape verified); grok pinned at 0.2.93; make versions-up picks up new upstream releases; host ~/.grok cannot be poisoned by in-container updates (tmpfs guard verified live: uid/gid/mode/size + noexec)
24
26
25
27
# [2026-07-07] Dev Log: switch --trace default from claude-trace to cctrace
26
28
- Why: claude-trace's node --require fetch hook only sees /v1/messages and dies on native Claude binaries; cctrace (thevibeworks/cctrace) MITM-captures everything (OAuth, usage/credits, MCP) and auto-detects npm vs native installs
0 commit comments