For our capstone project with CCC Intelligent Solutions, my team and I are building and researching self-improving agent harnesses.

In a nutshell, an agent harness is the environment and software which allows an LLM to use tools and pursue goals. Thus, the performance of an agent is dependent not only on the LLM, but also on the tooling and environment that it lives in. This increases the surface area for mistakes in the output of an agent; a faulty output can come from any tool or environment which the agent uses. Additionally, since the tools are independently developed from the agent, an update to a tool can change how an agent functions drastically.

Our goal is to help agents become more reliable by identifying where they struggle across many runs, what we call “weakness mining”.

How the process works

Our approach has two connected loops. The first looks for recurring weaknesses in execution traces: records of what an agent did during a run. The second takes a prioritized weakness, investigates its cause, and tests a small change to the harness.

Shared evidence from agent runs OpenTelemetry / Langfuse → PostgreSQL Execution traces, spans, and scores

Loop 1 · Scheduled or on demand

Find recurring weaknesses

  1. Select traces Pick eligible records from previous agent runs.
  2. Extract possible causes An LLM records structured clues and failure hypotheses.
  3. Group similar failures Separate by error type, then cluster summaries by meaning.
  4. Build a weakness catalog Name groups, save representative runs, and define how to find matching traces.

Wait for the next mining run

Loop 2 · Independent triage

Test a targeted fix

  1. Prioritize and diagnose Choose a cataloged weakness; inspect traces and source code.
  2. Propose a small fix Make a minimal change to the agent harness.
  3. Benchmark and test Check for improvement without unacceptable regressions.
  4. Review and approve Passing patches need human review and PR approval before a new harness version.

Failed tests: revise or reject the patch

The weakness catalog is a handoff for triage. Mining can keep recurring independently of fixes, while future runs feed fresh evidence back into the process.

The aim is to move from individual failures to patterns we can investigate, then use benchmarks and regression tests to decide whether a proposed fix is worth keeping. A mined weakness is a starting point for diagnosis, not a confirmed root cause.