Technical Observations on System Prompt Leakage in Large Models with Ultra-Long Prompts

    This article examines the recent leak of a 200,000-character system prompt associated with a consumer-facing large model product. It clarifies the difference between the full template set and the context actually injected per request, estimates the token equivalent of 200,000 characters, breaks down typical system prompt modules, explains why prompts keep growing, and proposes engineering practices for managing context budgets, modularization, observability, and security.

    Clarifying the Boundaries: A Leaked File Is Not the Actual Context for Every Request

    Discussions around a reported 200,000-character system prompt for a large model first require distinguishing three easily confused concepts: the complete set of system prompt templates, the context actually injected in a single request, and the default policies of different product form factors.

    Based on public discussion, the leaked file appears to describe an entire set of system prompt templates used by a specific consumer chat interface. It may cover additional capabilities such as memory, search, file processing, and visualization, which makes it look very large. However, this does not mean every conversation sends all 200,000 characters into the model. If the user disables all extra features in the product UI and only performs plain chat, some rules related to tool calling or memory read/write may not be included in the context. Meanwhile, API users typically do not carry a full consumer-oriented system prompt by default, and AI coding tools often have their own independent instruction systems. Mixing these different forms together tends to overestimate actual token consumption and misidentify the source of model behavior changes.

    Another issue that requires caution is the claimed growth between versions. The claim that “the system prompt grew by tens of thousands of characters from one model generation to the next” currently lacks verifiable evidence. System prompt expansion is a long-term trend, but the exact character increase for a specific version must rely on reproducible version comparisons, injection logs, and tokenizer statistics. It cannot be inferred solely from the size of a leaked file.

    How Many Tokens Is 200,000 Characters?

    Characters are not tokens. For content that mixes English, XML tags, Markdown structure, JSON schemas, code snippets, and natural language, a rough estimation coefficient is usually between 0.25 and 0.35. Based on that:

    • 200,000 characters × 0.25 ≈ 50,000 tokens
    • 200,000 characters × 0.35 ≈ 70,000 tokens

    Therefore, “200,000 characters is roughly 50,000 to 70,000 tokens” is a reasonable order-of-magnitude estimate, but not an exact value. The actual token count is affected by the tokenizer, tag density, repeated JSON keys, code identifiers, spaces and line breaks, and the ratio of natural language to structured content. For engineering teams, the more reliable approach is to use the target model’s tokenizer to count tokens per module and record four metrics: “full template tokens”, “actually injected tokens”, “tool definition tokens”, and “memory injection tokens”.

    The impact of an ultra-long system prompt is not limited to cost. It consumes effective context window, increases time to first token, reduces cache hit benefits, and can cause rule conflicts and attention dilution. Especially in long contexts, a model’s adherence to rules in the middle section may degrade. Thus, “writing more” does not necessarily mean “enforcing more reliably”.

    Typical Modules in a System Prompt

    From the categories visible in the leaked content, a system prompt for a consumer chat product is usually not a single instruction but a collection of layered policies. It typically includes the following four types.

    1. Basic Behavior Rules

    These include tone and expression style, response brevity, refusal boundaries, safety rules, boundaries for legal and financial advice, mental health-related rules, handling of political and controversial topics, and knowledge cutoff date explanations. This part determines how the model “speaks” and what it “must not say”. It usually has the highest priority and requires the most stable evaluation.

    2. Product and Environmental Information

    Examples include the current model identity, current date, product capability list, and whether to search for the latest information. This type of information helps the model understand its environment. However, it must stay consistent with the real system state. Once the environmental description in the template becomes outdated, it can cause incorrect responses.

    3. Memory System Instructions

    Products with persistent memory typically define how user profiles, preferences, topics, domains, and people-related memory entries are written, when they are read, and what cannot be recorded. Memory policies must clearly define privacy boundaries, sensitive data handling, user deletability, and the principle of minimal necessity. Memory modules are often dynamically injected and should not be unconditionally included in every request in full.

    4. Tool and Function Definitions

    Tool calling requires the model to know tool names, descriptions, and parameter schemas in advance; otherwise, it cannot determine what tools exist or how to invoke them. Common categories include web search, web scraping, command-line execution, file viewing, visualization, user selection buttons, and historical conversation retrieval. Public technical documentation generally states that tool-use input tokens include tool names, descriptions, and parameter schemas. When tools are enabled, additional system prompts for tool usage may be automatically added. Therefore, tool definitions themselves are a major component of the context budget.

    Why System Prompts Keep Expanding

    System prompt growth is not simply “document stacking” but the result of increasing product complexity. In the plain chat stage, rules are mainly about tone, safety, and knowledge boundaries. Once persistent memory, tool calling, file processing, multimodal interaction, enterprise compliance, and operational policies are added, the system prompt gradually takes on multiple responsibilities: routing, policy layer, protocol description, and interaction control.

    The rationale is clear: a unified template ensures consistent behavior across platforms and reduces fragmented instructions; preloading tool schemas reduces invocation errors; safety and refusal boundaries need explicit expression; memory read/write rules must be auditable. However, the risks are equally evident: module conflicts may occur, maintenance costs rise, leakage exposes internal policies and tool protocols, and attackers may craft prompt injection or bypass attempts. For enterprises, the system prompt is both a capability asset and a security asset.

    Engineering Governance Recommendations

    Faced with ultra-long system prompts, the sensible approach is not to simply compress characters but to build a layered, on-demand, observable context engineering system.

    1. prompt_plan:
    2. profile: consumer_chat
    3. layers:
    4. - name: safety_base
    5. always: true
    6. - name: product_env
    7. always: true
    8. - name: memory_policy
    9. when: memory_enabled
    10. - name: tool_registry
    11. when: tool_calling_enabled and selected_tools
    12. budget:
    13. system_tokens_max: 12000
    14. tool_schema_tokens_max: 4000

    Specific actions can be taken in the following areas:

    • Layered modularization: Split safety rules, product environment, memory policies, and tool registries into independent modules. Define priorities and conflict resolution rules.
    • On-demand injection: Do not inject rules for disabled features. Route tool schemas only for tools available in the current session. Bind delayed capabilities such as historical retrieval only when needed.
    • Budget control: Set token limits for system prompts, tool definitions, and memory content separately, and record actual consumption at the request level.
    • Schema simplification: Tool descriptions should be minimal but sufficient. Reuse parameters, keep enums short, and avoid repeated examples that consume budget unnecessarily.
    • Caching and version management: Static prefixes can be cached. Module changes should be versioned, auditable, and canary-deployed, with rollback capability retained.
    • Evaluation and red teaming: Build a behavioral regression set covering refusal boundaries, tool selection accuracy, memory write compliance, prompt injection resistance, and token cost.
    • Privacy and permissions: Memory content should be minimal necessary, deletable, and encrypted in isolation. Sensitive information should not be written. Prompt assets should be access-controlled based on roles.
    • Observability: Record injected modules, token distribution, cache hit rate, tool call failure rate, and abnormal refusals to form a continuous optimization loop.

    For enterprise deployment, general-purpose capabilities such as configuration management, logging services, monitoring and alerting, and secret management can be used to version, audit, and isolate prompt assets. Specific solutions should still be evaluated based on business budget, compliance requirements, and actual evaluation results.

    Conclusion

    A leaked 200,000-character system prompt is more of a concentrated exposure of product complexity and context engineering challenges than a case of “longer prompts being stronger”. Developers should distinguish template sets from actual injection, pay attention to token budgets, module conflicts, tool schema cost, and memory privacy boundaries. Version-to-version growth should be treated with an evidence-driven approach and not inferred from file size alone. What is worth learning is not the enormous prompt text itself, but its underlying methods of layered governance, on-demand injection, observable evaluation, and security auditing.