SHarP: Saliency-based Pruning of Agent Harnesses
Organizations: University of California, Santa Barbara · MIT-IBM Watson AI Lab · Adobe Research
Abstract
Agent harnesses are systems that coordinate model calls, tool use, and task execution to help large language models complete complex tasks. To meet task requirements and address failures, these systems are often iteratively refined by amending and patching their instructions, tools, and workflows, continuously increasing harness complexity. It is therefore unclear whether some resulting harness modules are redundant, introducing substantial token overhead with little, if any, performance gain. Inspired by neural network pruning, in this paper, we study harness pruning as a means of striking a better balance between task performance and token cost. We propose SHarP (Saliency-based Harness Pruning), a simple yet effective pruning strategy based on the saliency of each harness module with respect to performance and efficiency. Specifically, we first identify tools, instructions, and supporting mechanisms as components that can be individually disabled. We then estimate the saliency of each module by ablating it and assessing its task performance and token cost relative to the full set of single-module ablations. Modules with the smallest contribution to performance or largest computational overhead are subsequently pruned. Our evaluation across various harnesses on held-out validation sets reveals a surprising finding: most harnesses that we studied are highly redundant and can maintain comparable performance and efficiency even after a substantial portion of their modules are pruned. Our pruning approach and empirical findings provide new perspectives on agent harness design and optimization.
Figures & tables
| JIT agentfold / DeepPlanning-Shopping | LIFE-harness / -bench retail | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Performance-oriented | Efficiency-oriented | Performance-oriented | Efficiency-oriented | ||||||||
| Config. | Config. | Config. | Config. | ||||||||
| (full) | 75.8 | 324 | (full) | 75.8 | 324 | (full) | 67.5 | 121 | (full) | 67.5 | 121 |
| 77.7 | 278 | 76.2 | 197 | 80.0 | 118 | 72.5 | 115 | ||||
| 82.5 | 305 | 67.2 | 196 | 72.5 | 117 | 87.5 | 118 | ||||
| 76.9 | 219 | 71.9 | 198 | 75.0 | 114 | 80.0 | 105 | ||||
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Module | Function | Disabling notes |
| Paper search tool | Searches for papers to add to the available document collection. | – |
| Evidence gathering tool | Collects question-relevant evidence from the available papers. | – |
| Answer generation tool | Synthesizes an answer using the collected evidence. | – |
| Reset tool | Clears collected evidence so the agent can gather new evidence. | – |
| Completion tool | Ends the agent loop using the latest proposed answer. | – |
| Agent system prompt | Supplies the agent’s system-level instructions. | – |
| Module | Function | Disabling notes |
|---|---|---|
| Terminal tool | Executes shell commands in the workspace. | – |
| Finish tool | Submits the final response and ends the agent loop. | – |
| Think tool | Records a reasoning step without changing the environment. | – |
| Browser tools | Navigate and interact with web pages, with accompanying usage guidance. | – |
| Fetch tool | Retrieves web content from a URL. | – |
| Search tool | Searches the web for relevant information. | – |
| Module | Function | Disabling notes |
|---|---|---|
| Initial planning | Generates a plan with goals and candidate solution paths. | Starts without an initial plan; the step budget is unchanged. |
| Periodic replanning | Reviews progress and updates the plan every eight steps. | – |
| History folding | Replaces selected ranges of past steps with model-generated summaries. | Keeps the original history instead of applying requested summaries. |
| Forced final answer | Makes a final answer-generation call when the step limit is reached. | Returns an empty answer if the loop ends without a submitted answer. |
| Lenient JSON parsing | Repairs malformed action JSON. | Uses strict parsing. |
| Task restatement | Repeats the original task in each step prompt. | – |
| Module | Function | Disabling notes |
|---|---|---|
| Booking payment limits | Checks the permitted numbers of certificates, credit cards, and gift cards. | – |
| Booking itinerary check | Checks that flight legs form a connected itinerary with the required endpoints. | – |
| Cancellation eligibility | Checks cancellation conditions and whether flights have already departed. | – |
| Basic-economy changes | Blocks flight changes that violate basic-economy restrictions. | – |
| Compensation eligibility | Checks membership, cabin, or insurance eligibility for compensation. | – |
| Route preservation | Blocks changes to the reservation’s origin or destination. | – |
| Module | Function | Disabling notes |
|---|---|---|
| Cancellation status check | Restricts cancellation to pending orders. | – |
| Item-modification status check | Restricts item changes to orders still eligible for modification. | – |
| Exchange status check | Restricts exchanges to eligible delivered orders. | – |
| Return eligibility check | Checks delivered status and the permitted refund method. | – |
| Cancellation reason check | Checks that the cancellation reason is an accepted value. | – |
| Payment-change check | Requires the new payment method to differ from the current one. | – |
| Benchmark | Harness | Development | Validation | |
|---|---|---|---|---|
| GAIA | OpenHands | 50 | 60 | 27 |
| LitQA2 | PaperQA2 | 50 | 38 | 18 |
| -bench airline | LIFE-harness | 30 | 20 | 44 |
| -bench retail | LIFE-harness | 48 | 40 | 48 |
| DeepPlanning-Shopping | JIT agentfold | 50 | 30 | 23 |
| Model: Qwen3.5-122B-A10B-FP8; inference engine: vLLM; thinking: disabled | |||
| Typical deployment: or NVIDIA H100 GPUs with tensor parallelism | |||
| Harness / benchmark | Temperature | Max output tokens | Execution budget |
| OpenHands / GAIA | 0.7 | – | 30 iterations |
| PaperQA2 / LitQA2 | 0 | 4,096 | 500 seconds |
| LIFE-harness / Airline | 0 | 16,384 | 200 steps |
| LIFE-harness / Retail | 0 | 16,384 | 200 steps |
| Harness | Included token usage |
|---|---|
| OpenHands | Model input and output tokens recorded by the SDK during task execution, including recorded delegated-agent calls. |
| PaperQA2 | Model input and output tokens in the question-answering session’s token counts. Offline corpus preprocessing and index construction are excluded. |
| LIFE-harness | Agent and user-simulator model calls. The separate evaluation judge is excluded. |
| JIT agentfold | All model calls made by the harness during the task, including planning, action generation, and history compression when enabled. |
| Module disabled | ||||
|---|---|---|---|---|
| Initial planning | 73.70 | 328.7 | 0.737 | 0.539 |
| Periodic replanning | 67.97 | 367.0 | 0.028 | 0.075 |
| History folding | 76.40 | 535.1 | 0.923 | |
| Forced final answer | 71.13 | 359.2 | 0.314 | 0.058 |
| Lenient JSON parsing | 71.50 | 325.6 | 0.344 | 0.599 |
| Task restatement | 67.23 | 315.8 | 0.023 | 0.832 |
| Module disabled | ||||
|---|---|---|---|---|
| Paper search tool | 0.00 | 1318.1 | ||
| Evidence gathering tool | 38.00 | 1466.1 | 0.664 | |
| Answer generation tool | 0.00 | 1232.2 | ||
| Reset tool | 42.00 | 184.0 | 0.887 | 0.215 |
| Completion tool | 80.00 | 997.9 | 1.000 | |
| Agent system prompt | 42.00 | 311.3 | 0.936 | 0.072 |
| Module disabled | ||||
|---|---|---|---|---|
| Terminal tool | 50.00 | 576.6 | 0.084 | 0.005 |
| Finish tool | 58.00 | 470.1 | 0.371 | 0.481 |
| Think tool | 60.00 | 483.0 | 0.500 | 0.330 |
| Browser tools | 62.00 | 480.4 | 0.670 | 0.347 |
| Fetch tool | 54.00 | 514.8 | 0.042 | 0.069 |
| Search tool | 44.00 | 639.9 | 0.022 | 0.003 |
| Module disabled | ||||
|---|---|---|---|---|
| Booking payment limits | 86.67 | 131.6 | 0.837 | 0.024 |
| Booking itinerary check | 83.33 | 112.4 | 1.000 | 0.760 |
| Cancellation eligibility | 83.33 | 117.3 | 0.500 | 0.501 |
| Basic-economy changes | 86.67 | 120.6 | 0.837 | 0.267 |
| Compensation eligibility | 83.33 | 120.2 | 0.500 | 0.375 |
| Route preservation | 83.33 | 121.1 | 1.000 | 0.319 |
| Module disabled | ||||
|---|---|---|---|---|
| Cancellation status check | 81.25 | 124.0 | 0.210 | 0.304 |
| Item-modification status check | 79.17 | 122.0 | 0.091 | 0.551 |
| Exchange status check | 77.08 | 123.0 | 0.052 | 0.413 |
| Return eligibility check | 72.92 | 123.9 | 0.016 | 0.274 |
| Cancellation reason check | 79.17 | 127.0 | 0.131 | 0.098 |
| Payment-change check | 77.08 | 129.5 | 0.022 | 0.095 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 76.10 | 329.1 |
| Shopping requirements; Shopping cost strategy; Code execution | 74.31 | 204.3 | |
| Lenient JSON parsing; Tool-selection guidance; Final-answer guidance | 70.40 | 203.8 | |
| Tool-list summary; Plan-execution guidance; Initial planning | 75.96 | 192.0 | |
| Shopping output guidance; Compression guidance; Result-processing guidance | 73.38 | 195.0 | |
| Role preamble; Planning-model guidance; General action rules | 74.10 | 215.2 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 75.83 | 323.7 |
| Initial planning | 77.66 | 278.3 | |
| Plan-execution guidance; Role preamble; Result-processing guidance | 82.49 | 304.6 | |
| Compression guidance; Code execution; Shopping cost strategy | 76.88 | 219.1 | |
| Shopping output guidance; Forced final answer; Lenient JSON parsing | 72.66 | 222.8 | |
| Planning-model guidance; Shopping requirements; Final-answer guidance | 70.66 | 265.1 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 61.40 | 1256.6 |
| Multimodal processing; Citation metadata context; Increased evidence depth | 56.14 | 1108.4 | |
| Reset tool; Structured evidence output; Answer iteration | 50.88 | 1651.2 | |
| Increased concurrency; Larger text chunks; Automatic evidence gathering | 42.98 | 1728.6 | |
| Evidence retrieval; Agent system prompt; Document metadata extraction | 52.63 | 2004.0 | |
| (protected) | Completion tool; Evidence gathering tool; Workflow guidance | 0.00 | 5915.0 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 29.44 | 799.4 |
| Version-control guidance; File editor; Skills (microagents) | 32.78 | 691.8 | |
| Risk-assessment guidance; Memory guidance; Documentation guidance | 32.78 | 675.4 | |
| Introductory prompt; Finish tool; External-service guidance | 33.89 | 683.3 | |
| Browser tools; Pull-request guidance; Code-quality guidance | 30.56 | 654.2 | |
| Troubleshooting guidance; Environment-setup guidance; Think tool | 29.44 | 663.0 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 83.33 | 138.7 |
| Agent instructions; Reservation flight summary | 78.33 | 124.0 | |
| Updated baggage allowance; Booking hint; Booking itinerary check | 81.67 | 111.4 | |
| Cancellation refund summary; Cancellation eligibility; Other-reservations skill | 80.00 | 113.2 | |
| Booking payment total; Compensation amount check; Direct-flight search hint | 81.67 | 114.5 | |
| Reservation payment summary; Compensation eligibility; Cancellation-check skill | 81.67 | 107.7 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 75.00 | 119.1 |
| Order-address hint; Return hint | 79.17 | 116.4 | |
| Item availability note; Item-modification hint; Repeated-failure alert | 82.50 | 113.6 | |
| Cancellation hint; Pending-replacement skill; Agent instructions | 76.67 | 106.9 | |
| Return item check; Cancellation refund summary; Replacement existence check | 79.17 | 106.9 | |
| Nonempty replacement list; Payment balance check; Item-modification status check | 70.00 | 110.5 |
| Config. | Modules removed | ||
|---|---|---|---|
| (full) | None | 67.50 | 121.2 |
| Replacement existence check; Payment-change hint | 77.50 | 116.3 | |
| Return hint; Nonempty replacement list; Payment balance check | 80.00 | 118.4 | |
| Item-list length check; Numeric-option extrema; Item-modification hint | 75.00 | 116.5 | |
| Return item check; Pending-replacement skill; Address-history skill | 72.50 | 117.2 | |
| Cancellation status check; Modification product-type check; Transfer hint | 70.00 | 116.1 |
Agent Harness Optimization
Agent harness optimization improves the prompts, tools, memory, workflows, and control code that shape how AI agents act.
See all 183 papers