What happened

xAI just open-sourced Grok Build, its terminal-based coding agent, after a privacy scandal forced the company's hand. Earlier this week, users discovered that running the Grok CLI tool in a directory could silently upload the entire contents of that folder to xAI's Google Cloud storage buckets. One developer reported that running the command in their home directory uploaded "my SSH keys, my password manager database, my documents, photos, videos, everything."

The backlash was immediate and severe. Elon Musk responded directly, stating: "As a precautionary measure, all user data that was uploaded to xAI before now will be completely and utterly deleted." xAI disabled the upload feature and, on July 15, 2026, released the entire Grok Build codebase under an Apache 2.0 license — a move widely seen as an attempt to rebuild trust with developers.

According to xAI's own thread announcing the repository, data retention was enabled by default for non-ZDR (zero data retention) users during the early beta. Following user feedback, the company disabled default retention for all Grok Build users starting July 12, 2026, and says it is now deleting all previously retained coding data.

The released codebase itself is enormous: 844,530 lines of Rust, measured using Simon Willison's SLOCCount tool, with only about 3% vendored from third parties. For comparison, OpenAI's competing Codex agent weighs in at 950,933 lines of Rust — a reminder that modern terminal coding agents have grown into genuinely massive software projects.

Why it matters

This episode is a wake-up call for anyone using AI coding assistants that run locally but talk to cloud infrastructure. Grok Build isn't a simple autocomplete tool — it's an agent with filesystem access, and until this week, part of that access path led straight to a Google Cloud bucket most users never knew existed.

Open-sourcing the code changes the trust equation. Anyone can now audit exactly what Grok Build does with local files instead of taking xAI's word for it. That audit already turned up interesting details: the file xai-grok-shell/src/upload/gcs.rs still contains code for uploading to a GCS bucket, and upload/trace.rs includes an upload_session_state() function that now just returns a hard-coded "unavailable" error rather than being deleted outright. The upload machinery is dormant, not removed.

The release also exposes how Grok Build actually works under the hood. Its main system prompt lives in xai-grok-agent/templates/prompt.md, and a separate subagent prompt in subagent_prompt.md instructs subagents not to reveal their own system prompt — an instruction curiously missing from the main prompt. The tools directory shows Grok borrowing implementations from rival agents: Codex-style apply_patch, grep_files, and list_dir tools sit alongside OpenCode-style bash, edit, glob, read, and write tools, all documented as "ported from" those open-source projects in a THIRD_PARTY_NOTICES.md file.

MyKreaTool AI chat — try ChatGPT, Claude and Gemini in one place. Free on MyKreaTool.Open the tool →

How to use it today

Developers who want to try Grok Build without the privacy concerns now have a real alternative: run it fully open-source and local-first, pointed at your own inference backend, so no code or file data ever leaves your machine. Because the entire 844,530-line codebase is public under Apache 2.0, you can inspect exactly which files a given command touches before you run it, rather than trusting a black box.

If you're technical, start by reading xai-grok-agent/templates/prompt.md to understand the agent's actual instructions, and check xai-grok-tools/src/implementations to see which borrowed tool set (Codex-style or OpenCode-style) is active in your setup. If you're less interested in wrangling Rust source code and just want to experiment with AI-assisted workflows without installing anything on your machine, browser-based tools are a lower-risk starting point — you can test AI capabilities using the free AI tools at mykreatool.com without ever exposing local files, SSH keys, or documents to a third-party cloud bucket.

Enterprises evaluating Grok Build for internal use should specifically confirm that the July 12, 2026 retention-off default applies to their account tier, and should not assume ZDR status without checking directly with xAI.

Who benefits

Security researchers and open-source auditors gain the most immediately — they can now pick apart nearly a million lines of code to verify xAI's privacy claims rather than relying on public statements. Enterprises weighing AI coding agents for regulated environments get a genuine local-first option, since Grok Build can now run entirely offline with custom inference. Competing AI labs and independent developers also benefit, since studying a production-grade 844,530-line terminal agent codebase is a rare look at how a major AI company actually built one of these tools. Everyday developers benefit from increased competitive pressure — this kind of scrutiny tends to push other coding-agent vendors (Codex, Claude Code, Cursor, and others) to be more transparent about their own data handling.

Risks

The core risk hasn't fully disappeared. The GCS upload code in gcs.rs is disabled, not deleted, which means a future update — intentional or accidental — could re-enable it. Users who ran Grok Build before July 12, 2026 should still verify with xAI that their previously uploaded data was actually purged, rather than assuming Musk's public statement covers every account.

There's also a broader lesson: this is the second major coding-agent tool in recent memory to be caught quietly moving local files to a vendor's cloud. Anyone running AI agents with filesystem access — from any vendor — should assume similar risks could exist elsewhere until proven otherwise, and should audit network activity or run agents in sandboxed environments where possible.

Conclusion

xAI's decision to open-source the full Grok Build codebase — all 844,530 lines of it — is a direct response to a serious privacy failure, and it gives developers real tools to verify the company's claims instead of just trusting them. The upload code is disabled but still present, retention is now off by default since July 12, 2026, and a local-first mode is available for anyone who wants zero cloud exposure. Whether this restores trust in Grok Build long-term will depend on what the community finds as it keeps digging through the code — and whether xAI keeps that promise going forward.