Why System Prompts Keep Growing: From Rule Stacking to Layered Governance
This article examines why system prompts in AI agents tend to expand over time and why length alone is a poor measure of system design quality. It analyzes the shift from single-turn Q&A to multi-step tool use, the accumulation of local patches without lifecycle management, and the tendency to mix product facts with behavioral rules. It also explores why long-term memory often drives prompt growth, how retrieval and storage layers should carry different responsibilities, and why rule conflicts, trust boundaries, and programmatic safeguards matter more than text volume. Readers will learn a layered control architecture, evaluation criteria, and a practical governance roadmap for moving from monolithic prompts to clearer responsibility boundaries.
1. Clarify the Problem: A Long Prompt Is Neither Automatically Advanced Nor Automatically a Failure
Discussions around leaked system prompts often focus first on length: why would a system need hundreds of thousands of characters? Is it because every time the model exposes a problem, the development team adds another rule, eventually turning the system prompt into an operations manual?
That concern is reasonable, but text size alone cannot be used to judge the quality of system design.
First, whether a circulating text is authentic, complete, and tied to a particular runtime environment requires reliable confirmation. A so-called “complete system prompt” may actually mix fixed instructions, tool descriptions, conversation context, conditional injection rules, and user memory. Without clear boundaries, directly comparing the character counts of two texts can easily lead to distorted conclusions. This article does not treat unverified leaked content as specific product facts; instead, it discusses the general engineering problems reflected by such content.
Second, character count is not equal to the number of tokens the model actually processes, nor is it equal to the effective input repeatedly processed in every request. Language, text format, and tokenization all affect the conversion, and context reuse mechanisms may also change the actual processing cost. Therefore, “how much longer the prompt has become” cannot be simply equated with “how much cost or latency has increased.”
The more important questions are:
- Which information must always exist in high-priority instructions?
- Which information should be loaded dynamically according to task needs?
- Which constraints should not rely on natural language, but should be enforced by programs?
- When rules conflict, can the system reliably identify and resolve the conflict?
Prompt inflation is fundamentally a question of how to divide the control logic of an agent.
2. Why System Prompts Keep Expanding
2.1 Moving from Single-Turn Q&A to Multi-Step Tasks Significantly Expands Behavioral Boundaries
A simple Q&A system mainly needs to constrain answer content and expression style. Once the system can read files, call tools, modify data, and execute cross-step tasks, it must additionally define:
- When tools may be called;
- Which operations require user confirmation;
- How to recover after a tool failure;
- How to handle conflicting sources;
- How to distinguish between executed, planned, and impossible actions;
- Which information may be persisted.
These requirements are not inherently redundant. They fill in the behavioral contract required by an executable system.
The problem is that if all contracts are written into the same static text, the system gradually becomes one in which “all tasks share all rules.” An ordinary writing request may also carry a large amount of instructions unrelated to writing, such as file modification, memory maintenance, and tool recovery.
2.2 Local Patches Lack Lifecycle Management
Prompts are usually easier to modify than program code. When an error occurs, adding a paragraph of explanation is often faster than redesigning the workflow.
But this low cost can also create a long-term burden:
- Old rules are not removed, while new rules keep accumulating;
- The same concept is described in multiple ways;
- Exception conditions are scattered across different sections;
- Temporary measures gradually become permanent instructions;
- A new rule fixes one case but affects other tasks.
This is similar to technical debt in software systems. The problem is not that “there are many rules,” but that the rules lack clear scope, maintenance ownership, validation cases, and exit conditions.
2.3 Product Facts and Behavioral Rules Are Mixed Together
Product entry descriptions, feature status, historical events, and behavioral norms have different update cycles.
For example, “confirmation is required for irreversible operations” is a relatively stable behavioral constraint; “whether a certain feature is currently available” is a dynamic fact; and “why a certain feature was paused in the past” is historical material.
Putting all three on the same layer creates two problems: updates to dynamic facts may affect core rules, and historical information may be misread as current status.
Therefore, a system prompt should not by default take on the responsibility of an encyclopedia. Most product facts are better placed in a retrievable knowledge layer with versions and validity periods.
3. Why Long-Term Memory Is Especially Likely to Drive Prompt Expansion
Long-term memory may appear to be simply “remembering user information,” but it actually involves a complete data governance mechanism.
The system must determine what is worth remembering, when to read it, how to correct it, who can access it, how long it should be retained, and how to ensure that deleted information is no longer used after a user requests deletion. Each question can generate a large number of rules.
3.1 Memory Is Not Simple Compression of Chat Logs
Chats contain stable facts, but they also contain temporary assumptions, paraphrases, jokes, and plans that are no longer valid.
For example:
- “I have long been responsible for data governance” may be suitable as stable background;
- “I’m temporarily helping organize materials this week” may not be suitable for long-term storage;
- “Assume I am the project lead” should not be treated as a real identity;
- “That previous plan has been canceled” should trigger an update of old information, rather than merely appending a contradictory record.
Therefore, a memory system needs to distinguish fact types and confidence levels, rather than only judging whether a sentence “looks important.”
More reliable memory records usually need to include source, recording time, scope, and status. When sensitive information is involved, the system should also follow the principle of minimization and meet applicable authorization and compliance requirements.
3.2 “Index First, Read Body on Demand” Has Engineering Rationale
Putting all memory bodies into every context increases interference from irrelevant information and expands the privacy exposure surface. A more reasonable approach is layered organization:
The first layer is concise, stable background that retains only necessary information.
The second layer is a memory index that provides topics, brief summaries, update times, and access scope.
The third layer is the detailed body, read only when the current task actually needs it.
This structure is essentially retrieval augmentation, not evidence that the model has unlimited reliable internal memory.
For example, when a user asks, “What architecture was chosen for a certain client project before?”, the system should first locate the corresponding project record and then read the decision content. If it sees only the index but does not read the body, it cannot directly equate “there is no answer in the current context” with “the system has never saved an answer.”
Conversely, it should not scan all private records just to answer a simple question. Retrieval scope should be relevant to the task and constrained by permissions.
3.3 File-Based Organization Is Not the Same as Full Data Consistency
Organizing memory with directories and documents has advantages: it is intuitive, easy to inspect, and convenient for manual maintenance. But when multiple entry points read and write at the same time, concurrency problems quickly appear.
Suppose two sessions both read an old version of a record. One updates the project status, and the other updates communication preferences. If simple overwrite writes are used, the later submission may erase earlier changes.
This is not a problem that can be reliably solved by adding a sentence such as “please avoid conflicts.” The underlying layer usually needs:
- Version identifiers or revision numbers;
- Consistency checks before writing;
- Conflict detection and merge strategies;
- Necessary atomic update mechanisms;
- Auditable change records.
Prompts can specify how conflicts should be explained and handled after they occur, but consistency guarantees should mainly be the responsibility of the storage and service layers.
4. The Main Risks of Long Prompts Are Not Only Cost
4.1 A Rule May Exist Without Being Executed
The model may ignore local constraints in a complex context, or it may interpret similar rules differently. In particular, when a prompt contains both “proactively complete the task” and “act cautiously and avoid actions,” execution results may be unstable if applicable conditions are missing.
Therefore, actual behavior must be validated through testing. “It has been written into the prompt” cannot be treated as evidence that the risk has been eliminated.
4.2 Rule Conflicts Are Often Harder to Detect Than Missing Rules
For example:
- The system is required to prioritize long-term preferences, but the user explicitly requests a different format in the current turn;
- The system is required to complete tasks autonomously as much as possible, but the current operation is irreversible;
- The system is required to search historical materials first, but the user has not authorized cross-project access;
- The system is required to be concise while also being required to output a complete audit explanation.
These requirements are not absolutely incompatible. The key is to clarify priority relationships and applicable conditions.
Usually, the explicit request in the current turn should take precedence over historical expression preferences; permission and security boundaries should not be overridden by convenience goals; uncertain facts should retain uncertainty rather than being guessed in order to complete a task.
4.3 A Larger Context Also Makes Trust Boundary Management Harder
Memory bodies, external documents, and tool return values may all contain instruction-like text, but they should not automatically receive system-level privileges.
It is necessary to distinguish “data provided for the model to analyze” from “instructions that control model behavior.” Text from materials, even if strongly worded, cannot by itself modify permissions, bypass approvals, or change data access scope.
Preventing such problems cannot rely on a single reminder. It should also combine source marking, structured input, tool permission restrictions, and server-side validation.
5. From Large Prompts to a Layered Control Architecture
The more maintainable goal is not simply to shorten the text, but to put different responsibilities back in the right places.
Layer 1: Concise, Stable Core Instructions
The core layer retains identity boundaries, truthfulness requirements, permission principles, privacy constraints, and general execution norms.
This layer should be as stable as possible and should avoid mixing in frequently changing product states and long historical explanations. Each rule should ideally correspond to clear test cases.
Layer 2: Task Specifications Loaded by Capability
Rules for writing, file handling, data analysis, and external operations do not all need to be resident at all times.
The system can load the corresponding specification based on currently enabled capabilities and add necessary content when tasks switch. It is important to note that task classification itself may also be wrong, so critical security boundaries cannot rely entirely on a single classification result.
Dynamic loading aims to reduce irrelevant context, not to hide necessary constraints in unreachable places.
Layer 3: Retrievable Facts and Memory
Product descriptions, project background, and long-term memory enter the knowledge layer. Relevance, freshness, and permissions jointly determine whether they should be read.
Retrieval ranking should not consider only semantic similarity. It should also consider:
- Whether the material has expired;
- Whether it belongs to the current user and project;
- Whether there are subsequent revisions;
- Whether the source is reliable;
- Whether it is truly necessary to enter the current context.
Layer 4: Programmatic Execution Safeguards
Access control, quota limits, sensitive field filtering, approval for irreversible operations, and concurrency control should be enforced by deterministic programs wherever possible.
For example, the model may propose a write request, but the server still needs to check the caller identity, resource permissions, and data validity. Even if the model misjudges, it should not directly bypass the underlying boundary.
The basic principle is: what can be reliably validated should not rely only on natural language constraints; what must rely on semantic judgment can then be handled by the model.
6. How to Evaluate Whether Refactoring Actually Works
Prompt governance cannot compare only the number of words before and after a change. A more valuable approach is to establish multi-dimensional evaluation.
6.1 Task Effectiveness
Focus on task completion rate, factual accuracy, correctness of tool calls, and the number of times users need to provide additional clarification. If key steps are omitted after compressing a prompt, the optimization cannot be called successful.
6.2 Memory Quality
Focus on whether retrieval hits the right records, whether old facts are invalidated in time, whether incorrect memories can be corrected, and whether cross-user or cross-project reads occur.
Deletion semantics must also be clear: after the body is deleted, indexes, summaries, caches, or derived copies may still expose relevant information, and this must be included in system design and validation.
6.3 Safety and Permission Behavior
The system should be tested both for its ability to reject unauthorized requests and for excessive rejection of normal tasks. Evaluation should cover misleading instructions in external materials, tool anomalies, and insufficient permissions.
6.4 Cost and Maintainability
In addition to input size and response latency, teams should observe the impact scope of rule changes, regression testing cost, difficulty of fault localization, and rollback speed.
If a small change affects a large number of unrelated tasks, then even if the text is not long, it indicates that module boundaries are not clear enough.
7. An Executable Governance Roadmap
For teams that have already accumulated a large number of system instructions, adjustments can be made gradually in the following order:
Step 1: Build an inventory. Label existing content as core rules, tool contracts, dynamic facts, memory policies, style preferences, and historical patches.
Step 2: Find duplication and conflicts. Do not merely delete similar sentences; also check whether they have different applicable conditions, so that exceptions are not accidentally removed during compression.
Step 3: Migrate dynamic facts. Move frequently changing descriptions into a knowledge layer with versions and update times, avoiding long-term fixation in core instructions.
Step 4: Sink hard constraints. Prioritize moving permission decisions, write validation, and approval for irreversible operations to programmatic mechanisms.
Step 5: Build regression tests. Cover normal tasks, boundary tasks, memory conflicts, retrieval failures, and tool anomalies to ensure that changes are verifiable.
Step 6: Validate in small scopes and preserve rollback capability. Rewriting all prompts at once makes it difficult to locate problems; module-by-module adjustment is usually more controllable.
Conclusion: What Needs Optimization Is Responsibility Boundaries, Not Just Word Count
System prompts grow longer. This may be a natural result of expanding capabilities, or it may be a signal of accumulating architectural debt. Length alone cannot determine whether a design is good or bad, but if every problem ultimately depends on “adding another paragraph,” it is worth reexamining the system design.
A mature agent architecture should let prompts handle semantic-level behavioral guidance, retrieval systems provide relevant facts, storage systems ensure consistency, permission systems enforce boundaries, and evaluation systems verify effectiveness.
Real progress is not compressing a large operations manual into a few slogans, but giving every type of rule a clear place, a reliable execution mechanism, and a continuous validation method.
