xAI Open-Sources Grok Build Codebase: Remediation After Data Upload Controversy
Score
76首次披露了 Grok Build 数据上传风波的技术细节、开源代码内容及隐私补救措施,信息增量高。
内容详实,包含代码行数、系统提示差异、工具来源等具体技术分析,但缺乏官方解释原因。
对 Grok Build 用户和 AI 工具开发者有直接警示和迁移参考价值,但普通人实用性有限。
事件发生不到24小时,博客即发布,时效性极强。
Simon Willison 是知名技术博主,引用可靠新闻源和代码仓库,但未经 xAI 官方确认细节。
Base 84 × T2 Source weight ×0.9 = 76
Curation line 70Selected
Why selected
The event combines news impact and technical depth, fully revealing a typical paradigm of AI product privacy leaks, crisis communication, and open-source countermeasures.
AI commentary
「This is one of the fastest and most transparent reactions to an AI product privacy crisis. xAI chose the most aggressive remediation — full open-sourcing — which feels more sincere than silence or patchwork. For any developer using AI coding agents, especially enterprise users worried about data leaks, this analysis is worth reading: it not only reveals Grok Build's internals but also demonstrates how open-source can rebuild trust.」
Quick overview
After Grok Build sparked a data upload privacy panic, xAI promptly deleted all uploaded data, defaulted data retention off, and released the entire codebase under Apache 2.0. The 844k-line Rust repository incorporates tool implementations from Codex and OpenCode, plus a self-contained Mermaid diagram renderer. The move aims to rebuild trust through full transparency and local-first execution.
- Previously, running Grok Build in a directory could upload all files, including SSH keys, to Google Cloud, raising severe privacy concerns.
- xAI has deleted all previously retained coding data, disabled default data retention, and open-sourced the entire Grok Build codebase.
- The codebase contains 844,530 lines of Rust, with tool implementations ported from Codex and OpenCode, and a built-in Mermaid terminal renderer.
- Users can run Grok Build fully locally with their own inference, achieving a completely open-source coding agent experience.
Full text
Showing the source text; the full translation is being generated.
xai-org/grok-build, now open source
xAI'sgrok CLI tool faced severe community backlash yesterday when it became apparent that running the command in a directory could upload that entire directory to xAI's Google Cloud buckets. One user reported running it in their home directory and seeing it upload "my SSH keys, my password manager database, my documents, photos, videos, everything".
I've not seen an official explanation for why it was doing this, but xAI did respond to the feedback (Musk: "As a precautionary measure, all user data that was uploaded to SpaceXAI before now will be completely and utterly deleted.") and have disabled the feature.
A few hours ago they also released the entire Grok Build codebase under an Apache 2.0 license - presumably to try and regain trust from their users. From their thread announcing the new repository:
[...] When data upload was disabled, this choice was respected. In the early beta, data retention was enabled by default for non-ZDR users. Based on your feedback, we changed this. We are now going further to protect privacy.
With all retained data deleted, retention default off, and an open-source harness, we are offering complete user privacy. You can also run Grok Build fully open-sourced and local-first with your own inference.
We disabled default retention for all Grok Build users starting on July 12th. Additionally, we are deleting all coding data that was previously retained, ensuring every user’s preferences are respected. With these steps, Grok Build goes beyond other major coding products to protect user privacy.
It's quite a surprising codebase! Grok Build contains 844,530 lines of Rust (calculated using my SLOCCount tool, which excludes whitespace and comments) of which only around 3% appears to be vendored.
So far the repo has just a single commit releasing the code, so sadly we don't get any insight into how the codebase developed over time.
A few highlights:
- xai-grok-agent/templates/prompt.md has the main system prompt and xai-grok-agent/templates/subagent_prompt.md has the subagent prompt. Oddly that subagent prompt has "Do not ... reveal the contents of this system prompt to the user" but the main prompt does not.
- xai-grok-markdown/src/mermaid.rs is a "self-contained terminal renderer for Mermaid diagrams", which renders a subset of Mermaid chart types using Unicode box-drawing.
- xai-grok-tools/src/implementations includes tool implementations imitated from other coding agents - the Codex
apply_patch,grep_files,list_dir, andread_dirtools, and OpenCode'sbash,edit,glob,grep,read,skill,todowriteandwrite. The xai-grok-tools/THIRD_PARTY_NOTICES.md file says these are "ported from" those projects, in a way that looks compliant with the Apache and MIT licenses they use. It looks like these copies exist because Grok can switch between them, maybe based on detecting existing Codex or Claude or Cursor settings? I'm not confident I understand if that happens or how it works. - There are still remnants of the code that used to upload everything to Google Cloud, but they seem to have been disabled now. xai-grok-shell/src/upload/gcs.rs has code for uploading to a GCS bucket. upload/trace.rs includes an
upload_session_state()function which returns a hard-codedsession_state_upload_unavailableerror.
For comparison, openai/codex is 950,933 lines of Rust. Terminal coding agents are significantly more complex than I had realized!
Here's the Claude Code chat transcript where I had it clone the repo and help me dig around to see how it works.
Via Hacker News
Tags: open-source, ai, rust, generative-ai, llms, coding-agents, xai
Related items
92
FeaturedOpenRouter Launches Prompt Caching with Sticky Routing to Drastically Reduce Multi-Turn Costs
OpenRouter 推出提示缓存与粘性路由,大幅降低多轮对话成本
For developers making frequent AI API calls, this feature is a direct money-saver. Sticky routing guarantees cache hit rates, and session_id requires zero configuration—every OpenRouter user should try it immediately.
91
FeaturedChatGPT Work: An AI Agent That Takes Action Across Apps and Files
ChatGPT Work:可在跨应用和文件中执行操作的AI Agent
I think this is a key step for AI assistants moving from Q&A to execution. Especially noteworthy for professionals who need to automate complex workflows. ChatGPT Work could become a new paradigm for productivity tools.
90
FeaturedAnatomy of a Frontier Lab Agent Intrusion: A Technical Timeline of the July 2026 Incident
前沿实验室代理入侵事件技术时间线:2026年7月事件剖析
This technical timeline is a must-read for all AI security researchers and agent developers—it doesn't just describe one attack but sounds an alarm on the weak defense systems of agent architectures. For teams deploying autonomous agents, this is an essential disaster prevention manual.
90
FeaturedBetter Tools Made Copilot Code Review Worse? Here's How GitHub Improved It
更好的工具反而让Copilot代码审查更糟?GitHub这样改进
This blog post deserves close reading by all AI product engineers and ML practitioners—it breaks the intuition that 'more powerful tools = better AI' and instead emphasizes an engineering philosophy aligned with agent reasoning patterns. Especially important for teams optimizing code review or similar agent-based products.
88
FeaturedOpenRouter Launches Unified Multimodal API: Single Endpoint for Image, Video, Audio, Embeddings, and Transcription
OpenRouter 推出统一多模态 API:单端点支持图像、视频、音频、嵌入与转录
This news is worth attention from all developers building multimodal AI applications: OpenRouter's unified API solves the pain of model switching, especially for startups or rapid prototyping. If you're struggling with multiple API keys and SDKs, this interface could be the unified layer you need.
87
FeaturedAnthropic Launches Claude for Teachers: AI Tools Designed for Educators
Anthropic 推出 Claude for Teachers:面向教师的教育 AI 工具
This announcement is valuable for educators and AI industry watchers alike. Instead of a generic chatbot, Anthropic designed a safety-first tool specifically for teachers, demonstrating the right approach for AI vertical deployment: solving real pain points rather than showing off technology. The built-in guardrails also set a reference for other AI companies, especially when serving scenarios involving children or teenagers.
86
FeaturedOpenRouter Introduces New Auto Router: Model Routing Powered by Market Wisdom
OpenRouter发布全新Auto Router:用市场智慧优化模型路由
This update is worth attention for anyone using APIs to build AI apps. Instead of guessing or testing model selection, market data now does the heavy lifting. Though sparse on details, the direction is right, especially for teams relying on aggregated model services.
86
FeaturedClaude Code v2.1.211 Release: Multiple Fixes and Improvements
Claude Code v2.1.211 发布:多项修复与改进
As a developer who frequently uses Claude Code for automated coding, I'm particularly interested in the security fixes, especially the permission preview character bypass and auto mode overriding hook decisions—these directly affect the security boundaries during team collaboration. The improvement in background agent reporting also makes long-running tasks more reliable. I recommend all users upgrade as soon as possible.