Why agents are harder to debug
What it is
Ordinary software is debugged by reproducing the bug and stepping through the code. Agents break that method in five ways:
- Non-determinism: the same input can take a different path each run.
- The decision is not in your code: it is in a model's reply to a long prompt.
- Silent failure: a wrong answer raises no exception. It looks exactly like a right one.
- Distance: a mistake at step 3 shows up at step 12.
- Many moving parts: prompt, model version, tools, retrieved documents, memory and state all influence the outcome.
Why it matters
So you cannot rely on reproducing a failure. You must have recorded it.
- If the exact text sent to the model at the failing step was not saved, the cause is usually unrecoverable.
- Logs written for ordinary software ('request received', 'response sent') say nothing about why the agent chose what it chose.
- Observability for agents means capturing every step's inputs and outputs, so any run can be read afterwards like a story.
In the real world: An agent refunded the wrong order once in two thousand runs. It could never be reproduced; the saved trace showed a tool had returned two orders and the model picked the second.
Visual example
ComparisonEvery row is a reason to record everything.
Trying to debug by re-running the same request and watching. It behaves differently this time, you 'fix' something unrelated, and the original fault remains.
Practise it: Design an AI Customer Support Agent