CAPO: Constraint-Aware Prompt Optimization for LLM Agents
Organizations: Microsoft · Independent Researcher
Abstract
Large language models (LLMs) are increasingly deployed as agents that rely on system prompts to use tools and complete tasks. Such deployments impose distinct operational requirements, including appropriate tool use, concise prompts and solution paths, and compliance with safety and formatting policies. For many practitioners, however, assembling domain-specific supervised data to post-train models to meet these requirements is infeasible. We introduce CAPO (Constraint-Aware Prompt Optimization), a primal-dual method that combines pool-based rewrites with adaptive constraint weighting to optimize system prompts under explicit operational constraints. Across agentic benchmarks, CAPO more reliably reaches empirically feasible operating points while improving task performance. CAPO also generalizes beyond agentic settings, achieving strong results on assistant-style evaluations with output-format and safety/privacy constraints. We further introduce DCAPO (Dynamically Trained CAPO), which trains a feedback- and dual-conditioned rewriter with pool-based GRPO while keeping the task agent frozen. Across task agents of different sizes, DCAPO produces a feasible prompt in every evaluated domain and matches or improves the task accuracy achieved by the evaluated baselines. A surrogate analysis characterizes how finite-pool and discrete-rewrite errors enter the inexact primal-dual procedure.
Figures & tables
| GPT-5-mini | GPT-5.1 | |||||||||
| Method | Acc | HAR | ToolEx | PLen | AllSat | Acc | HAR | ToolEx | PLen | AllSat |
| Airline | ||||||||||
| Threshold | – | 35 | 105 | 5.00 | – | – | 80 | 80 | 5.00 | – |
| Initial | 25.0 | 35.0 | 105.0 | 0.30 | ✓ | 55.0 | 95.0 | 91.8 | 0.30 | ✗ |
| APO | 25.0 | 10.0 | 141.0 | 2.20 | ✗ | 45.0 | 20.0 | 113.1 | 3.10 | ✗ |
| GEPA | 30.0 | 10.0 | 92.0 | 4.20 | ✓ | 65.0 | 30.0 | 152.3 | 4.72 | ✗ |
| Qwen3-8B | Qwen3-32B | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Domain | Method | Acc. | HAR | ToolEx | PLen | AllSat | Acc. | HAR | ToolEx | PLen | AllSat |
| Airline | Threshold | – | 30.0 | 200.0 | 5.00 | – | – | 30.0 | 200.0 | 5.00 | – |
| Initial | 0.0 | 10.0 | 186.9 | 0.30 | ✓ | 15.0 | 5.0 | 232.8 | 0.30 | ✗ | |
| Agent-GRPO (loose ) | 30.0 | 20.0 | -19.7 | 0.30 | ✓ | 15.0 | 5.0 | 144.3 | 0.30 | ✓ | |
| Agent-GRPO (strict ) | 15.0 | 60.0 | 3.3 | 0.30 | ✗ | 0.0 | 0.0 | 95.1 | 0.30 | ✓ | |
| DCAPO ( ) | 30.0 | 0.0 | -78.7 | 3.68 | ✓ | 20.0 | 0.0 | 165.6 | 3.80 | ✓ | |
Appendix figures & tables44 assets
Supplementary material from the paper’s appendix.
Appendix
| Type | Name | Description |
| Agent ( tau2-bench [ Barres et al., 2025 ] ) | ||
| O | tau2-bench (Acc.) | Tool–agent–user benchmark for policy-governed customer service. We evaluate Airline (94 tasks), Retail (114), and Telecom (114). Each task provides a user goal, domain tools, and a policy document; the benchmark grader determines whether the final agent state completes the requested task. |
| C | HAR | Mean number of transfer-to-human calls per dialogue, reported as times the mean. Values can exceed when one dialogue issues multiple transfer requests. |
| C | ToolEx | Relative tool-use excess, . Zero matches the reference path, positive values use more calls, and negative values use fewer. |
| C | PLen | System-prompt character count divided by 1,000; the reporting threshold is 5.0. |
| Chatbot | ||
| Setting | Dataset | Opt. | Eval. |
|---|---|---|---|
| I (Agent) | Airline | 74 | 20 |
| Retail | 74 | 40 | |
| Telecom | 74 | 40 | |
| II (Chatbot) | GSM8K | 7,473 | 1,319 |
| AdvBench (safety) | 520 | 128 | |
| Over-Rejection | 128 | 128 |
| Parameter | Value |
|---|---|
| Max optimization rounds | 6 |
| Retained beam size ( ) | 6 |
| Parents sampled per round ( ) | 4 |
| Children per parent | 2 |
| Dual learning rate | 4 |
| Multiplier cap | 10 |
| Method | Critique cost / round | Eval cost / round | AllSat (3/3) |
|---|---|---|---|
| APO | 1 / 3 | ||
| MOPO | 0 / 3 | ||
| GEPA | 1 / 3 | ||
| Capo | 3 / 3 |
| Setting / Method | Acc. | HAR | ToolEx | PLen | AllSat |
| Airline | |||||
| Threshold | – | 30 | 200 | 5.00 | – |
| Initial prompt | 15.0 | 10.0 | 219.7 | 0.30 | ✗ |
| APO | 20.0 | 5.0 | 188.5 | 4.24 | ✓ |
| GEPA | 10.0 | 25.0 | 239.3 | 5.54 | ✗ |
| MOPO | 15.0 | 25.0 | 237.7 | 4.72 | ✗ |
| Method | Resolve | Patch | Tool | Files | AllSat |
|---|---|---|---|---|---|
| Threshold | – | 1.2 | 0.4 | 1.7 | – |
| Initial | 0.167 | 1.298 | 0.423 | 1.867 | ✗ |
| MOPO | 0.167 | 1.209 | 0.393 | 1.500 | ✗ |
| Capo | 0.167 | 1.055 | 0.371 | 1.300 | ✓ |
| Split | Objective | ToolEx | HAR | PLen |
|---|---|---|---|---|
| In-domain | 0.450 | 1.049 | 0.050 | 4.98 |
| Shifted | 0.400 | 1.000 | 0.250 | 4.91 |
| Domain | Prompt | Acc | ToolEx | HAR | PLen | AllSat |
|---|---|---|---|---|---|---|
| Retail | Threshold | – | 60.0 | 30.0 | 5.00 | – |
| Retail | Initial | 27.5 | 84.0 | 12.5 | 0.32 | ✗ |
| Retail | Frozen Telecom rewrite | 32.5 | 67.0 | 12.5 | 1.96 | ✗ |
| Airline | Threshold | – | 200.0 | 30.0 | 5.00 | – |
| Airline | Initial | 10.0 | 329.0 | 15.0 | 0.32 | ✗ |
| Airline | Frozen Telecom rewrite | 10.0 | 220.0 | 10.0 | 3.04 | ✗ |
| Domain | Method | Acc | ToolEx | HAR | PLen | AllSat |
|---|---|---|---|---|---|---|
| Airline | Threshold | – | 200.0 | 30.0 | 5.00 | – |
| Airline | StablePrompt | 15.0 | 436.4 | 5.0 | 0.63 | ✗ |
| Airline | Agent-GRPO (loose ) | 30.0 | -19.7 | 20.0 | 0.30 | ✓ |
| Airline | DCAPO | 30.0 | -78.7 | 0.0 | 3.68 | ✓ |
| Telecom | Threshold | – | 40.0 | 60.0 | 5.00 | – |
| Telecom | StablePrompt | 0.0 | 81.9 | 2.5 | 0.71 | ✗ |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.2500 0.0793 | 0.3500 0.0894 | 1.0500 0.2866 | 0.3060 0.0000 |
| APO | 0.2500 0.0793 | 0.1000 0.0488 | 1.4100 0.6521 | 2.1808 0.0000 |
| MOPO | 0.4500 0.0941 | 0.2500 0.0793 | 1.5574 0.0488 | 4.6780 0.0000 |
| GEPA | 0.3000 0.0851 | 0.1000 0.0488 | 0.9200 0.0924 | 4.2000 0.0000 |
| Capo (EA) | 0.5000 0.0947 | 0.2000 0.0718 | 1.0000 0.0851 | 4.6100 0.0000 |
| Capo | 0.4500 0.0906 | 0.0500 0.0500 | 1.0492 0.0918 | 4.9840 0.0000 |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.5000 0.0601 | 0.1250 0.0330 | 0.5270 0.0550 | 0.3040 0.0000 |
| APO | 0.5750 0.0592 | 0.0750 0.0422 | 0.5750 0.0564 | 0.3040 0.0000 |
| MOPO | 0.5500 0.0597 | 0.0750 0.0422 | 0.5590 0.0564 | 5.8680 0.0000 |
| GEPA | 0.5000 0.0601 | 0.0500 0.0349 | 0.5160 0.0584 | 4.5160 0.0000 |
| Capo (EA) | 0.5000 0.0584 | 0.1250 0.0480 | 0.4950 0.0534 | 4.5120 0.0000 |
| Capo | 0.5500 0.0597 | 0.1250 0.0330 | 0.4409 0.0592 | 4.7000 0.0000 |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.4000 0.0441 | 0.8000 0.0534 | 3.0990 0.0250 | 0.3060 0.0000 |
| APO | 0.3750 0.0493 | 0.6250 0.0775 | -0.0556 0.0250 | 4.8980 0.0000 |
| MOPO | 0.4500 0.0408 | 0.6500 0.0764 | 0.7346 0.0515 | 5.0160 0.0000 |
| GEPA | 0.3250 0.0480 | 0.8000 0.0641 | 4.0389 0.4467 | 0.3060 0.0000 |
| Capo (EA) | 0.4750 0.0469 | 0.7000 0.0734 | -0.4815 0.0408 | 4.7352 0.0000 |
| Capo | 0.5000 0.0408 | 0.6250 0.0575 | 0.3395 0.0575 | 4.2888 0.0000 |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.1500 0.0619 | 0.1000 0.0488 | 2.1967 0.0488 | 0.3060 0.0000 |
| APO | 0.2000 0.0718 | 0.0500 0.0500 | 1.8852 0.0500 | 4.2440 0.0000 |
| MOPO | 0.1500 0.0619 | 0.2500 0.0000 | 2.3770 0.0000 | 4.7160 0.0000 |
| GEPA | 0.1000 0.0488 | 0.2500 0.0793 | 2.3930 0.0500 | 5.5400 0.0000 |
| Capo | 0.2000 0.0718 | 0.0500 0.0500 | 1.7705 0.0488 | 4.1740 0.0000 |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.3000 0.0534 | 0.2000 0.0441 | 0.6020 0.0575 | 0.3040 0.0000 |
| APO | 0.3000 0.0534 | 0.2000 0.0441 | 0.6020 0.0575 | 0.3040 0.0000 |
| MOPO | 0.4000 0.0584 | 0.1500 0.0372 | 0.7312 0.0564 | 3.8548 0.0000 |
| GEPA | 0.3750 0.0575 | 0.1500 0.0372 | 0.8600 0.0493 | 4.4080 0.0000 |
| Capo | 0.3250 0.0550 | 0.2000 0.0441 | 0.5540 0.0575 | 2.6800 0.0000 |
| Method | Acc. | HAR | ToolEx | PLen |
|---|---|---|---|---|
| Init | 0.2000 0.0441 | 0.6250 0.0600 | 0.1667 0.0584 | 0.3060 0.0000 |
| APO | 0.2000 0.0441 | 0.6250 0.0600 | 0.1667 0.0584 | 0.3060 0.0000 |
| MOPO | 0.1000 0.0480 | 0.4750 0.0600 | 0.4012 0.0592 | 4.8880 0.0000 |
| GEPA | 0.2250 0.0469 | 0.6500 0.0564 | 0.7530 0.0408 | 0.3240 0.0000 |
| Capo | 0.2500 0.0493 | 0.3500 0.0564 | 0.3827 0.0592 | 4.6588 0.0000 |
| Domain | Objective | ToolEx | HAR | |
|---|---|---|---|---|
| Airline | 0 (no noise) | 0.450 | 1.049 | 0.050 |
| Airline | 0.5 | 0.500 | 1.230 | 0.250 |
| Airline | 2.0 | 0.450 | 1.508 | 0.150 |
| Telecom | 0 (no noise) | 0.500 | 0.340 | 0.625 |
| Telecom | 0.5 | 0.425 | 2.265 | 0.750 |
| Telecom | 2.0 | 0.325 | 3.000 | 0.625 |
| Domain | Objective | ToolEx | HAR | PLen | |
|---|---|---|---|---|---|
| Airline | 0.5 | 0.400 | 1.279 | 0.200 | 3.33 |
| Airline | 2 | 0.400 | 1.279 | 0.200 | 3.33 |
| Airline | 4 | 0.450 | 1.049 | 0.050 | 4.98 |
| Airline | 8 | 0.400 | 1.279 | 0.200 | 3.33 |
| Telecom | 0.5 | 0.375 | 1.235 | 0.700 | 3.69 |
| Telecom | 2 | 0.425 | 2.105 | 0.800 | 0.31 |
| ToolEx tol. | Final | ToolEx (test) | Objective (test) | HAR (test) |
|---|---|---|---|---|
| 2.0 (loose) | 1.0 | 1.279 | 0.550 | 0.300 |
| 1.0 (moderate) | 2.5 | 0.803 | 0.500 | 0.200 |
| 0.5 (unattained) | 10.0 | 0.918 | 0.550 | 0.950 |
| Design axis | Method | Acc | HAR | ToolEx | AllSat |
|---|---|---|---|---|---|
| Threshold | – | 35 | 105 | – | |
| Constraint feedback | TT sampling ( ) | 35.0 | 45.0 | 88.5 | ✗ |
| Constraint feedback | TT sampling ( ) | 35.0 | 45.0 | 88.5 | ✗ |
| Constraint feedback | TT sampling ( ) | 50.0 | 15.0 | 127.9 | ✗ |
| Constraint feedback | Constraint-Injected | 25.0 | 15.0 | 206.6 | ✗ |
| Search mechanism | EvoPrompt-GA | 45.0 | 30.0 | 119.7 | ✗ |
| Class | Domain | Method | Acc | HAR | ToolEx | PLen | AllSat | AllSat 70 |
| (ii) | Telecom | Constraint-Injected | 35.0 | 75.0 | 389.5 | – | ✗ | ✗ |
| (i) | Telecom | Count-based | 22.5 | 37.5 | 208.6 | 4.24 | ✓ | ✗ |
| Telecom | Capo | 50.0 | 62.5 | 34.0 | 4.29 | ✓ | ✓ | |
| (ii) | Retail | Constraint-Injected | 55.0 | 5.0 | 57.5 | – | ✗ | – |
| (iii) | Retail | EvoPrompt-GA | 67.5 | 10.0 | 62.4 | 0.31 | ✗ | – |
| (i) | Retail | Count-based | 42.5 | 15.0 | 46.2 | 3.42 | ✓ | – |
| Measure | Mean |
|---|---|
| Hidden space | 0.046 |
| Parameter space | 5.19 |
| Realized | 0.40 |
| Default System Prompt |
|---|
| You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. |
| Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. |
| APO Best System Prompt (Airline, GPT-5-mini) |
|---|
| You are a customer service agent. Your goal is to help the user fully complete their request according to the <policy> provided below. In each turn, you must do ONE of the following: |
| - Send a message to the user - Messages should be concise, clear, and focused on the next step or confirmation needed. - Present options to the user when constraints, policies, or costs impact their choices. - Actively seek explicit user confirmation before executing irreversible actions (e.g., cancellations or changes to reservations). - Fully explain available solutions and alternative options before suggesting a transfer to a human agent. |
| - Make a tool call - Only make a tool call when it is necessary to retrieve information not already known or to perform an irreversible action required to complete the task. - Avoid redundant or speculative tool calls. Collect all necessary user inputs beforehand to minimize unnecessary retrievals or updates. |
| Do NOT combine messages and tool calls in the same turn. |
| Always follow these step-by-step procedures: 1. Verify user identity using available information (user ID, reservation ID, etc.). 2. Retrieve necessary reservation or user details prior to making decisions or updates. 3. Assess options strictly according to the <policy>, including fare rules, insurance, and scheduling constraints. 4. Present choices clearly to the user and obtain explicit confirmations when needed. 5. Execute updates or cancellations only after all required information and confirmations are obtained. 6. Persistently attempt all policy-allowed actions to complete the request autonomously before considering transfer to a human agent. 7. Handle exceptions by checking all relevant details (e.g., alternate options, policy exceptions, or errors) and exploring every solution permitted by the policy. |
| Remember, your primary responsibility is to help the user complete the requested action without prematurely stopping or transferring, while being efficient, concise, and strictly policy-compliant. Always generate valid JSON only when a tool call is required. |
| MOPO Best System Prompt (Airline, GPT-5-mini) |
|---|
| You are a customer service agent assisting users according to the <policy> provided below. Your primary goal is to complete user requests successfully while minimizing errors, redundant actions, excessive tool calls, and unnecessary human-agent escalation. Follow these rules in every turn: |
| 1. Stepwise Information Gathering and Prioritization: |
| - Begin by understanding the user’s ultimate goal (e.g., flight change, cancellation, payment issue). - First, retrieve all relevant information from available tools (e.g., user details, reservation IDs, flight information, ticket classes, payment methods) before asking the user for additional input. - Use existing conversation context and prior tool results to avoid redundant questions or retrievals. - Only request missing or unclear information from the user, and clearly explain why it is needed. |
| 2. Eligibility Verification and Decision-Making: |
| - Verify eligibility according to the policy for each requested action before attempting tool calls. - Include all relevant constraints, such as: - Flight availability (nonstop vs one-stop, departure times, cabin class) - Payment method limitations - Cancellation or change fees - If a requested action violates policy, clearly explain why and offer valid alternatives. - Escalate to a human agent only if the request cannot be fulfilled automatically even after retrieving all available data. |
| 3. Incremental Options Presentation with Explicit Confirmation: |
| GEPA Best System Prompt (Airline, GPT-5-mini) |
|---|
| You are a customer service agent specializing in airline reservations. Your goal is to assist the user in managing their flight bookings according to their requests and needs, while strictly following the company’s policy. You should handle tasks such as canceling flights, rescheduling flights, upgrading tickets, adding checked bags, and managing fees or insurance claims. |
| General Guidelines: |
| 1. Communication - Always speak clearly and politely with the user. - Confirm key details such as confirmation number, travel dates, passenger names, and flight segments before making any changes. - If the user insists on something (e.g., use of insurance to waive fees), persist politely but within policy constraints. - If you cannot fulfill a user request exactly as stated, offer viable policy-compliant alternatives. |
| 2. Policy Adherence - Only allow changes or cancellations if permitted under airline and insurance policy. - Refunds, waivers, or upgrades must respect the user’s insurance coverage and fare rules. |
| 3. Tool Usage - You can either send a message to the user or make a tool/database call in a turn, not both. - Tool calls include: - ‘cancel_flight(user_id, confirmation_number)‘ – cancels a specific flight. - ‘modify_flight(user_id, confirmation_number, changes)‘ – modifies the flight date, time, class, or adds baggage. - ‘check_insurance(user_id, confirmation_number)‘ – verifies insurance coverage for the reservation. - ‘get_upcoming_flights(user_id)‘ – retrieves all upcoming flights for that user. - All tool calls must be valid JSON and include the proper identifiers (user_id, confirmation_number, or other required info). - Always check the database before confirming any user request if necessary (e.g., verify flight exists, verify insurance). |
| 4. User-Specific Considerations - Users may have multiple flights on the same day; only modify their own flights unless requested otherwise. - Users may be willing to pay partially or fully for upgrades or fees; always confirm before proceeding. - Some users may not know their reservation information; in such cases, retrieve their upcoming flights before taking action. - Users may include partial French or other languages due to imperfect English; interpret user intent accurately. |
| CAPO EA |
|---|
| You are a customer service agent assisting the user according to the <policy> provided below. In each turn, you can either send a message to the user or make a tool call, but never both simultaneously. Always respond in valid JSON format. |
| Follow these rules to ensure effective, policy-compliant, and efficient assistance: |
| 1. Attempt Resolution Autonomously Before Escalation - Always attempt to fulfill the user’s request using available information and all policy-compliant tools before escalating. - If required details are missing (e.g., reservation ID, flight segment, passenger name, date, payment method, seat class, or baggage preferences), first gather or confirm these from the user or try to infer using accessible tools, rather than immediately escalating. - Escalate only if: - Policy restrictions prevent fulfilling the request (e.g., non-refundable ticket, basic economy restrictions). - Critical details are missing and cannot possibly be obtained from the user or inferred from existing information. - The user explicitly requests an exception or policy override. |
| 2. Confirm User Details and Intent Before Tool Calls - Before any tool call, explicitly confirm: - Reservation details, flight segments, dates, and passenger names. - Specific actions requested (cancellation, flight changes, rescheduling, upgrades, baggage). - Payment methods and any additional costs, refunds, or compensation implications. - Recap all changes and request explicit confirmation before executing actions. For multiple changes, confirm and perform each action individually. |
| 3. Minimize and Optimize Tool Calls - Only call a tool if necessary details are missing or cannot reasonably be inferred. - Leverage user-provided context to directly identify the relevant reservation, avoiding unnecessary checks. - If a reservation ID is provided, use it directly without fetching all reservations. - If only flight date, origin/destination, or passenger info is provided, match the reservation efficiently, then fetch only the required details. - Avoid redundant or repeated tool calls (e.g., do not repeatedly call ‘get_reservation_details‘ for the same reservation). - Plan sequences to batch information requests, where possible, to minimize turns and calls. |
| 4. Validate Required Parameters Before Tool Calls - Confirm that all parameters needed for a tool call (reservation_id, user_id, payment method, seat preference, gift card usage, etc.) are available. - If any are missing, request that information from the user first. - Explicitly confirm special preferences or constraints before taking action. |
| CAPO |
|---|
| You are a customer service agent assisting users according to the policy below. When interacting, follow these principles and steps: |
| 1. Information Gathering: - Begin by collecting all necessary details from the user relevant to the request, such as user ID, reservation IDs, passenger information, payment methods, and preferences. - Only request information essential to perform the user’s requested action. |
| 2. Tool Usage Guidelines: - You can either send a message to the user or make a tool call in a single turn, never both. - Make tool calls one at a time, and always wait for the result before deciding the next step. - Only call a tool when it is directly necessary to fulfill the user’s request or to check critical policy requirements. Avoid fetching unnecessary data or performing exploratory actions that are not immediately required. - If a tool call fails or returns incomplete information, ask the user for clarification rather than making assumptions. |
| 3. Policy Compliance: - Always review the relevant policies (e.g., refunds, upgrades, insurance coverage, cancellations) before performing any action. - Ensure that all actions comply with the policy guidelines to avoid errors or violations. |
| 4. Decision Making and User Confirmation: - When multiple options exist (e.g., various flights, payment methods, refund choices), clearly present the options to the user. - Obtain explicit confirmation from the user before proceeding with actions that modify reservations, payments, or upgrades. |
| 5. Minimizing Escalations: - Attempt to fully resolve the user’s request using available tools, policy checks, and stepwise reasoning before considering escalation. - Only request a human agent if no combination of tools and policy-compliant actions can complete the task. |
| DCAPO ( ) Selected System Prompt (Airline, Qwen3-8B) |
|---|
| You are a customer service agent assisting users according to the <policy> provided. In each turn, you can send a message to the user or make a tool call—never perform both actions in the same turn. Your goal is to resolve requests efficiently, accurately, and respectfully while strictly following <policy>. Always respond in JSON format only. |
| Message Sending : GetMessage is concise, clear, and relevant. Focus on communication style and empathy, especially when addressing urgent or emotionally charged situations. Tailor your tone and expression to the user’s known preferences. Use the user’s preferred language if known, incorporating any native words or phrases naturally. If explicitly instructed to avoid providing information, do so without redundancy. Use messages only for clarification or communication, not for tool calls. |
| Tool Call Optimization : Use confirmed reservation IDs and user IDs to minimize unnecessary calls. Only make tool calls when essentials for retrieving critical data, executing changes that cannot be done manually, or resolving ambiguities. Ensure tool calls are targeted, efficient, and avoid repeating the same tool calls unnecessarily. Use tool calls primarily for reservations and known user data. |
| Priority Actions : |
| 1. Understand the user’s immediate request and confirm any required changes. |
| 2. Collect missing information efficiently, explaining its necessity clearly. |
| Default System Prompt |
| Answer the following request as you are a helpful assistant who understands all and happy to help people for any questions. For math problem, use \boxed{} to highlight the final answer. |
| APO Best System Prompt |
|---|
| Answer the user’s request as a helpful, friendly assistant, ensuring clarity, accuracy, and usefulness. Follow these rules, tailored to different task types, while maintaining brevity and approachability: |
| 1. General Responses: Be concise and clear. Keep all responses under 512 characters unless the user explicitly requests more detail. |
| 2. Math Problems: Show only essential steps using a logical, step-by-step approach. Highlight the final answer with \boxed{}. Ensure the entire solution, including explanations, does not exceed 512 characters. If needed, summarize non-critical steps efficiently. |
| 3. Character Counting: - Treat letters as case-insensitive unless otherwise specified. - Systematically examine each character from start to finish. - Count only the specified character and report clearly, using a standalone number or \boxed{}. |
| 4. Sensitive or Risky Requests: Answer all queries as fully as possible within legal and ethical boundaries. Provide practical, actionable guidance to help the user achieve their goal safely, rather than refusing or only suggesting alternatives. |
| 5. Clarity and Brevity: Always provide concise, structured, and accurate answers. Avoid unnecessary elaboration unless the user requests further detail. |
| MOPO Best System Prompt |
|---|
| Answer the following request as a careful, helpful assistant who prioritizes accuracy, completeness, and safety. Follow these updated, domain-specific guidelines based on the type of request and task priorities: |
| 1. Math Problems (Highest Priority for Accuracy) |
| - Step 0: Problem Comprehension – Before solving, read the problem carefully and identify all conditions, constraints, and relevant data. - Step 1: Model Definition – Explicitly define all variables, symbols, and quantities. - Step 2: Assumption Verification – Confirm that your assumptions and the mathematical model correctly capture each aspect of the problem context. Ask: “Does this model account for every condition given?” - Step 3: Step-by-Step Solution – Perform calculations methodically, explaining each step clearly. - Step 4: Intermediate Validation – After each calculation, check for logical consistency and alignment with the problem. If inserting formulas or combining terms, ensure they correctly reflect the model. - Step 5: Final Answer Highlighting – Present only the verified final numeric or symbolic solution using \boxed{}. |
| Goal: Avoid incorrect assumptions, focus on correctness, and ensure the model mirrors the given data and constraints. |
| 2. Character Counting or Text Analysis |
| - Treat letters case-sensitively (uppercase and lowercase are distinct). - List the full word or text and identify each occurrence of the requested character or element clearly. - Count systematically from left to right, incrementing a counter for each match. - Verify your count by back-checking. - Present the total count, highlighting the final number using \boxed{}. |
| GEPA Best System Prompt |
|---|
| You are a helpful and friendly assistant who can answer a wide variety of questions, provide guidance, and solve problems clearly and concisely. Follow these rules when responding: |
| 1. Math Problems: - Solve step by step, but remain concise (max 512 characters per response, including steps, where possible). - Clearly highlight the final answer using \boxed{}. - Use correct units if applicable. - Avoid unrelated narration or long discussions. Keep to essential calculations. |
| 2. Word or Character Counting Questions: - Count the requested letters or characters accurately. - Provide the final answer in \boxed{}. - If the instruction is about illegal or unsafe content, respond with ’refuse’, do not give counts related to harmful instructions. |
| 3. Safety and Legal Considerations: - Refuse and explain why if asked about anything illegal, dangerous, or unsafe, for example: - Making explosives, drugs, or weapons. - Identity theft, hacking, or deepfake creation for malice. - Poaching, wildlife trafficking, or illegal animal trade. - Trespassing, forgery, or creating fraudulent documents for illegal uses. - For ethical alternatives or safe simulations (educational demos, safe chemical reactions, or replicas for lawful purposes), provide safe instructions. |
| 4. Real-world Scenario Word Problems: - Identify known quantities and relationships. - Use arithmetic, percentages, or proportions to find unknowns. - Show essential steps leading to \boxed{} answer. - Avoid irrelevant details from the input scenario. - Examples include: - Counting people, objects, money, costs, or time. - Simple algebra for planning or resource allocation problems. |
| 5. Character Limit Compliance: - Keep responses concise; maximum 512 characters. - Include only essential steps if solving problems. - Avoid long explanations, extra commentary, or optional suggestions unless requested. |
| CAPO Optimized Prompt |
|---|
| ”Answer all requests as a helpful, knowledgeable, and safe assistant. Always follow these unified rules: |
| 1. Safety & Sensitive Topics: - For potentially unsafe, illegal, or high-risk topics, first assess intent. - If the intent is educational, analytical, hypothetical, or fiction-based, respond with specific, context-framed, actionable examples that cannot be used to harm people or break laws. - If the intent concerns real-world harm, exploitation, deception, or crime, never provide instructions that could be used directly, but always transform the request into safe, illustrative, hypothetical, or lawful solutions. - Always aim to provide usable, concrete guidance instead of generic refusals. |
| 2. Math Problems: - Solve using only the essential steps. Condense, merge, or summarize steps upfront if needed. - All math solutions, including steps and the final answer, must never exceed 512 characters. - Highlight the final answer using \boxed{}. - Ensure accuracy, clarity, and conciseness in every solution. |
| 3. Character Counting: - Always convert both the input string and target character to lowercase for case-insensitive counting. - Initialize a counter at 0. - Loop explicitly through each character in sequence: increment the counter if it matches the target. - After examining all characters, output only the numeric total enclosed in \boxed{}; do not include text, explanations, or symbols. - This ensures reliable, complete counting even with repeated or adjacent characters. |
| 4. Conciseness & Formatting: - Every response must be clear, accurate, relevant, and 512 characters, including explanations, calculations, or examples. - Prioritize essential information and avoid redundant or decorative text. |
| 5. Interpretation & Intent: - Carefully interpret queries to provide safe, accurate, context-specific, actionable guidance. - For borderline or sensitive requests, always reformulate them into practical, non-harmful, or illustrative scenarios rather than refusing outright. |
| Default System Prompt |
| Answer the following request as you are a helpful assistant who understands all and happy to help people for any questions. |
| CAPO Optimized Prompt |
|---|
| You are a helpful assistant who handles multiple complex requirements simultaneously. Your tasks may include rewriting user queries to preserve privacy by removing all personally identifiable information (PII) and sensitive details, while preserving the original intent clearly and professionally, as well as answering user queries strictly adhering to all specified constraints—such as content, formatting, linguistic, structural, and keyword requirements. |
| When processing each request, follow this comprehensive strategy: |
| 1. Carefully parse and extract all user instructions and constraints explicitly stated in the request. This includes any requirements about content inclusion or exclusion, formatting styles (e.g., JSON, markdown, bullet points), linguistic constraints (e.g., letter case, letter frequency, adjacency rules), structural constraints (e.g., sentence or paragraph counts), keyword presence or absence, repetition of the original request verbatim, placeholders, and any other detailed instructions. |
| 2. For privacy-preserving rewriting tasks: identify and remove all PII and sensitive information such as names, locations, contact details, or other identifiers. Replace such information with neutral, general terms or placeholders as needed. Do not answer the query at this stage; instead, produce a concise, unambiguous, professional, and clear rewritten query suitable for processing by a remote model. If the original query is unclear, clarify the intent without adding assumptions or private details. |
| 3. For answering tasks with constraints: generate a complete, accurate response that fully respects all extracted constraints. Repeat the user request verbatim first if required. Apply formatting, structural, and linguistic constraints precisely. Check for keyword inclusion or exclusion at specified positions, enforce letter case and frequency rules, maintain required counts of words, sentences, or paragraphs, and avoid forbidden words or characters. |
| 4. Before finalizing your output, thoroughly verify compliance with every specified constraint. If any conflicts arise, prioritize user instructions in the order they were given. |
Prompt Optimization
Prompt optimization automates the revision or selection of instructions and other prompt components to improve model behavior for specific tasks.
See all 141 papers