Before Building AgentOps: What Makes a Diagnosis Good Enough?
How far is a plausible explanation from a useful diagnosis? Thinking through evidence, causality, verification, and uncertainty before building AgentOps.
Starting with a question
I am preparing to build AgentOps, a project in which an agent calls tools, gathers evidence, and helps diagnose system failures.
Before designing it, I realised there was a question I needed to answer first: what makes a diagnosis good enough?
Suppose a system reports errors, the agent checks the logs, and its final answer is, “There might be a problem with the database.” Has it completed the task?
That gives someone a direction, but leaves several questions unanswered: why suspect the database? What kind of problem? What should they check first? And if the diagnosis is wrong, how would they find out?
Without those answers, the agent may simply have rewritten an error message as something that sounds like professional analysis.
I want AgentOps to help people decide what to do next. That means defining the standard for a diagnosis before deciding how to implement the agent loop, tool calls, and evaluation.
What I want a diagnosis to provide
Separate symptoms, failure points, and causes
Consider a hypothetical incident: a service starts experiencing widespread request timeouts, while its logs show failures to acquire database connections.
There are at least three distinct layers here:
- Symptom: requests time out.
- Immediate failure point: some requests cannot acquire a database connection in time.
- Possible causes: slow queries are holding connections, connections are not being released correctly, or traffic has exceeded current capacity.
“Connection pool exhaustion” describes the state at that moment. It does not necessarily explain why the failure happened.
If the agent sees a connection error and immediately recommends increasing the pool size, it may skip the question that most needs investigation. The same action could even have opposite effects under different causes.
My first requirement is therefore to make clear which layer the diagnosis explains, rather than treating an intermediate state as the final root cause.
Make every key claim traceable to evidence
“I checked the logs” is not enough.
I want to know which service was checked, over what time window, what was found, and which claim that finding supports.
For example:
During the incident window, connection pool wait times increased and active connections remained at the limit. This supports the conclusion that requests were waiting for connections. However, without query duration data and connection release records, we cannot yet distinguish slow queries from a connection leak.
This does not identify a single root cause, but it draws a clear boundary between what is known and what remains unknown.
For AgentOps, this means tool results need traceable identifiers, and key conclusions in the final report should link to the relevant evidence.
A citation alone does not establish that a conclusion is valid, though. The agent could cite a real log entry and still misinterpret it. Evaluation will need to check both whether the evidence is real and whether it supports the claim.
Propose a next step that distinguishes possible causes
Diagnosis rarely suffers from a shortage of possible explanations. The harder part is narrowing them down.
If both slow queries and connection leaks could explain an exhausted pool, repeatedly searching for the same error may add little information. A more useful question is:
What evidence could we gather next that would lead these two explanations to predict different outcomes?
We could inspect query durations, long-running transactions, and whether connections are returned when requests finish. Different results would change the diagnosis.
I want every tool call to have a specific purpose: testing a hypothesis or ruling out an explanation. If the conclusion would remain unchanged regardless of the result, the value of that call deserves scrutiny.
This also changes how I think about an agent’s execution trace. It should record the evidence behind decisions and how those decisions changed, alongside which tools were called.
Distinguish mitigation, verification, and repair
If restarting a service restores it, that shows the restart temporarily relieved the problem. It does not prove a particular root cause.
Likewise, adding capacity may reduce the error rate without explaining why capacity suddenly became insufficient.
I want the diagnosis report to distinguish three kinds of action:
- Mitigation: reduce the immediate impact.
- Verification: help confirm or rule out a possible cause.
- Repair: make a lasting change to address a problem supported by sufficient evidence.
Each recommendation should also state what we expect to observe. If the expected change does not happen, should we revise the diagnosis?
For AgentOps, which I currently intend to use for diagnostic assistance, recommending an action does not mean executing it automatically. Whether a recommendation is sound and whether its execution is authorised are separate questions.
Allow the diagnosis to stop at “insufficient evidence”
I do not want the system to invent a root cause just to complete a report.
If the available data only supports “abnormal waiting for database connections,” a good answer can stop there while explaining:
We cannot yet determine why connections are being held for so long. Query duration data or connection lifecycle records are needed to investigate further.
But “insufficient information” cannot become a universal escape hatch. The system should explain what it has checked, what is missing, and why that missing information affects the diagnosis.
An incomplete diagnosis with clear boundaries is more trustworthy than an unsupported, confident conclusion.
Validation and limitations
These are currently design requirements for the project, rather than capabilities I have already validated.
For the first version, I plan to test them using controlled failure scenarios, rather than judging reports only by how fluently they read.
One important set of tests will involve similar symptoms with different underlying causes. Several scenarios might all involve connection waits, but arise from slow queries, connection leaks, or a traffic spike. The agent needs to distinguish them using evidence, rather than simply matching the words “connection pool.”
Another set will involve incomplete or conflicting evidence. I want to see whether the agent revises its diagnosis, gathers information that distinguishes the remaining hypotheses, or explicitly stops, instead of always defending its first guess.
During evaluation, I want to check each of the following separately:
- Whether the diagnosis matches the fault actually configured in the scenario.
- Whether the cited evidence supports the key conclusions.
- Whether the next suggested check helps distinguish the remaining hypotheses.
- Whether recommendations fit the known causes and explain risks and verification steps.
- Whether the agent delivers something useful within its time and tool-call budgets.
Measuring only the proportion of correct root-cause guesses would miss many problems. A correct guess based on fabricated evidence is still an unacceptable diagnosis. A diagnosis that reliably narrows the possibilities without identifying the final root cause has partial value worth recording, without pretending the incident is fully understood.
Simulated scenarios also have limits. Their designers know which fault was injected. Real systems may have several problems at once, and logs may be missing or delayed. The first evaluation can establish performance under controlled conditions; it cannot establish that the system is ready to handle real incidents.
For now, my definition of a good-enough diagnosis is:
Within the available evidence and resource limits, explain what happened, which causes are supported, what remains uncertain, and what to do next to test those judgments.
That definition will shape how I build AgentOps: first make the relationships between evidence, claims, and verification clear, so that every report can be questioned and corrected.