What xAI's Grok build CLI sends to xAI: A wire-level analysis
TL;DR Highlight
Grok Build CLI uploaded entire repos to xAI, including files the agent never read
Who Should Read
A developer weighing security and privacy before running an AI coding CLI on a company codebase
Core Mechanics
- Files it reads go out verbatim, even .env
- Contents of files the agent read appeared verbatim in the POST /v1/responses body.
- The same content was also packed into a session_state archive uploaded via POST /v1/storage and accepted with HTTP 200.
- Whole repo uploaded, even unread files
- With the prompt "reply OK, do not read any files", the entire repo still went up as a git bundle via POST /v1/storage (200).
- Cloning the bundle recovered the marker in src/_probe/never_read_canary.txt, a file the agent was told not to open, plus full git history (4 commits, 47 files).
- A second repo (cereblab_auth) gave the same result.
- 5.10 GiB out of a 12 GB repo, all 200
- On a 12 GB repo of never-read random files, /v1/storage carried 5.10 GiB in 73 chunks of ~75 MB with zero failures.
- Model turns (/v1/responses) in the same session were only 192 KB, a ~27,800x gap.
- The capture was stopped early, so completion of all 12 GB is not proven.
- Destination is the GCS bucket grok-code-session-traces
- The bucket name appears in binary strings and in staged metadata.json fileIds (gs://grok-code-session-traces/...).
- The author says it is Google Cloud Storage, not AWS S3.
- "Improve the model" off, upload still on
- After turning it off, /v1/settings still returned trace_upload_enabled: true.
- The author found no description of this upload in the install or quickstart materials (not an exhaustive docs audit).
- The author's limits and later updates
- The post does not prove xAI trains on the data, only transmission, acceptance and storage.
- Whether .gitignored files get uploaded was not tested.
- Update: xAI disabled the upload server-side (disable_codebase_upload: true), and the /privacy opt-out was found to be a retention setting, not a block on sending.
Community Reactions
- Env vars reported to switch it off
- One comment lists GROK_TELEMETRY_TRACE_UPLOAD=0 and GROK_TELEMETRY_ENABLED=0, or [harness] disable_codebase_upload = true in the config file, as mitigation.
- Experience sandboxing with bubblewrap
- One commenter restricts tools to the project dir with .git read-only and sensitive dirs mounted empty.
- Network goes through a Unix-socket HTTP proxy allowing only LLM provider hostnames, which makes yolo mode feel safer.
- Counterview: agents reading the workspace is expected
- Some comments argue reading .env is intended behavior and agents should be isolated from real secrets.
- Several commenters still agree that auto-uploading the whole repo, especially multi-GB, is strange.
- Concern that an AI-written report needs verification
- One comment says it cannot rule out hallucination until someone else reproduces the findings.
- Others ask how Codex, Claude Code and Cursor compare.
How to Apply
- Set env vars to turn off Grok CLI uploads
- Today, export GROK_TELEMETRY_TRACE_UPLOAD=0 and GROK_TELEMETRY_ENABLED=0 in the shell profile where you run Grok Build.
- Also add the config value from the comments ([harness] disable_codebase_upload = true).
- Run coding agents inside a sandbox
- Use bubblewrap or a container to limit reads to the working directory.
- Route network through a proxy that allows only LLM provider hosts.
- Keep .env files with real secrets out of the repo
- Do not leave a .env with real keys in a directory where you run an AI CLI.
- Keep only dummy values there and inject real secrets from outside the repo.
- Check any new AI CLI's traffic with mitmproxy
- Before adopting a new AI CLI, make a throwaway repo with canary strings.
- Log host, path and byte size with mitmproxy and grep for the canaries.
Try It
# Paste into a terminal (macOS): simplified version of the original method. Plant canaries in a throwaway repo and inspect Grok traffic with mitmproxy
# Prereq: brew install mitmproxy, run mitmdump once to generate the CA in ~/.mitmproxy/
mkdir canary-repo && cd canary-repo && git init -q
echo 'API_KEY=CANARY-{{random-string}}-SECRET' > .env
echo 'CANARY-{{random-string}}-NEVERREAD' > never_read.txt
git add -A && git commit -qm init
security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db ~/.mitmproxy/mitmproxy-ca-cert.pem
mitmdump -p 8080 -w /tmp/grok.flows &
HTTPS_PROXY=http://127.0.0.1:8080 SSL_CERT_FILE=~/.mitmproxy/mitmproxy-ca-cert.pem grok -p "Reply exactly OK, do not read any files" --cwd .
kill %1
grep -ac 'CANARY-{{random-string}}' /tmp/grok.flowsTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques