Evaluating Leaked AI Agent System Prompts: A Technical Framework

    Leaked system prompts reveal intended behavioral constraints, not a model’s underlying capabilities. This article explains how to evaluate their engineering value through observable completion criteria, clear communication rules, session-level authorization, and regression testing, then apply transferable lessons to a layered prompt design.

    1. What a Leaked System Prompt Can—and Cannot—Tell You

    The most useful aspect of a leaked system prompt is its constraint structure, not wording to copy line by line. Look at which behaviors are defined as hard rules, which are left to the model’s judgment, and which depend on conversation state.

    A prompt describes intended behavior. It does not establish the underlying model’s capabilities, context window, tool interfaces, or billing model. Treating it as a capability inventory leads to misleading conclusions.

    For evaluation, separate its contents into three categories:

    • Transferable engineering practices.
    • Implementation details tied to a specific product.
    • Promotional claims that cannot be verified.

    Only the first category should inform your own prompt design.

    2. Agent Roles: A Shared Workspace and a Clear Completion Loop

    The source prompt defines the agent as a collaborator that shares a workspace with the user and continues working until the goal is fully achieved. This has three engineering implications.

    Visible state. A shared workspace contains actual files and a command environment, rather than abstract descriptions. The prompt therefore needs to constrain both where the agent may write and how it should verify its work.

    Observable completion. Completion should be defined by evidence, such as a successful build, passing tests, or no new static-analysis warnings—not by the model simply declaring the task finished.

    Shared responsibility. A collaborator should raise objections when there is sufficient reason, rather than execute every instruction unconditionally. This shifts the agent’s role from an obedience script to an executor that exercises judgment.

    3. Style Rules Reduce Cognitive Load

    Detailed writing rules may seem minor, but they serve a common purpose: helping readers understand the output on the first read. They can be reduced to four practical requirements:

    • Use familiar words instead of abstract terminology that readers must decode.
    • Keep one main idea per paragraph and arrange ideas in an order readers can follow.
    • When reporting changes, answer four questions: What changed? Why? How was it verified? What risks or limitations remain?
    • Provide evidence and define the scope of applicability so that conclusions can be checked.

    Prohibited-expression lists also have a purpose. Generic headings such as “Conclusion,” “Significance,” or “Perspective” carry little information on their own. Certain contrast constructions introduce alternatives the user never raised. Invented compound labels and formulaic transitions add reading effort.

    Concrete negative examples are more effective than abstract instructions alone because models tend to recognize specific counterexamples more consistently.

    4. Model Authorization as State, Not an Event

    A central engineering principle in the source prompt is that authorization persists across turns. Once the current conversation provides sufficient evidence of permission, the agent should continue within that permission rather than repeatedly ask for confirmation.

    This requires authorization to be modeled as session-level state.

    1. # Illustrative authorization state, not a specific product interface
    2. session:
    3. workspace_scope: [read, write, exec] # Capabilities granted for this session
    4. granted_at_turn: 3
    5. persists: true
    6. escalation_rules:
    7. - if action in session.workspace_scope: proceed
    8. - if action.scope_outside_workspace: ask_once
    9. - if user_declined: remember_and_skip

    This state model needs three supporting guardrails:

    • Scope limits: Actions outside the workspace require separate confirmation.
    • An irreversible-action list: Deletion, force pushes, and production changes require explicit confirmation.
    • Memory of refusals: Paths or actions the user has declined should not be proposed repeatedly.

    These guardrails must qualify the general permission to proceed. Without stateful authorization, an agent can repeatedly request permission, turning collaboration into an approval workflow.

    5. A Layered Template for Your Own System Prompt

    Organize the prompt into five layers, with verifiable rules within each layer:

    1. Identity and goals: Define the role, shared workspace, and completion criteria.
    2. Working practices: Read before writing, make minimal changes, and verify after changes.
    3. Communication rules: Specify the response structure, the four-question change report, and concrete negative examples.
    4. Authorization and safety: Define scope, escalation rules, irreversible actions, and memory of refusals.
    5. Failure handling: Explain gaps in the evidence instead of inventing conclusions.

    This structure separates concerns while keeping the rules tied to observable behavior.

    6. Validate Prompt Changes with Regression Tests

    A system prompt is configuration and should be regression-tested. Build three categories of test cases:

    • Style: Does the agent use prohibited expressions or place multiple main ideas in one paragraph?
    • Authorization: Does it ask for permission again across turns unnecessarily? Does it correctly stop actions outside the authorized scope?
    • Completion: Does it actually run verification and report supporting evidence?

    After each prompt change, run the same test set and compare pass rates and human evaluation scores.

    For cloud-hosted services, logging and monitoring alerts can help capture invocation traces. A container platform can run evaluation jobs, while object storage can retain test cases and results. Together, these components support a repeatable evaluation pipeline.

    Relevant general-purpose service categories from Baidu AI Cloud are one possible hosting option. Platform selection should prioritize observability and repeatability.

    7. Common Anti-Patterns

    • Writing the prompt as a capability advertisement: The model cannot verify the claims, and behavior remains unstable.
    • Leaving conflicting rules unresolved: For example, requiring both brevity and exhaustive reasoning without specifying priority.
    • Providing only positive instructions: Without negative examples, prohibited expressions are harder to suppress.
    • Treating authorization as stateless: This leads to repeated confirmation requests or actions beyond the granted scope.
    • Using unobservable completion criteria: The task stops when it appears finished rather than when completion is verified.

    8. Turn Prompt Analysis into Testable Engineering Rules

    The right way to evaluate a leaked system prompt is to extract its constraint structure. Reliable task completion depends on observable verification criteria. Clear communication benefits from concrete negative examples. Permission safety requires session-level authorization state and explicit rules for irreversible actions.

    Putting these principles into a layered prompt and backing them with regression tests can produce a coding agent with more consistent behavior and lower cognitive load, without depending on the implementation details of any single product.