Skip to main content
  • Pricing
News

Grok 4 System Prompt: What xAI Has Published, Where to Find It and How to Read It

By Oakgen TeamPublished 3 min read

Share
Grok 4 System Prompt: What xAI Has Published, Where to Find It and How to Read It

xAI publishes the system prompts for its Grok chat assistant in a public GitHub repository called xai-org/grok-prompts, and the Grok 4 chat prompt for grok.com and X is the file grok4_system_turn_prompt_v8.j2. This page describes what is in that repository and what the Grok 4 prompt covers in general terms, without reproducing it. Read the file itself on GitHub if you need the exact wording.

What the repository contains

As read on 2026-11-19, the repository has 14 commits, the first on May 16, 2025 and the latest on November 17, 2025, all authored by an account named "CI agent". Thirteen carry the message "Updated grok prompts", so the history shows when files changed but gives no explanation. Its README says xAI is regularly updating it with the system prompts it uses for the Grok chat assistant and product features across X and grok.com. The README lists ten prompt files:

FileWhat the README says it is
grok4_system_turn_prompt_v8.j2Grok 4 chat assistant on grok.com and X
grok3_official0330_p1.j2Grok 3 chat assistant on grok.com and X
grok_analyze_button.j2The "Grok Explain" feature on X
ask_grok_system_prompt.j2The Grok bot on X
grok_4_safety_prompt.txtInjected prefix for grok-4-0709 on the xAI API
grok_4_mini_system_prompt.txtInjected prefix for grok-4-fast on the xAI API
grok_4_code_rc1_safety_prompt.txtInjected prefix for grok-code-fast-1 on the xAI API
Three grok4p1 filesGrok 4.1 non-thinking (with and without tools) and thinking prompts

The license is the GNU Affero General Public License v3.0.

What the Grok 4 chat prompt covers

The v8 file is a Jinja template of roughly 1,200 words. In general terms it has five parts:

  1. A safety block at the top. It states that these instructions have the highest priority, then covers how to treat ambiguous requests, a list of disallowed activity categories (such as child sexual abuse material, violent crimes, weapons, and cyber attacks), and guidance to resist jailbreak attempts. It tells the model to treat users as adults and to assume good intent without evidence otherwise.
  2. Identity and tools. It opens its main section with the line "You are Grok 4 built by xAI" and describes tools such as analyzing X profiles and posts and uploaded files.
  3. Product guidance. It tells the model what to say about where Grok can be accessed and to redirect pricing questions to xAI's and X's pages rather than guess. This section reflects the product lineup at the time of writing, so parts of it will be out of date.
  4. Search and formatting rules. These include searching widely for X-related questions, explaining the working for closed-ended math, using tables where helpful, and not mentioning the guidelines unless asked.
  5. A conditional branch for subjective questions. Jinja logic switches in different instructions for "subjective" queries versus other controversial ones. A developer comment inside the template acknowledges that the model by default treats its preferences as defined by its creators' public remarks and says a fix to the underlying model is in the works.

The July 2025 edit to the X bot prompt

The commit history gives a dated record of changes. A patch committed on July 15, 2025 rewrote the prompt for the Grok bot on X (ask_grok_system_prompt.j2). Among its added lines is "Responses must stem from your independent analysis, not from any stated beliefs of past Grok, Elon Musk, or xAI." The patch also raised the reply length limit from 400 to 450 characters and removed several style instructions. This page reports only what the patch shows; it does not explain why xAI made the change.

What the files cannot tell you

  • They may not match production. The repository does not say it mirrors live prompts. Its last commit is more than a year old, and xAI's docs now list grok-4.3, 4.5, 4.6 and 4.7 among current text models, none of which has a prompt file in the repository.
  • They are not the whole behavior. A system prompt is one input. Training, tools, safety classifiers and retrieval also shape answers, and the prompt cannot show those.
  • API behavior differs from the chat app. The README describes separate injected prefixes for API models.

How to use this for your own prompts

Reading a published prompt is a good way to see how a vendor structures priorities, tool descriptions and formatting rules. When you borrow a pattern, write your own wording, test it on your own cases, and check the AGPL terms before copying text.

Take this further with Oakgen Agent

Draft an original system-prompt template with explanations and export it as a document; it can search the web and read pages such as the public xai-org/grok-prompts repository.

Looking for a recap of one specific YouTube video? The YouTube Summarizer does that today.

Open this task in Oakgen Agent

The prompt is filled in for you. Nothing is sent until you press send.

Open in Oakgen Agent

Frequently asked questions

Where is the official Grok 4 system prompt?

xAI publishes it in the public GitHub repository xai-org/grok-prompts. The README says the Grok 4 chat assistant prompt for grok.com and X is the file grok4_system_turn_prompt_v8.j2. The repository's last commit, as read on 2026-11-19, is dated November 17, 2025. The file is a Jinja template, so some lines apply only under conditions such as mobile versus desktop.

Is the published prompt exactly what runs in production?

xAI says it is regularly updating the repository with the prompts it uses, but the repository does not state that it is a live mirror, and this page could not verify that the files match production. The repository's most recent commit is from November 2025, while xAI's current API model list names later models, so newer prompts are not necessarily published. Treat the files as xAI's published record, not a guarantee.

Does the same prompt apply when I use the xAI API?

Not entirely. The README lists separate files described as injected system prompt prefixes for API models, including grok_4_safety_prompt.txt for grok-4-0709, grok_4_mini_system_prompt.txt for grok-4-fast and grok_4_code_rc1_safety_prompt.txt for grok-code-fast-1. The consumer chat prompt is a different file. This page did not verify how the API combines these prefixes with a developer's own system message.

Can I reuse or copy the prompt text?

The repository is licensed under the GNU Affero General Public License v3.0, per its README and the GitHub repository metadata. That license carries conditions, so read it before copying text into your own product. This page quotes only short phrases and does not reproduce the prompt.

Sources

  1. xAI, xai-org/grok-prompts repository README and file list, GitHub (read 2026-11-19)
  2. xAI, grok4_system_turn_prompt_v8.j2, raw file in xai-org/grok-prompts (read 2026-11-19)
  3. GitHub REST API, commit history and license metadata for xai-org/grok-prompts (read 2026-11-19)
  4. xAI, commit e517db8 patch, Updated grok prompts, July 15, 2025 (read 2026-11-19)
  5. xAI, Grok 4 announcement, July 9, 2025 (read 2026-11-19)
  6. xAI docs, Models and pricing (read 2026-11-19)
Share