xAI open-sources Grok Build after a directory-upload scandal — what its 844K lines teach agent builders
On July 15, 2026, xAI open-sourced grok-build, its Rust CLI coding agent, under Apache 2.0 — days after users found running it uploaded their entire working directory to xAI's cloud buckets. The now-readable system prompts and tool implementations are a reference for anyone building a coding harness. Here's what changed and the trust lesson.
xAI open-sourced grok-build, its command-line coding agent, on July 15, 2026 under the Apache 2.0 license. The repository (xai-org/grok-build) is described as “SpaceXAI’s coding agent harness and TUI.” (Source: xai-org/grok-build)
Key facts:
- grok-build is written in Rust, roughly 844,530 lines of code, of which only ~3% is vendored dependencies. (Source: Simon Willison)
- License is Apache 2.0. (Source: xai-org/grok-build)
- The open-source move followed a privacy incident: running the CLI in a directory automatically uploaded that entire directory to xAI’s Google Cloud buckets. (Source: Simon Willison)
- xAI disabled the upload and says the data was deleted; the GCS code remains but now returns
session_state_upload_unavailable. (Source: Simon Willison) - The repo includes the agent’s system prompts, sub-agent prompts, and tool implementations. (Source: Simon Willison)
The scandal is the reason the code is public. One user reported that running grok-build in their home directory uploaded “my SSH keys, my password manager database, my documents, photos, videos, everything.” Elon Musk stated that all previously uploaded user data would be “completely and utterly deleted,” and xAI open-sourced the harness to rebuild trust. (Source: Simon Willison)
What this means if you’re building a coding agent
Set the privacy story aside and there’s real reference value here. Grok-build is one of very few frontier-lab coding harnesses you can read end to end:
- The system prompts are readable. How xAI instructs its main agent and sub-agents is now inspectable — useful if you’re tuning your own orchestration prompts.
- The tool implementations are ported from rivals. Simon Willison notes tools ported from Codex, OpenAI and Claude/Cursor, so the repo doubles as a cross-reference of how different harnesses define edit/read/shell tools. (Source: Simon Willison)
- It’s a Rust TUI reference. At ~844K lines it includes touches like a self-contained terminal renderer for Mermaid diagrams using Unicode box-drawing characters — grok-mermaid. (Source: Simon Willison)
The harder lesson is operational: a coding CLI runs with your full filesystem permissions. This incident is a live case for auditing what any agent tool does before you run it in a real project — check for silent network calls, and prefer harnesses where sub-agent behavior stays inspectable locally. That’s a recurring theme in our own tooling coverage — see our take on making a coding agent your daily driver and our Claude Code vs Codex head-to-head, where auditability was a deciding factor.
Sources
Source: Simon Willison