Optimize the Harness, Not the Model: Fitting a Minimal Agent to a Self-Hostable LLM for Investigative Analysis
Organizations: Dream Security, Tel Aviv, Israel
Abstract
Government intelligence teams need LLM agents that can analyze large, messy evidence collections, but security and cost constraints often rule out hosted frontier models and broad, hard-to-audit tool surfaces. We report CLEO: Constrained Loop for Environment Optimization, a method for fitting a minimal agent harness to a fixed, self-hostable LLM. Given an expert-validated dataset, CLEO admits only the tools, guardrails, memory policies, and loop components that improve accuracy while remaining general and auditable. On our held-out dataset, the CLEO harness reaches an 83.8% pass rate, within 1.2 points of the strongest out-of-the-box Claude Code SDK baseline, while being two orders of magnitude smaller.
Figures & tables
| Harness | LOC | Pass | Soft | Lat. |
|---|---|---|---|---|
| Claude Code SDK (bare) | 512k 1 1 1 The SDK is closed-source and distributed minified, so no exact source-line count is publicly verifiable. The 512k figure is the one widely reported following the 2026 source-map disclosure; we could not independently verify it. | 85.0% | 8.48 2.25 | 76s |
| PI #1 (bare) | 75k | 80.8% | 8.12 2.70 | 126s |
| PI #2 (CLEO’s full prompts) | 75k | 83.8% | 8.45 2.39 | 121s |
| CLEO | 3k | 83.8% | 8.41 2.51 | 114s |
LLM Agent Harnesses
LLM agent harnesses are the software and runtime systems that organize an agent’s tools, context, state, execution, and safeguards.
See all 406 papers