# Evaluating your Agentic Harnesses

By Bruno Gonçalves, Aug 12, 2026. Published at https://data4sci.com/blog/evaluating-your-agentic-harnesses

> One good demo is a test flight. An eval suite is the flight-test campaign: pass rates, cost, latency, and failure modes.

In [previous](https://data4sci.com/blog/building-a-basic-agentic-harness) [posts](https://data4sci.com/blog/building-an-advanced-agentic-harness), we borrowed Col. John Boyd’s OODA loop, built a “figher jet” harness around an LLM and even scaled from a single pilot to an air campaign with mission planners, squadrons flying independent sorties in parallel, fuel budgets, and a flight recorder. Now the pilot has returned to base and is time for a debrief.

No Air Force declares an aircraft combat-ready without it going through operational test and evaluation: flying against representative missions (including missions designed to break it) record everything, and compare the numbers against the requirements. Production level agents deserve nothing less, but almost never get it. Successful demos prove nothing more than the harness *can* work, but it takes an **eval suite** to demostrate that it *usually* works while quantifying the consequences of when it doesn’t.

We moved the entire harness (including typed tools, the plan DAG, the parallel executor, multi-tier memory, the verification hierarchy, multi-dimensional budgets, structured tracing, and the `Orchestrator` ) into a standalone module, `d4sci_harness.py` so that you can import it instead of rebuilding it:

```python
import d4sci_harness as dh
from d4sci_harness import TOOLS, MemoryStore, Orchestrator

llm = dh.set_provider("anthropic")   # or "mock" for offline runs

store = MemoryStore()
orch = Orchestrator(provider=llm, tools=TOOLS, memory=store)
```

The harness supports both a fully offline and deterministic `mock` backend, perfect for CI, and and an `anthropic` backend that gives you realistic planner, summarizer, and critic behavior. Switching backends is a one-line change. The rest of this post is based on live Claude runs.

## Bare bones eval harness

Even a minimalistic eval unit should track a few useful metrics:

- **Pass rate:** Functional correctness across tasks

- **Token usage:** Cost predictability

- **Status codes:** Failure mode distribution (`failed_execute` vs `failed_verify` vs `budget`)

- **Replan count** : Robustness to bad inputs

The suite itself is a mix of correct and adversarial tasks aimed at exploring all code paths. In this example, we use three well-posed requests, and one that we expect to fail so that we can measure the recovery path:

```python
EVAL_SUITE = [
    {"goal": "Build a comparison report of Paris, Tokyo, and New York.",
     "required_cities": ["paris", "tokyo", "new york"]},
    {"goal": "Build a comparison report of London and Sydney.",
     "required_cities": ["london", "sydney"]},
    {"goal": "Build a comparison report of Paris and London.",
     "required_cities": ["paris", "london"]},

    # Atlantis is not in CITY_FACTS — this task exercises the
    # re-planning path, so we only require the satisfiable city
    {"goal": "Build a comparison report of Paris and Atlantis.",
     "required_cities": ["paris"]},
]
```

We loop through each task and extract the metrics out of the `RunResult` object our orchestrator returns:

```python
async def run_eval(orch, suite):
    rows, runs = [], []
    for task in suite:
        res = await orch.run(task["goal"], task["required_cities"])
        runs.append(res)
        rows.append({
            "passed":  bool(res.verdict and res.verdict.passed),
            "status":  res.status,
            "replans": res.replan_count,
            "tokens":  res.budget.tokens_used,
            "cost":    res.budget.cost_usd,
            "tier":    res.verdict.tier if res.verdict else "n/a",
        })
    return rows, runs
```

And visualize the results in a simple table:

![Results table for four tasks with columns for passed, status, replans, tokens, time, cost and tier. Three tasks pass with status ok; Paris and Atlantis fails with one replan.](https://data4sci.com/assets/blog/6cfa0835-1211-4a82-975e-4d3542728128_1768x332.webp)

An overall pass rate of 75% and an average of 1,088 tokens and $0.0033 per task. Doesn’t seem too bad. We expect a pass rate below 100% as one task is expected to fail, and update the\*\*\*\*`status` column with the cause of the failure (`failed_verify` vs `failed_execute`). Different problems require different solutions. The ill fated Atlantis task triggered one replan, as expected, confirming the recovery path was triggered correctly.

Paris is the only required city in the Atlantis task and is present in the report but the **LLM judge** , the last rung of the verification hierarchy, refused to call a one-city document a “comparison report of Paris and Atlantis”. This is the kind of nuance that LLMs excel at and that we catch because the eval records the tier that produced the verdict.

This suite is intentionally minimal but we architectured in a way that makes it flexible enough to be easily expanded.

## A closer look at the flight recorder

The `RunResult` objects that the eval loop collects contain all the information we need, making it easy to provide useful visualizations.

We start by looking at the API costs. The Atlantis run is the most expensive of the four. It requires two rounds of planning and every tool call it makes along the way. Failure has a price tag!

![Horizontal bar chart of estimated cost in USD for four tasks. The three passed tasks, in green, cost about $0.0028 to $0.0037; the failed Paris and Atlantis bar, in red, is slightly the longest.](https://data4sci.com/assets/blog/15da38d5-c2f0-4509-bf88-2c1cfc6adcb6_3684x2484.webp)

Next, we look at the run time of the various tasks. The stacked segments sum the total work each run performed. The diamond marks actual wall-clock time.

![Stacked horizontal bar chart of seconds per task, split into planner, worker and critic, with a diamond for wall-clock time. Worker is the largest segment; each diamond sits short of the bar's end.](https://data4sci.com/assets/blog/44e57eee-4f50-43cf-9fbd-950a70c445f0_3684x2484.webp)

The gap between the bars and the diamond is the payoff we get for the parallelism we baked in from the ground up. Worker segments dominate across all tasks as calling tools and processing their output takes the most time.

The various roles also required different amounts of tokens. Re-planning shows up as a wider planner segment; a report-heavy task shows up as a wider worker segment. Any change to the harness will directly impact these numbers, so we should be on the lookout for unexpected changes.

![Horizontal stacked bar chart of estimated tokens for four tasks, split into planner, worker and critic. The worker segment dominates every bar, and totals run from about 1,050 to 1,330 tokens.](https://data4sci.com/assets/blog/f120978c-12f2-4392-8cb6-4c6fa118c269_3706x2484.webp)

Finally, we analyze the budget pressure. Whenever it crosses 0.9, the orchestrator skips the LLM judge and falls back to the free deterministic check. All four trajectories stay comfortably low on this toy workload but a production dashboard should alert you when a task class starts drifting upward.

![Line chart of budget pressure by step for four tasks. Every line climbs gradually from below 0.1 to at most about 0.33, far under the dashed degradation threshold drawn at 0.9.](https://data4sci.com/assets/blog/16b52d88-8da0-410c-a2e8-a0e5dbfd49a7_3684x2484.webp)

## Closing the gaps

Logging performance metrics from day one not only allows us detect when something goes wrong, but it also pays dividends when it’s time to make changes to our system. In the remainder of this post, we close three of the gaps that separate a toy harness from production systems, each with minimal changes to the architecture. Each enhancement includes its own mini-eval so that we have a clear picture of the impact each change has.

![Table of three enhancements, re-planning on failure, real embeddings and specialized workers, with columns for the production motivation and what changes in code for each.](https://data4sci.com/assets/blog/e83ba8dc-5571-48f6-8f07-635196360db8_1658x276.webp)

### Re-planning on failure

In our eval suite, when the user asks for a report including Atlantis, the population lookup raises `KeyError: Unknown city`. Let us remember what happens next:

1. The worker marks the node `FAILED.`

2. `classify_error()` returns `MISSING_INFO`.

3. The orchestrator calls `planner.replan(goal, failed_dag)` with the failure context.

4. The planner emits a new DAG excluding Atlantis.

5. The worker executes the amended plan.

We pass the failure context to the planner to avoid getting stuck in a loop doing the same error over and over again. In this way the LLM has all the information it needs to reason about alternatives: skip the city, substitute a known one, or fall back to a different tool. Here’s the real trace:

```python
Status:        failed_verify_replanned_1x
Replan count:  1
Tokens used:   1802
Tool calls:    16
Planning attempts: 2
    Attempt 1: initial_plan → 10 nodes
    Attempt 2: replan       →  7 nodes
```

The first plan had 10 nodes, Atlantis included. After the fetch failed, the amended plan shrank to 7 nodes covering only the cities that exist, so we can still deliver value instead of simply aborting on bad input.

With Atlantis gone, the final report node depends only on the six nodes that can actually succeed:

![Diagram of the amended plan after re-planning: six completed wave 0 nodes, population, timezone and summary for Paris and Tokyo, each point to a single wave 1 report node, aggregate\_report.](https://data4sci.com/assets/blog/3ec5b84d-2e81-45b2-8b2e-7da5a5554213_1108x1245.webp)

The per-step trace tells the whole story in one picture: every event on its own row, colored by role, and ordered chronologically. The second planner row (in blue) naturally separates the two plans. Everything above it belongs to the original failed plan, everything below to the amended one.

![Dot plot of latency in seconds for each step of the run, top to bottom, colored by planner, worker and critic. Lookups sit near zero; planning and summarize steps take about 1 to 2.5 seconds.](https://data4sci.com/assets/blog/b59c8e0b-f045-4da8-976b-ed9d198442bb_5844x2844.webp)

### Real embeddings

Our memory store had been retrieving with [Jaccard similarity](https://en.wikipedia.org/wiki/Jaccard_index) that simply measures word overlap. Jaccard fails exactly when it would be the most useful, when the query and the memory use different vocabulary. For example, a query “Tell me about famous landmarks in France” would never match “Paris is known for the Eiffel Tower” as they have a Jaccard score close to zero due to not having any shared words (beyond stopwords).

Embeddings are a different way of representing text. Embedding models map text to dense vectors that encode the semantic meaning of the text: snippets that mean the same thing will have similar embedding vectors. The similarity between two snippets can then be estimated using the [cosine of the two embedding vectors](https://en.wikipedia.org/wiki/Cosine_similarity).

We use the [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) embedding model to generate our embeddings. This model produces good quality embeddings vectors with 384 dimensions and is small enough to run locally. The cost for encoding the knowledge base is paid only once on `add()` and is amortized over time. At query time we only need to encode the query and compute the cosine similarity at query time, two relatively cheap operations, and if anything fails, we can fallback to Jaccard.

Let’s compare identical queries against both version, each with the memory its ideal answer should surface:

```python
Query: Tell me about famous landmarks in France
  Jaccard    ✗  Tokyo has the busiest train stations in the w | New York is famous for Times Square and Broad
  Embeddings ✓  Paris is known for the Eiffel Tower and Frenc | London's Big Ben is an iconic landmark.

Query: What happened when comparing cities in Europe?
  Jaccard    ✗  Task comparing Asian cities succeeded with al | Tokyo has the busiest train stations in the w
  Embeddings ✓  Task comparing Asian cities succeeded with al | Previously compared European cities and found

Query: Information about Japanese cities
  Jaccard    ✗  Task comparing Asian cities succeeded with al | Previously compared European cities and found
  Embeddings ✓  Tokyo has the busiest train stations in the w | Task comparing Asian cities succeeded with al
```

The results are clear: 3-nil for Embeddings. We visualize the similarity of every query against every memory, using both similarity functions. The best score per row is highlighted in bold:

![Two heatmaps of similarity between three queries (rows) and seven memories (columns). Jaccard scores never exceed 0.14, while cosine similarity of embeddings reaches 0.60.](https://data4sci.com/assets/blog/61308330-cffd-40e5-9607-18a3b706b5ac_5844x2244.webp)

Jaccard scores are near zero everywhere as simple word overlap can’t handle paraphrasing. On the other hand, the cosine similarity of embeddings ranks the correct memory first in every row.

### Specialized workers

Different tools will have different requirements, failure modes, and contraints:

![Table of two tool types. Lookups like get\_population have millisecond latency, generous rate limits and missing-key failures; LLM tools like summarize\_city take seconds and have strict rate limits.](https://data4sci.com/assets/blog/1ae41a2e-3241-4dc4-89f4-eade295bf60f_1254x204.webp)

Production systems should differentiate between them and route based on capability: a `FetcherAgent` for fast, idempotent lookups where higher concurrency is fine, and a `WriterAgent` for LLM-backed tools that need lower concurrency and their own retry policy. A unified `WorkerAgent` exposes the same `execute(dag)` interface and routes internally without having to change the orchestrator at all. Our compositional architecture payoff once again

Let’s try routing a mixed seven-node DAG through the unified worker. Each bar is colored based on the Agent used to handle it:

![Timeline chart of seven nodes against seconds since execution start. Four FetcherAgent nodes take 1 ms each; the three WriterAgent nodes take 829 to 1,467 ms, and agg starts once sum\_paris ends.](https://data4sci.com/assets/blog/cd21a8b7-350f-415b-b4ac-9e35b11be0f5_3684x2484.webp)

The timeline shows *why* the split matters operationally: fetch nodes finish a thousand times faster than writer nodes. The writers own the critical path and are worth giving their own semaphore, retry policy, and monitoring tags. We could further extend this approach along the same line: a `BrowserAgent` or `CodeAgent`, etc. each with its own tool subset and trace tags for logging.

## Whats next

Across these three posts we took a \~35-line loop and layered on production-shaped primitives:

![Table of seven layers, interface, execution, context, quality, organization, operations and measurement, each paired with its component and key benefit.](https://data4sci.com/assets/blog/c3bda83c-56d0-40e9-861f-6ae8fe8a0846_1292x534.webp)

Each of these pieces is optional, but they all compound on each other. The planner automatically sees the schema of any new tools that are added. Tighten verification, and the eval suite catches regressions. Swap the LLM backend, and the entire harness can be rerun with a one-line change. This composability and compounding is what makes the difference in production.

Yet, much is still missing. We have no persistent memory, defenses against prompt-injection, human in the loop capabilities, etc. We’ll explore these in future posts, but the winning approach remains the same: Build small primitives, compose them, measure the result. That’s the whole doctrine. For the serving side of that stack, our follow-up post on [LLM inference at scale with vLLM](https://data4sci.com/blog/local-llm-inference-at-scale-with) shows how the backend you plug into these harnesses scales from one request to thousands.
