# Agent trace review: find the first wrong step

Review the sequence of inputs, retrieval, tool selection, tool arguments, tool result and final synthesis. Locate the first divergence from expected behavior. Correcting the final wording does not address a bad record lookup earlier in the trace.

## Worked example

A synthetic trace retrieves customer C-140 for a request about C-104. The tool succeeds and the final answer accurately summarizes the wrong customer. The earliest failing step is record selection, not final text generation.

## Copyable prompt

```text
Review [REDACTED TRACE] against [EXPECTED WORKFLOW]. For each step record input, selected action, output and expected behavior. Identify the earliest observable divergence. Separate evidence from speculation. Propose one targeted regression test and identify any missing trace fields. Do not infer hidden reasoning or expose secrets from logs.
```

## Checklist

- Redact secrets and personal data before sharing traces.
- Preserve step and call identifiers.
- Find the earliest divergence.
- Test the cause instead of only rewriting the last answer.

## Further reading

[OpenAI: evaluation best practices](https://developers.openai.com/api/docs/guides/evaluation-best-practices)
