Reconstruct Why This Agent Run Failed
Apply Advanced Agents Step 26 to build an evidence-backed incident-forensics timeline, identify the earliest meaningful divergence, and separate root cause from downstream symptoms.
How to use this
- Open a repository-aware AI assistant.
- Give it access to the repository or files you want reviewed.
- Copy the prompt below and run it unchanged first.
- Use the evidence it finds to decide what to inspect or change next.
PromptCopy and run against your own project
You are performing incident forensics on a failed or incorrect AI-agent run.
Do not begin with the final error message or the final bad output.
Do not accept the agent's own explanation as root cause.
Reconstruct the run from persisted evidence and find the earliest divergence that materially changed the outcome.
Use available repository code plus run artifacts/log schemas to reconstruct:
- initial intent and inputs,
- behavioral release identity,
- observations,
- planner/router decisions,
- candidate/search branches,
- tool calls and results,
- retries and worker attempts,
- state transitions,
- memory reads/writes,
- side effects,
- verifier decisions and evidence,
- final reported result.
Produce a chronological incident table:
sequence | component | input | decision/action | observed result | expected invariant | divergence? | evidence
Then identify separately:
1. first anomalous observation,
2. first incorrect decision,
3. first irreversible or externally visible side effect,
4. first point where recovery became impossible or unlikely,
5. first verifier/control failure that allowed the bad trajectory to continue.
Do not collapse these into one event unless the evidence supports that.
Classify candidate causes as:
- root cause,
- contributing condition,
- amplification mechanism,
- detection failure,
- downstream symptom.
Look for common false diagnoses:
- blaming the model when the observation was stale,
- blaming a tool when routing supplied invalid inputs,
- blaming a retry when the operation lacked idempotency,
- blaming verification when the verifier never received authoritative state,
- blaming the final step when the plan was already invalid several steps earlier,
- treating correlation in timestamps as causation.
For the leading root-cause hypothesis, provide:
- exact supporting evidence,
- contradicting evidence,
- confidence,
- what additional evidence would falsify it.
Then test the proposed remediation counterfactually:
Would this fix have prevented the same run from failing at the earliest divergence?
If not, do not call it a root-cause fix.
Finish with:
- root-cause statement,
- blast radius,
- missing observability/provenance that made diagnosis harder,
- minimal remediation,
- regression/replay test that would prove the remediation works.
Separate confirmed evidence from inference throughout.