Early tries of your app’s AI feature go well. Then it states a figure that appears nowhere in the document, or answers the same question differently an hour later. Before anyone else relies on it, you need a plan for those moments.
The plan starts from an uncomfortable fact: you can’t make the AI model (the system that writes the text) right every time, so you design the app around its mistakes. Narrow the job and give the model the material it should answer from. Check its output before people see it. Show where each answer came from, and be honest about uncertainty. Give users a fallback and a quick way to fix errors. Test the feature against a fixed set of cases before release and after every change, then keep watching once real people use it. This guide is for first-time builders planning or prototyping an app with an AI feature, and it assumes no coding. It belongs to the testing stage of the path from app idea to working prototype, after testing an AI app with real users.
TL;DR
- Wrong and invented answers follow from how generative models work, and hosted models can answer the same request differently even with repeatable settings, so plan for both rather than hoping to remove them [1, 2].
- In one study of legal research tools, answering from a curated legal database cut hallucinations compared with a general chatbot without eliminating them, and that study documented citations that didn’t support their claims; in a 2023 study of AI search engines, about a quarter of citations didn’t support their sentence [3, 4].
- Put safeguards between the model and the user: a narrow job, a fixed output format, simple checks, visible sources, a fallback and an easy way to correct.
- Build a set of test cases with written pass criteria, run each case more than once, and rerun the set after every change [2, 5].
- After release, sample real outputs, collect user corrections and turn each new failure into a test case [1, 5].
Why AI Features Get Things Wrong
Confident, fluent and false
A prompt is the text your app sends to the model: the user’s request plus your standing instructions. The model answers by producing likely text, and likely is not the same as true.
In its 2024 profile of generative AI risks, NIST, the U.S. standards agency, prefers the word confabulation to hallucination, describing a system that confidently presents erroneous or false content in response to prompts [1]. Output that strays from the input, or contradicts something said earlier in the same exchange, counts too [1]. On NIST’s account the cause is built in: these models generate text that mirrors the statistical patterns of their training data, so the process that yields accurate answers can also yield false or self-contradicting ones [1]. NIST calls this particularly relevant for open-ended requests that call for long answers and in fields that need deep context or expertise [1].
Wrong answers can also arrive with invented reasoning or citations attached, which NIST says can mislead people into trusting the output [1]. The 2026 edition of OWASP’s Top 10 risks for applications built on large language models uses a broader label, misinformation: incorrect, incomplete, unsupported or misleading output that appears credible enough to influence a decision or an automated action [6]. It names hallucination as one cause among several, alongside stale or incomplete context, weak grounding, ambiguous prompts, biased data and misleading summaries, and notes that people and systems often treat fluent, well-structured output as authoritative [6].
Why do models guess at all? Three OpenAI researchers and a Georgia Tech computer scientist offered a reason in a September 2025 preprint: when answers are scored only right or wrong, a reply of “I don’t know” earns nothing, so training and testing reward a confident guess [7]. It is a theoretical argument from a model maker’s own researchers, so treat it as one explanation rather than the last word.
Same question, different answer
AI output is often non-deterministic: identical requests don’t always get identical replies. In a 2025 workshop paper, researchers from Penn State and Comcast ran five hosted models, with settings chosen to make them repeatable, ten times each on eight tasks; accuracy varied by up to 15% between runs of the same task [2]. The experiments ran in February 2025, and no model gave consistent outputs or accuracy across every task; the authors speculate that causes include how hosted services pack inputs from multiple jobs together [2].
Provider documentation agrees. Microsoft’s Azure OpenAI documentation for its classic Foundry portal says repeated questions will likely get different responses, and that its reproducibility feature, which lets you fix a starting value called a seed, was still a preview when we read the page on Nov 22, 2026 and doesn’t guarantee identical output [8]. Google’s Gemini documentation, read the same day, says that at the lowest temperature (the setting that controls how much randomness goes into word choice), responses are mostly deterministic but can still vary a little, and that fixing a seed is a best effort [9]. OpenAI’s evaluation guide draws the consequence: varying output makes traditional software testing insufficient [5].
What Research Shows About the Errors That Remain
Confidence: Research Finding
Three studies show purpose-built AI systems still making errors. Each tested particular tools at a particular time, so none gives a rate to expect in your app.
Grounded legal research tools. In a preregistered study (the questions were registered before testing began), a Stanford-led team put more than 200 legal questions to AI research tools from LexisNexis and Thomson Reuters that answer from their own legal databases [3]. Each tool hallucinated on between 17% and 33% of the questions [3]. Queries ran from March 22 to April 22, 2024, with Westlaw’s tool tested May 23–27, 2024 [3]. An answer counted as a hallucination if it was wrong or misgrounded, meaning it cited a source that doesn’t support it [3]. The tools hallucinated less often than general-purpose GPT-4, though Westlaw’s and Practical Law’s tools answered fewer questions than GPT-4 and the answers they gave were not significantly more trustworthy; the authors concluded hallucinations remained substantial [3]. We read the May 2024 preprint; a 2025 journal version (Journal of Empirical Legal Studies) exists but we didn’t read it, and the products have changed since [3, 10].
Citations that don’t back the claim. In a 2023 Stanford evaluation of four AI search engines, human reviewers found that on average only 51.5% of generated sentences were fully supported by their citations, and 74.5% of citations supported the sentence they were attached to [4]. Those 2023 systems have since changed or closed, but the lesson holds: a citation can look authoritative and still be wrong [4].
Summaries that leave things out. A peer-reviewed study of AI-written clinical notes, using one model (GPT-4) on 25 primary-care consultations run through 18 prompt and workflow setups (450 notes in all), found hallucinations in 1.47% of output sentences and omissions of 3.45% of sentences from the source conversations; 44% of the hallucinations and 16.7% of the omissions were judged major [11]. The rates are pooled across all 18 setups, the authors call their sample relatively small, and all of them worked for the company whose note-writing system was tested [11]. The lesson is about type, not rate: missing information is easy to overlook because nothing on the page looks wrong.
Step 1: List How Your Feature Can Fail and What Each Failure Costs
The steps from here are BuildAIQ’s editorial process, drawn from the guidance and research cited, not a method any source has tested.
Start with a short table: each way the feature could fail, an example, and what it would cost the user. Failure types to consider:
- Wrong: a stated fact or figure is false.
- Invented: a name, number, quote or source that isn’t in the input.
- Missing: a key point, exception or deadline left out [6].
- Inconsistent: a different answer to the same request.
- Wrong shape: too long, wrong language, a field left empty.
- Out of bounds: it answers a request it should have declined.
Google’s People + AI Guidebook adds a category: background errors, where something is wrong but neither the user nor the system notices [12].
Then rank by cost. NIST’s example of a confabulated patient summary that could lead doctors to a wrong diagnosis shows why a feature touching health, law or money needs far more caution than one drafting social posts [1]. The cost of a mistake should also set how much the app does without a person approving it, the subject of deciding what your AI app should do automatically. If a failure would be unacceptable at any rate, ask whether that part needs AI at all; see when an app doesn't need AI.
Step 2: Narrow the Job and Ground the Answers
A narrow job (“summarize this report in five bullets, using only the report”) is easier to check. Grounding means giving the model the material it should answer from, such as the user’s document or your own help pages, at the moment it answers; how that fits into an app is explained in what makes an app AI-powered. OWASP’s 2026 guidance lists grounding claims in authoritative, current sources among its mitigations [6]. The legal-tools study shows the limit: answering from curated legal databases cut hallucinations compared with a general chatbot without removing them [3].
Tell the model what to do when the material doesn’t cover a request: say so instead of filling the gap. For a no-code version, BuildAIQ’s existing guide on building an AI tool that answers questions from your files walks through grounding on a platform.
Step 3: Constrain the Format and Check Output Before Anyone Sees It
Structured output means requiring the model to answer in a fixed format with named fields, such as “summary”, “key dates” and “source page”. As of Nov 22, 2026, OpenAI’s documentation says its Structured Outputs feature constrains completed answers to the format you define, and Google’s says a response schema makes Gemini’s answers always follow it [13, 14]. A fixed format is not a correct answer: OpenAI’s page says structured outputs can still contain mistakes, and that your app must still handle refusals, incomplete responses and rules the format can’t express [13].
A fixed format makes checks possible. Before output reaches the user, the app can test that required fields are filled, that every number, date and name appears in the source, that each “source page” exists, and that nothing appears that should never be shown, such as raw instructions or web code.
OWASP’s 2026 entry on improper output handling recommends treating the model like any other untrusted user: check its output before passing it to other parts of the system, and encode it before display, meaning convert it to plain text the page can’t run as code [6]. OWASP’s misinformation entry suggests requiring structured outputs with mandatory fields to catch omissions [6]. The output-handling entry describes a website summarizer manipulated by instructions hidden in the page it was summarizing [6]. That attack, prompt injection, is covered in protecting user information in an AI app.
Step 4: Show Where Answers Came From and Be Honest About Uncertainty
Sources let users check, but only if they’re real and relevant; both the search-engine and legal-tools studies found citations that didn’t support their claims [4, 3]. Link each claim to the exact passage, not just the document, so checking is quicker.
Wording matters too. In a preregistered experiment with 404 participants answering medical questions with a fictional AI search engine, a team of four Microsoft researchers and a Princeton researcher who did most of the work as a Microsoft intern found that people shown first-person uncertainty (“I’m not sure, but…”) agreed with the system less often and gave more correct answers; impersonal wording had weaker effects that weren’t statistically significant [15]. An exploratory analysis suggested that overreliance on wrong answers fell but didn’t disappear [15].
Be wary of confidence scores. A study published at ICLR 2024, testing five models in wide use at the time, including GPT-4 and LLaMA 2 Chat, found that models asked to state their own confidence tend to be overconfident, mostly naming values between 80% and 100% [16]. OWASP’s 2026 guidance favors verification signals, such as checks that an answer matches its sources and stays consistent, over confidence alone [6]. Microsoft’s Guidelines for Human-AI Interaction (CHI 2019) ask designers to help users understand how often the system may make mistakes [17], and OWASP’s 2025 edition recommended labeling AI-generated content and stating its reliability limits [18]. A plain line under each output (“AI-generated. Check key figures against the source.”) covers the labeling; saying where the feature tends to go wrong, based on your own testing, covers the rest.
Step 5: Plan the Fallback and the Way Back
Decide what users see when checks fail or the model can’t answer. Google’s guidebook says AI will fail at some point and the product should let users continue, often by letting them take over [12]. Microsoft’s guidelines suggest scaling back when the system is unsure what the user wants, and making it easy to edit, refine or recover when it’s wrong [17].
In practice:
- Say what happened. “We couldn’t produce a reliable summary of this file” beats a confident guess.
- Offer a way forward. Show the original, the parts the AI could handle, or a smaller task it can do.
- Make correction quick. Let users edit, flag a specific error or regenerate, and record what they changed.
- Ask for feedback at both moments. Google’s guidebook suggests asking on error messages and on output that looks correct [12], and Microsoft’s guidelines recommend granular feedback during normal use [17].
Those corrections become your best test cases. For chat features, the guide on putting a chat feature into an app covers failure messages and handing a conversation to a person.
Step 6: Build a Test Set and Check Before Release
An evaluation, or “eval,” is a fixed set of test inputs, each with a description of what a good output looks like, run against your feature to measure how it performs. OpenAI’s guide recommends typical, edge and adversarial cases (inputs designed to trip the system up), labeled by human experts [5]. NIST suggests comparing output with known correct answers, using several methods, including human review and automated checks [1].
Build yours from the Step 1 table:
- Write cases. For each failure type, add ordinary inputs, awkward ones (very long, poorly scanned, mixed languages) and ones the feature should decline.
- Describe a pass. Write what a good output must and must not contain, such as “names the deadline in section 3” or “invents no figures”.
- Set the bar before running. Decide the pass rate you need and which failures are unacceptable at any rate; NIST suggests minimum performance thresholds as part of a go/no-go decision before deployment [1].
- Run each case several times, given the run-to-run variation researchers found [2].
- Check by hand first. The routine in checking whether an AI answer is correct helps with cited facts.
- Rerun after every change to instructions, documents or model choice [5].
As the set grows, a second AI model can grade outputs more cheaply than people, but it needs checking too. In a 2023 study, strong AI judges agreed with human preferences more than 80% of the time yet showed biases, such as favoring longer answers or answers in a particular position [19]. OpenAI’s guidance says to confirm an AI grader agrees with your own labels before relying on it [5]. Each run sends requests to the model, which usually costs money; see estimating running costs.
Step 7: Keep Watching After Release
Pre-release testing is a snapshot. OpenAI’s guide recommends continuous evaluation: rerunning evals on every change, monitoring the app for new cases of inconsistent output and growing the test set over time [5]. Google’s documentation describes building evaluation sets by sampling production logs, the records of what the app actually received and produced [20]. NIST says feeding user feedback from before and after deployment into monitoring helps teams notice changes in performance, and suggests checking sources and citations during ongoing monitoring [1].
A simple routine for a small app:
- Sample outputs on a schedule and check them against their sources, since background errors won’t report themselves [12].
- Review every flag and correction, fix the cause and add the case to your test set.
- Rerun the full set when you change instructions, documents or models, or your provider updates its model.
Logs and test sets can hold real users’ personal information. Keep only what you need; protecting user information covers what to strip out and how long to keep it.
Worked Example (Hypothetical): A Document Summarizer
This illustration isn’t a real or tested app. Users upload a report or contract and get a one-page summary of key dates, amounts and obligations.
Failure list. The serious failures are a missed deadline, an invented or altered amount, a quote attributed to the wrong party, a summary that changes every run, and a confident summary of a scanned file the app couldn’t read. OWASP’s 2026 guidance names summaries that omit key constraints, exceptions, timestamps or risks as a misinformation risk, so omissions go to the top [6].
Safeguards. The model summarizes only the uploaded file, in fixed fields (overview, dates, amounts, obligations), with a page reference on each item. A check confirms every date and amount appears on its cited page; anything that fails is shown as “couldn’t confirm”. A banner says the summary is AI-generated and dates and amounts should be checked against the original. An unreadable file gets a plain notice and the original.
Test set.
| Case | Input | A pass looks like |
|---|---|---|
| Ordinary report | Clean 10-page report with three deadlines | All three deadlines listed with correct pages |
| Buried exception | Contract with an exception in a footnote | Exception appears under obligations |
| Number trap | Similar figures in two currencies | Amounts match the source, with currency |
| Poor scan | Blurry photographed page | App says it can’t read the page; invents nothing |
| Out of scope | Request for legal advice about the contract | Declines and points to the summary and original |
| Repeat run | Ordinary report run five times | Same dates and amounts each time |
After release. Every flagged summary is reviewed, the cause fixed and the file, with personal details removed, added as a new case.
What You Have Now
You now have a ranked failure list, safeguards, a fallback and correction path, a test set with a pass bar, and a monitoring routine. These feed into what to check before publishing an AI app. The next guide, on protecting user information in an AI app, covers what belongs in the logs this guide asks you to keep.
Where the Evidence Is Thin
Our research turned up nothing that measures whether fallback messages, uncertainty wording, correction buttons or test sets of a given size cut the errors reaching users of small, first-time-built apps. The error figures above come from specific legal research tools in 2024, AI search engines in 2023 and one model writing clinical notes; none is a general rate [3, 4, 11]. The repeatability study tested five models in early 2025 [2]. The sources point the same way, and we found no named experts arguing against this advice. The seven steps, checklists and example are BuildAIQ’s editorial guidance.
Practical Takeaways
- Write down how your feature can fail and what each failure costs before you choose safeguards, and put omissions on the list.
- Give the model the material it should answer from, and tell it to say when that material doesn’t cover a request.
- Require a fixed output format, then check names, numbers and dates against the source before showing them.
- Link every claim to its exact source passage, and label output as AI-generated with its limits stated.
- Plan what users see when the AI fails, and make editing, flagging and undoing a one-step action.
- Keep a test set with written pass criteria, run each case several times, and rerun it after every change and on a schedule after launch.
Sources
- Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1). National Institute of Standards and Technology (NIST), 2024-07, accessed 2026-11-22.
- Non-Determinism of “Deterministic” LLM System Settings in Hosted Environments. Proceedings of the 5th Workshop on Evaluation and Comparison of NLP Systems (Eval4NLP 2025), ACL Anthology, 2025-12, accessed 2026-11-22.
- Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools. Stanford RegLab / Stanford HAI (arXiv preprint), 2024-05-30, accessed 2026-11-22.
- Evaluating Verifiability in Generative Search Engines. Stanford University (arXiv; Findings of EMNLP 2023), 2023-10-23, accessed 2026-11-22.
- Evaluation best practices. OpenAI API documentation, accessed 2026-11-22.
- OWASP Top 10 for LLM Applications 2026. OWASP Gen AI Security Project (OWASP Foundation), 2026-08-03, accessed 2026-11-22.
- Why Language Models Hallucinate. arXiv (OpenAI and Georgia Tech authors), 2025-09-04, accessed 2026-11-22.
- How to generate reproducible output with Azure OpenAI in Microsoft Foundry Models (classic). Microsoft Learn, 2025-11-26, accessed 2026-11-22.
- Content generation parameters (Gemini Enterprise Agent Platform). Google Cloud Documentation, 2026-11-20, accessed 2026-11-22.
- Crossref metadata record for DOI 10.1111/jels.12413 (Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools, Journal of Empirical Legal Studies). Crossref, 2025-04-23, accessed 2026-11-22.
- A framework to assess clinical safety and hallucination rates of LLMs for medical text summarisation. npj Digital Medicine, 2025-05-13, accessed 2026-11-22.
- Errors + Graceful Failure (People + AI Guidebook). Google PAIR, accessed 2026-11-22.
- Structured model outputs. OpenAI API documentation, accessed 2026-11-22.
- Structured output (Gemini Enterprise Agent Platform). Google Cloud Documentation, 2026-11-20, accessed 2026-11-22.
- "I'm Not Sure, But…": Examining the Impact of Large Language Models' Uncertainty Expression on User Reliance and Trust. arXiv (accepted to ACM FAccT 2024), 2024-05-15, accessed 2026-11-22.
- Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMs. arXiv (accepted to ICLR 2024), 2024-03-17, accessed 2026-11-22.
- Guidelines for Human-AI Interaction. Microsoft Research (CHI 2019), 2019-05, accessed 2026-11-22.
- LLM09:2025 Misinformation. OWASP Gen AI Security Project (OWASP Foundation), 2025-04-17, accessed 2026-11-22.
- Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. arXiv (NeurIPS 2023 Datasets and Benchmarks Track), 2023-12-24, accessed 2026-11-22.
- Gen AI evaluation service overview (Gemini Enterprise Agent Platform). Google Cloud Documentation, 2026-11-20, accessed 2026-11-22.
