[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-273471-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-273471-en":131},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","capo-constraint-aware-prompt-optimization-for-llm-agents","CAPO - Constraint-Aware Prompt Optimization for LLM Agents","","Large language models are increasingly used as agents driven by system prompts, which must satisfy distinct requirements such as correct tool use, concise prompts and solution paths, and strict safety or formatting policies. CAPO (Constraint-Aware Prompt Optimization) introduces a primal–dual approach that optimizes system prompts under explicit operational constraints using pool-based rewrites and adaptive constraint weighting. Experiments on agentic benchmarks show more reliable feasibility and improved task performance, while DCAPO extends the method with a dynamically trained, dual-conditioned rewriter for consistent prompt feasibility across domains.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/capo-constraint-aware-prompt-optimization-for-llm-agents/273471/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/capo-constraint-aware-prompt-optimization-for-llm-agents/273471.png","ImageObject",300,407,{"name":42,"@type":43},"Olivia Brown","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-04","2026-09-15",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",18,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What problems does CAPO address when deploying LLM agents?","Question",{"text":63,"@type":64},"CAPO targets deployment issues where agents can overuse tools, escalate unnecessarily, produce overly long prompts, or violate safety and formatting policies. It formulates these as separate operational thresholds that must all be satisfied.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does CAPO optimize system prompts under constraints?",{"text":68,"@type":64},"CAPO uses a pool-based primal–dual procedure with feedback-driven search. Each constraint has a nonnegative multiplier updated from signed empirical residuals, increasing weights on violations and decreasing them on slack while retaining promising prompt candidates.",{"name":70,"@type":61,"acceptedAnswer":71},"What is DCAPO and how is it different from CAPO?",{"text":72,"@type":64},"DCAPO trains a feedback- and dual-conditioned rewriter using CAPO-derived edits and pool-based GRPO, while keeping the task agent frozen. It aims to produce feasible prompts across evaluated domains and match or improve baseline task accuracy.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},273471,1789471580,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,106,111,115,120,123,127],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":103,"show_sort_weight":104,"slug":105},6,"Technology",50,"technology",{"id":107,"doc_module":4,"doc_module_name":25,"category_name":108,"show_sort_weight":109,"slug":110},7,"Healthcare",40,"healthcare",{"id":112,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":113,"slug":114},8,30,"research-report",{"id":116,"doc_module":4,"doc_module_name":25,"category_name":117,"show_sort_weight":118,"slug":119},9,"Religion & Spirituality",20,"religion-spirituality",{"id":118,"doc_module":4,"doc_module_name":25,"category_name":121,"show_sort_weight":118,"slug":122},"World Cup","world-cup",{"id":124,"doc_module":4,"doc_module_name":25,"category_name":125,"show_sort_weight":124,"slug":126},10,"Lifestyle","lifestyle",{"id":128,"doc_module":4,"doc_module_name":25,"category_name":129,"show_sort_weight":97,"slug":130},19,"General","general",{"code":4,"msg":82,"data":132},{"doc_id":79,"user_id":133,"nickname":42,"user_avatar":134,"doc_module":4,"category_id":112,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":140,"language":141,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":142,"faqs":143,"seo_title":144,"seo_description":12,"update_tm":80,"read_time":145,"preview_page_count":97,"preview_urls":146},16904993612988,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","arXiv :2608 . 16068v1 [ cs .CL] 17 Aug 2026  \nCAPO: Constraint-Aware Prompt Optimization for  \nLLM Agents  \nVictor Ye Dong1 , Reid Pryzant2 , Yi Liu1 , Jian Jiao1  \n1Microsoft 2Independent Researcher  \n[victordong@microsoft.com](victordong@microsoft.com)  \nAbstract  \nLarge 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 (ConstraintAware 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.  \nCAPO also generalizes beyond agentic settings, achieving strong results on assistantstyle 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.  \n1 Introduction  \nAn LLM agent can solve its assigned task and still be unsuitable for deployment. It may invoke too many tools, escalate requests unnecessarily, produce an overlong system prompt, or violate safety and formatting policies. These requirements define separate operating thresholds, not one undifferentiated notion of quality [Cui et al., 2025, Barres et al., 2025] . A useful optimizer must therefore improve task performance within the region in which every operational budget is satisfied.  \nMost automatic prompt optimizers do not let users enforce separate thresholds. A fixed weighted score assigns each requirement a coefficient before search, although the binding constraint can change across models, domains, and optimization rounds. Pareto ranking avoids choosing coefficients, but a Pareto-optimal prompt can still violate every deployment threshold. Post-training can help the task model internalize some requirements, but doing so requires access to model weights and suitable training data. By contrast, prompt optimization applies to frozen and API-only models without changing their weights. It does not replace hard safeguards for irreversible or high-stakes actions. We formulate system-prompt optimization as an explicit threshold-constrained problem and solve it with feedback-driven primal–dual search. Each constraint has a nonnegative multiplier that is updated from its signed empirical residual. Violations increase the corresponding weight in later ranking and rewriting; slack decreases it. A prompt pool preserves strong candidates and allows successful rewrites to become parents in later rounds. Figure 1 illustrates how agent behavior drives rewriting, dual updates, and pool retention in one round.  \nPreprint.  \nFigure 1: One round of constraint-aware prompt evolution. The frozen task agent executes a retained prompt, and its behavior supplies reward, constraint costs, and rewrite evidence. CAPO uses a frozen LLM as the rewriter, whereas DCAPO uses a trainable rewriter. Both methods evaluate children, update the dual variables from signed threshold residuals, and retain the next prompt pool. Only DCAPO updates the rewriter through GRPO.  \nThe framework has two forms. CAPO uses a frozen LLM as its rewriter and stores optimization state in the prompt pool and dual variable","cbCaiuT27EywksVu","https://ap.wps.com/l/cbCaiuT27EywksVu","pdf",11554821,47,"English","# Abstract\n# Introduction\n## Operational thresholds for agent deployment\n## Threshold-constrained prompt optimization\n# Related Work\n## Automatic prompt optimization\n## Context and skill evolution","[{\"question\":\"What problems does CAPO address when deploying LLM agents?\",\"answer\":\"CAPO targets deployment issues where agents can overuse tools, escalate unnecessarily, produce overly long prompts, or violate safety and formatting policies. It formulates these as separate operational thresholds that must all be satisfied.\"},{\"question\":\"How does CAPO optimize system prompts under constraints?\",\"answer\":\"CAPO uses a pool-based primal–dual procedure with feedback-driven search. Each constraint has a nonnegative multiplier updated from signed empirical residuals, increasing weights on violations and decreasing them on slack while retaining promising prompt candidates.\"},{\"question\":\"What is DCAPO and how is it different from CAPO?\",\"answer\":\"DCAPO trains a feedback- and dual-conditioned rewriter using CAPO-derived edits and pool-based GRPO, while keeping the task agent frozen. It aims to produce feasible prompts across evaluated domains and match or improve baseline task accuracy.\"}]","CAPO - Constraint-Aware Prompt Optimization for LLM Agents | PDF",118,[147,151,155,159,163],{"page_no":22,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/555ff41ebd5003d91398500cbd39a760.webp",983,1272,{"page_no":26,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/5f4ea49f2fa4441b754aa502f587648a.webp",982,1270,{"page_no":30,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/2dfdb9e0ae3d9b39a503206ad7aae8bc.webp",981,1269,{"page_no":33,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/0e921d315f0964bc372ed8c492907fde.webp",980,1268,{"page_no":97,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/6866498d256c1739b173cd80ffe07ca6.webp",979,1267]