# Debug a run

> Use the run trace to find whether a failure came from context, a tool, a policy, or execution.

Start with the run, not the prompt. A plausible answer can still be wrong because it read stale data, resolved the wrong entity, or skipped a tool.

1. Confirm the input and the version that executed.
2. Check the retrieved context: was the relevant record present, in scope, and fresh?
3. Inspect each tool call and policy decision.
4. Check waits, retries, and the final stop reason.
5. Reproduce with a controlled input before changing the definition.

If the same class of failure can recur, add it to an [evaluation case set](/docs/evaluation/case-sets-and-promotions) before promoting a fix.
