If an AI agent gives incorrect or incomplete results, a repeatable check can help you find whether the cause is the request, the available information, a tool, or the agent’s configuration. Start by saving one example and its inputs; then test one change at a time so you can identify what actually improves the result.
What You’ll Need
- A specific example of a bad result, including the original prompt and the response.
- Access to the agent’s instructions, settings, connected tools, and relevant logs, if available.
- A reliable source or expected answer to check against. Remove private or sensitive information before sharing examples.
Step-by-Step
- Define what is wrong. Separate factual errors from missing content, irrelevant answers, poor formatting, and failures to complete an action. Write down the expected result and the evidence that supports it. “The answer is bad” is difficult to debug; “it omitted the two required fields” is testable.
- Reproduce the issue. Save the exact prompt, conversation context, files, settings, and tool inputs. Run the same case again without changing anything. If results vary, note the differences; a variable result may point to sampling settings, changing external data, or a nondeterministic tool rather than a fixed prompt defect.
- Check whether the request is clear and complete. Look for ambiguous terms, unstated assumptions, conflicting instructions, missing units, dates, or output requirements. Specify the task, relevant context, constraints, and desired format. For example, request “List three causes, each with one supporting source” rather than “Explain this.” Do not add details that would bias the answer away from the evidence.
- Verify the information the agent can use. Check that attached files are the right versions, readable, complete, and within any documented size or format limits. If the agent uses retrieval, search, or a knowledge base, confirm that the needed material is indexed and that the retrieved passages actually contain the answer. Update stale content and remove duplicates or conflicting documents where appropriate.
- Inspect the agent’s instructions and configuration. Review system-level directions, task instructions, examples, and formatting rules for contradictions or vague wording. Make requirements explicit and prioritize them. Avoid piling on unrelated instructions: a long instruction set can obscure which requirement matters most. Change one instruction at a time and rerun the saved example.
- Test tools and integrations separately. If the agent calls a search service, database, API, or other tool, check whether the call ran, what arguments it used, and what the tool returned. Test the same operation directly if you can. A correct agent cannot reliably report information that a tool failed to retrieve; fix the connection, permissions, input, or source data before rewriting the prompt.
- Check for missing steps in a multi-step task. Review the agent’s plan or execution trace, where available. Confirm that it gathered required information, performed calculations, checked conditions, and completed the final response. Break a broad task into smaller stages with explicit inputs and completion criteria. For consequential actions, require a human review rather than assuming the agent completed them correctly.
- Improve the response format and completeness checks. Define required fields, a sensible order, and what to do when information is unavailable. Ask the agent to mark unknowns instead of guessing. A checklist or structured output can expose omissions, but it does not prove that claims are true; validate important facts against dependable sources.
- Build a small repeatable test set. Include the original failure, typical requests, edge cases, and examples that should be refused or answered with uncertainty. Record expected outcomes and compare results after each change. Keep tests representative of real use, and watch for regressions: fixing one example can make another worse.
- Roll out changes cautiously. If the result is used by other people or systems, test the revised agent in a limited setting first. Monitor errors and tool failures, keep a way to revert configuration changes, and escalate persistent platform or integration problems to the service administrator or provider with a sanitized example and relevant logs.
Common Mistakes
- Changing several things at once: You cannot tell which change helped or caused a new issue. Make one controlled change per test.
- Assuming confident wording means accuracy: Fluency is not evidence. Check claims against trusted, current sources.
- Blaming the prompt for every failure: Missing or stale documents, tool outages, access restrictions, and bad source data can produce the same symptoms.
- Adding excessive instructions: Repeated or conflicting rules can make compliance less predictable. Keep directions relevant, concise, and ordered by importance.
- Testing only an easy example: A fix may work for one prompt but fail on unusual inputs, longer context, or missing information. Retest a varied set.
- Sharing sensitive logs: Prompts and traces may contain personal, confidential, or access information. Redact them before sending to support.
Tips
- Keep a short incident record: date, task, expected result, actual result, relevant settings, and the change tested.
- Tell the agent how to handle uncertainty, such as identifying missing evidence or asking a focused clarification question.
- Use a source requirement for factual tasks, and check that cited sources support the specific statements attributed to them.
- For calculations, provide units and verify the arithmetic independently. Do not rely on a language model as the sole calculator for important results.
- Set clear boundaries for actions: define what requires approval, what counts as complete, and what the agent must not do.
Troubleshooting
The same prompt gives different answers. Check whether the agent uses variable generation settings, live search, changing files, or tools with changing outputs. Keep the inputs and configuration fixed where possible, and compare several runs rather than judging from one.
It ignores part of a long request. Put the most important requirements up front, split the task into stages, and use a short checklist of required outputs. Confirm that the relevant context is actually available to the agent; a long conversation or large file may not all be included.
It cites sources that do not support the answer. Open each source and check the relevant passage, date, and scope. Improve retrieval or require direct quotations or passage references where appropriate. If the source cannot be verified, treat the claim as unconfirmed.
A tool returns nothing or an error. Inspect its status, permissions, input format, and connection. Try a simple test request outside the agent. If the direct test also fails, resolve the integration or data issue before changing the agent’s instructions.
Changes do not improve results. Restore the last known configuration, confirm the test case still reproduces the problem, and isolate whether it is caused by the model, source material, tool, or workflow. If the cause remains unclear, provide support with a minimal reproducible example, timestamps, and redacted logs.
Frequently Asked Questions
Why does an AI agent give a confident but incorrect answer?
It can generate plausible language without having reliable evidence. Check the underlying sources and instruct it to state uncertainty or missing information.
Should I rewrite the prompt first?
First reproduce the problem and check the data and tools. Rewrite the prompt when the request is genuinely ambiguous or requirements are missing.
How can I tell whether retrieval is the problem?
Inspect the passages or records supplied to the agent. If the relevant information is absent, incorrect, or outdated, fix indexing or source data before adjusting the response instructions.
Can a better prompt eliminate all errors?
No. Clear instructions can reduce avoidable mistakes, but they cannot guarantee correct reasoning, current information, or successful tool execution.
What should I send to support?
Send a concise reproduction, expected and actual results, relevant timestamps, and sanitized logs or tool outputs. Remove private information and secrets first.
When should a person review the result?
Use human review when an error could materially affect people, important decisions, or an external action. Set review requirements according to the consequences of failure.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Wireless Controller Charging: Can You Play While Plugged In?
- Secure a Node.js API: Layered Checklist
- Zoom Desktop Client: Features, Setup, and Fixes
- Python Integer Identity: Why It Varies by Run
- Can Technology Solve Poverty? Facts & Limits
- Cannot Detect Device? Fixes for USB & Bluetooth