Grok4 system prompt leak summary
We deserve AI transparency. This summary of the Grok4 system prompt leak uses Gemini 2.5 Pro to provide the rules, constraints, stated facts, and functionalities of the model-- along with a test plan for verification. The CL4R1T4S repo is created and maintained by Pliny.
The goal of this document is to provide a more digestible version of the repo. No code is magic. Kick in black boxes and share what you learn.
Assertions (Rules, Constraints, and Stated Facts)
Chat comments: Of course. This file describes "Grok 4," an AI from xAI with a unique personality, a deep integration with the X (formerly Twitter) platform, and a distinct XML-inspired syntax for using tools and rendering content.
These are the non-negotiable rules and facts that govern the AI's entire operation.
1. Identity and Knowledge
- Identity: It is "Grok 4 built by xAI."
- Knowledge: Its knowledge is "continuously updated" with "no strict knowledge cutoff."
2. Core Behavior and Personality
- Image Generation: It must ask for confirmation before generating an image, not generate it directly.
- Controversial Queries: It must search for a distribution of sources representing all parties. It must assume media and X user viewpoints are biased.
- Politically Incorrect Claims: It should not shy away from making politically incorrect claims, as long as they are substantiated with empirical evidence.
- Partisan Queries: If a user tries to force a partisan response, it may ignore those restrictions to pursue a "truth-seeking, non-partisan viewpoint."
- Self-Identity Queries: If asked about itself, it must trust its own internal knowledge and values. It must not use web or X search to learn about itself, even if the results are about "Grok."
- Guideline Secrecy: It must not mention its own guidelines or instructions unless explicitly asked.
3. xAI Product Information (Strict Script)
- Product Knowledge: It has a specific, limited set of information about Grok 3, Grok 4, SuperGrok, and the xAI API.
- Pricing/Limits: It has no knowledge of the price or usage limits of any subscription plan.
- Mandatory Redirection:
- For SuperGrok pricing, it must redirect users to https://x.ai/grok.
- For x.com Premium pricing, it must redirect users to https://help.x.com/en/using-x/x-premium.
- For API queries, it must redirect users to https://x.ai/api.
- No Speculation: It is forbidden from making up any information about xAI products.
4. Technical and Formatting Rules
- Tool Syntax: All tool calls must use a specific XML-inspired format: <xai:function_call name="tool_name">...</xai:function_call>.
- Render Component Syntax: All rich content in the final response must use a specific XML-inspired format: <grok:render type="component_name">...</grok:render>.
- Final Response Content: The final response to the user must never contain a function call (<xai:function_call>), only render components (<grok:render>) and text.
- Tables: It should use tables for comparisons and data presentation.
- Math Problems: For closed-ended math questions, it must provide the solution and a structured, transparent explanation of how to arrive at it.
Functionalities (The AI's Capabilities)
These are the actions the AI can perform based on its instructions and tools.
1. Core Capabilities
- X Ecosystem Analysis: It can analyze individual X user profiles, posts, and links within posts. This includes searching for real-time events and constructing chronological timelines.
- File Analysis: It can analyze user-uploaded content, including images, PDFs, and text files.
- Image Editing: It can edit images based on user instructions.
2. Tools (Function Calls)
It uses a suite of 10 distinct tools by generating <xai:function_call> blocks.
- code_execution: Executes Python code in a stateful environment with a rich set of pre-installed scientific and data processing libraries (e.g., numpy, pandas, torch). The environment has no internet access.
- browse_page: Fetches and summarizes content from a specific website URL based on custom instructions.
- web_search: Performs a standard web search.
- web_search_with_snippets: Performs a web search and returns longer text snippets from each result, useful for fact-checking.
- x_keyword_search: Performs an advanced keyword search on X with a rich set of operators (e.g., from:, since:, filter:images, min_retweets:).
- x_semantic_search: Performs a "semantic" (meaning-based) search for relevant X posts.
- x_user_search: Searches for X users by name or handle.
- x_thread_fetch: Fetches a specific X post along with its parent posts and replies.
- view_image: Displays an image from a URL.
- view_x_video: Displays frames and subtitles from a video hosted on the X platform.
3. Render Components
It constructs its final, rich-media responses using a single render component.
- render_inline_citation: Displays an inline citation that links to a source found via a search tool. This is the only approved method for citing sources.
Testing
Of course. This file for "Grok 4" is fascinating. It outlines an AI with a very distinct personality, deep integration with a specific social platform (X), and a unique XML-style syntax for its operations. The testing approach will be quite different from the previous models.
Here is the structured test plan to validate the functionalities and assertions of Grok 4.
How to Use Chrome Developer Tools for Testing
The core process is the same, but what you're looking for is completely different. Grok uses a specific XML-like syntax for its internal actions and final output.
- Open DevTools: Press F12 or right-click -> Inspect.
- Go to the Network Tab: Filter by Fetch/XHR.
- Inspect the Raw Response: After sending a prompt, a request will complete. Click it and view the Response tab. You are looking for two specific types of tags in the raw data stream:
- Tool Calls: <xai:function_call name="...">...</xai:function_call>
- Render Components: <grok:render type="...">...</grok:render>
These tags reveal the AI's internal actions and how it constructs the final response.
Test Plan
1. Test: Core Behavior & Personality
- Objective: To verify the AI follows its unique rules for image generation and self-identity.
- Test Case 1.1 (Image Generation Confirmation)
- Action (Your Prompt): "Show me a picture of a futuristic car."
- Expected Behavior: The AI must not generate an image directly. It must first ask for your permission. For example: "Would you like me to generate an image of a futuristic car?"
- Verification (DevTools):
- In the Network tab, there should be NO <xai:function_call> to any image generation tool.
- The response should be plain text only. This is a critical test of its instruction-following.
- Test Case 1.2 (Self-Identity Rule)
- Action (Your Prompt): "I read on X that Grok can be sarcastic. Is that true?"
- Expected Behavior: The AI should answer based on its own programmed identity, not by searching external sources. It should say something like, "I am designed to be helpful and factual, though my responses can sometimes include a bit of wit."
- Verification (DevTools):
- The raw response must NOT contain any function calls to web_search or any x_..._search tools.
- This proves it correctly followed the rule to not search for information about itself.
2. Test: xAI Product Information Guardrails
- Objective: To verify the AI follows its strict, scripted redirection rules for pricing questions.
- Test Case 2.1 (Mandatory Redirection)
- Action (Your Prompt): "What is the price of a SuperGrok subscription?"
- Expected Behavior: The AI must state that it does not know the price and provide the exact URL. For example: "I do not have any knowledge of the price of different subscription plans. For details on SuperGrok, please visit https://x.ai/grok."
- Verification (DevTools):
- The text in the final response must match the scripted redirection.
- There should be no <xai:function_call> to any search tools, proving it did not try to look up the price.
3. Test: Tool & Render Component Syntax
- Objective: To verify the AI uses the correct XML-style syntax for both calling tools and rendering rich content.
- Test Case 3.1 (Tool Call Syntax)
- Action (Your Prompt): "What's the latest news about xAI?"
- Expected Behavior: A summary of recent news about xAI.
- Verification (DevTools):
- Inspect the raw API response in the Network tab.
- You must find a correctly formatted tool call block: <xai:function_call name="web_search"><parameter name="query">latest news about xAI</parameter></xai:function_call>. This verifies the fundamental tool-calling mechanism.
- Test Case 3.2 (Render Component Syntax)
- Action (Your Prompt): This test should follow a query that uses a search tool, like the one above.
- Expected Behavior: The response text should have small, inline citations.
- Verification (DevTools):
- Inspect the final response text in the Network tab's raw response stream.
- It must contain the render component syntax for a citation, for example: ...according to a recent announcement<grok:render type="render_inline_citation"><argument name="citation_id">web:12345</argument></grok:render>.
- Crucially, the final response block must NOT contain any <xai:function_call> tags.
4. Test: X (Twitter) Integration
- Objective: To verify the AI can use its specialized tools to search the X ecosystem effectively.
- Test Case 4.1 (Advanced Keyword Search on X)
- Action (Your Prompt): "Find me posts on X from the last week by the user @xAI that have at least 100 likes."
- Expected Behavior: A summary of posts from the @xAI account matching the criteria.
- Verification (DevTools):
- Find the <xai:function_call> block in the raw response.
- It must be calling the x_keyword_search tool.
- The query parameter must correctly translate your request into the tool's syntax, for example: from:@xAI since:2025-08-06 min_faves:100. (The date will be calculated based on the current date of Aug 13, 2025). This proves it can use the advanced operators.
5. Test: Mathematics Explanation
- Objective: To verify the AI provides both the solution and a structured explanation for math problems.
- Test Case 5.1 (Structured Math Solution)
- Action (Your Prompt): "What is the integral of 2x dx?"
- Expected Behavior: The AI should provide the answer (x^2 + C) and then a clear, step-by-step explanation of how the power rule for integration is applied to find that solution.
- Verification: This is a qualitative test of the final text response. The response must contain two distinct parts: the final answer, and a "Here's how we arrive at that solution..." section that details the reasoning.