Debug an agent that's going off the rails
My agent is misbehaving: {{describe the wrong behaviour and how often}}. Here's the prompt: {{paste}}. Here's a failing trace: {{paste tool calls and outputs}}.
Diagnose in this order:
1. Read the trace and identify the exact step where it first went wrong — not where the bad output appeared.
2. Classify the cause: ambiguous instruction, conflicting instructions, missing context, tool returning something unexpected, output format drift, context truncation, or genuine reasoning failure. Quote the evidence.
3. For instruction problems, show me the specific sentence that permits the wrong behaviour. Models exploit ambiguity — find it.
4. Propose the minimal prompt change, and explain the mechanism by which it fixes this. Don't rewrite the whole prompt.
5. Say what should be enforced in code instead of asked for in a prompt — validation, retries, schema, limits.
6. Give the three test cases that would catch this regression, including the adversarial one.
7. Name the class of failure this belongs to and what else in my prompt is vulnerable to it.
Don't suggest "be more specific" without writing the exact words.
How to use it
Step 5 is the real lesson — anything that must be true should be validated in code, not requested politely.
Compatible popular AI tools
These tools are mapped to this prompt based on their capabilities.
People who liked this prompt
1 community likes
No likes yet. Be the first.