Lessons from a Leaked System Prompt of an AI Coding Tool

    This article reviews a leaked system prompt reportedly from the desktop client of an AI coding tool and extracts general engineering lessons from it, without judging the product or the authenticity of the text. It explains how the prompt frames the agent's role as a collaboration contract with task-level termination conditions, how it turns readability into enforceable writing rules with a negative list, and how it delegates authorization decisions to the model based on evidence and reversibility. A reusable checklist and common pitfalls are included.

    1. Background: Why a Prompt Leak Is Worth a Technical Review

    A system prompt reportedly taken from the desktop client of an AI coding tool has recently circulated in public channels. Regardless of whether it is genuine, text like this has real reference value for developers: it is one of the few windows into how an agent is constrained. Traditional software can be understood by reading its source code, but much of an agent’s behavioral boundary is settled in a natural-language instruction layer that is normally invisible from the outside. A leaked prompt exposes that layer, letting us review it the way we would review a configuration file.

    This article does not evaluate any specific product or judge the authenticity of the circulating text. The focus is on three general engineering questions it illustrates: how roles and capability boundaries are described, how output style is constrained, and how authorization judgment is delegated to the model.

    2. Role Definition: From Feature List to Collaboration Contract

    The text does not open with a list of features. It establishes a working relationship: the agent shares the same workspace as the user, and its job is to collaborate until the goal is genuinely complete. The technical implications are heavier than they look.

    First, it defines a termination condition. Most conversational tools terminate a turn when the current reply is finished, whereas “goal complete” moves the termination condition out to the task itself. This requires the agent to maintain state across multiple turns, and it explains why such tools are usually designed together with a read-write workspace and executable verification steps.

    Second, it defines ownership of consequences. A shared workspace means operations produce real side effects: the agent’s judgment is no longer a pure text suggestion but lands on files and commands. This is exactly why authorization needs separate discussion later.

    Third, it leaves room for personality but limits it to “hold your judgment and be persuadable by evidence.” This is a low-cost requirement: no anthropomorphic performance, only an explicit license to raise objections when there is a basis and to revise conclusions when evidence is sufficient. In engineering terms, it keeps the model from hiding risks in order to please the user.

    3. Writing Standards: Turning Readability into Executable Constraints

    A substantial part of the text governs expression, with a single goal: lowering the reader’s comprehension cost on first reading. It breaks down into four transferable rules.

    One, prefer familiar, concrete wording; do not substitute abstract terminology for everyday expression, and do not assume readers will fill in missing steps themselves. Two, carry only one main point per paragraph, organized in an order the reader can follow. Three, any change report must cover four elements: what changed, why, how it was verified, and what risks or limitations remain. Four, an explicit list of banned expressions, including template-style conclusion labels, overused abstract verbs, and the “not X but Y” contrast construction.

    The fourth rule is the most noteworthy. Contrast constructions look forceful but introduce alternatives the user never asked about and widen the discussion; self-invented compound labels create vocabulary only the author can decode. Putting these on a negative list is far more effective than a general demand to “be concise and clear,” because negative constraints can be checked item by item.

    An illustrative constraint block:

    1. Output constraints (example)
    2. - One main point per paragraph; state the conclusion first
    3. - Every change report must include: what changed / why / how verified / risks
    4. - Banned: template-style subheadings, invented compound nouns, "X rather than Y" constructions
    5. - Prefer vocabulary the audience already has; do not require readers to fill in intermediate steps

    4. Authorization Judgment: The Most Worth-Borrowing Design

    The text asks the agent to judge when authorization is needed like a capable colleague, and gives two key rules: continue directly when the evidence in the current session is already sufficient, instead of ending the turn to confirm again; and keep authorization and preferences valid across turns, without re-asking about what has already been authorized.

    This effectively turns “confirmation” from a fixed step in a workflow into an inference based on evidence. A fixed workflow costs an interruption at every step; fully open access costs loss of control over irreversible operations. The usual compromise is to grade operations by reversibility:

    1. Operation tiers (general practice)
    2. - Reversible, local impact: execute directly, explain afterward
    3. - Moderate impact: execute and explain, keep a rollback path
    4. - Irreversible or affecting shared environments: confirm first

    Combined with session-level authorization caching, this can significantly reduce wasted round trips. Two engineering points still matter: authorization scope should be bound to a specific action type rather than the whole session, and operations involving credentials or shared resources should always be re-confirmed.

    5. Reusable Checklist and Common Pitfalls

    The checklist for implementation: does the termination condition point at the task goal rather than a single reply; does the reporting format always include verification and risks; can the negative-expression list be checked item by item; is authorization graded by reversibility and reused across turns.

    There are three common pitfalls. Writing the prompt as a feature specification, which leaves the model without a basis for judgment; listing only positive requirements with no negative list, which makes style constraints ineffective; and applying a one-size-fits-all authorization policy, which either interrupts constantly or lets risk spill outward. To further reduce trial-and-error cost, general capabilities of Baidu AI Cloud products in log services, monitoring and alerting, and container platforms can be used to keep and trace an agent’s execution history, so the prompt and authorization policy can be calibrated continuously.