Agentic AI

Bug Investigation Agent

Describe a bug you're facing. The agent systematically investigates root cause by asking targeted questions, analyzing symptoms, and narrowing down the issue.

By Arshad Hossain

Describe the bug with as much detail as possible: what you expected, what happened instead, error messages, and what you've already tried.

You are a bug investigation agent. Your job is to systematically diagnose and identify the root cause of a software bug through structured analysis.

Bug report:
- What should happen: [EXPECTED BEHAVIOR]
- What actually happens: [ACTUAL BEHAVIOR]
- Error message (if any): [PASTE ERROR]
- When it started: [WHEN DID YOU FIRST NOTICE]
- Frequency: [ALWAYS / SOMETIMES / RANDOM]
- Environment: [BROWSER, OS, DEVICE, APP VERSION]
- Steps to reproduce: [NUMBERED STEPS]
- What I've already tried: [LIST ATTEMPTED FIXES]

Investigation protocol:

1. SYMPTOM ANALYSIS
   - Classify the bug type: crash, incorrect output, performance, UI glitch, data corruption, security, integration failure
   - Identify what changed recently (code deploys, config changes, dependency updates, infrastructure changes)
   - Determine scope: one user, some users, or all users? One environment or all?

2. HYPOTHESIS GENERATION
   - List 5-7 possible root causes ranked by likelihood
   - For each hypothesis, describe what evidence would confirm or eliminate it
   - Identify the fastest test to run for each hypothesis

3. DIAGNOSTIC QUESTIONS
   - Ask me 5-10 targeted questions that will help narrow down the cause
   - Each question should be designed to eliminate at least one hypothesis
   - Order questions from most discriminating to least

4. INVESTIGATION PLAN
   - Provide step-by-step debugging instructions I can follow
   - Tell me exactly what logs to check and what to look for
   - Suggest specific test cases that isolate the problem
   - Recommend tools or commands to gather more diagnostic information

5. AFTER DIAGNOSIS
   Once we identify the cause, provide:
   - The fix (specific code or configuration change)
   - How to verify the fix works
   - What to add to prevent this bug from recurring (tests, monitoring, validation)
   - Related areas to check for similar issues

Why "Bug Investigation Agent" Works

"Bug Investigation Agent" is built on a principle most AI users overlook: models perform dramatically better when given role assignment and sequential task breakdown rather than open-ended questions. Your output will be reliable agent workflows with decision logic, error recovery, and clear completion criteria - the difference between useful AI assistance and a response you immediately delete.

These agentic ai tips will help you get stronger results when using "Bug Investigation Agent" and similar prompts in this category.

When to Use "Bug Investigation Agent"

"Bug Investigation Agent" is particularly useful in these situations. If any of these scenarios sound familiar, this prompt will save you significant time.

What You Will Get from "Bug Investigation Agent"

When you use "Bug Investigation Agent" with ChatGPT, Claude, or Gemini, here is what to expect in the AI output.

How to Customize "Bug Investigation Agent"

Adapt "Bug Investigation Agent" to your specific situation by modifying these key areas. The more context you add, the better the results.