Coderhouse goes global

🌍

Read more

How to Check AI-Generated Data Analysis Before You Share It

AI Engineering

Build and ship real applications with LLMs, agents and automation.

8 weeks · Live online · View course →

Data Analytics

Go from zero to job-ready analyst with SQL, Python and BI tools.

10 weeks · Live online · View course →

Dan Patiño

AI Strategy & Innovation at Coderhouse

Artificial Intelligence

How to Check AI-Generated Data Analysis Before You Share It

How to Check AI-Generated Data Analysis Before You Share It

Checking AI-generated analysis means verifying the data and code behind its numbers and checking whether its written conclusions follow. Never share a number you cannot trace back to the underlying data. An assistant can produce a plausible chart from the wrong data or code, and it can describe a valid result with a confident but unsupported claim.

Why AI-generated analysis goes wrong

AI assistants can produce plausible analysis without verifying every part of it against your data. A language model predicts a response from the prompt and the information it can access. If you ask for revenue by customer segment without providing a table schema, it may write a query using a plausible but nonexistent segment column.

Even when every column exists, the generated code can answer the wrong question. A join can count one order several times when it matches multiple customer records. A filter can quietly exclude refunds, and a chart based on a sample can look like it covers the full dataset. An average across all customers can also hide a decline in a large segment if the mix of customers changed.

The written summary needs a separate check because fluent prose can make weak evidence sound settled. In a study of legal queries, researchers found that tested models often accepted false premises and expressed more confidence than their accuracy warranted. The study did not test data analysis, but it gives you a reason to check whether a confident summary rests on a mistaken premise, such as an assumed increase that the numbers do not show.

The 7-step verification workflow

Run the seven checks before sharing an AI-generated chart, query, or summary. Keep the source data and calculations available so you can trace each claim. The sequence keeps a person responsible for reviewing the output, consistent with NIST’s AI Risk Management Framework, which addresses AI risks during use and evaluation.

Step 1: Restate the question in plain terms

Restate the business question before checking the AI’s numbers. Clear prompts help here too; see prompt engineering for data analysts for ways to state metrics and filters up front. Name the metric, the customers or records included, and the comparison period so you can tell whether the analysis answers the right question.

For example, “How did sales do last quarter?” could produce an accurate comparison of worldwide orders with the previous quarter. Your manager may have meant US revenue from new customers compared with the same quarter last year. Write that narrower question down, then check whether the chart and query use the right customers, revenue measure, and dates. Resolve any mismatch before you verify the arithmetic.

Step 2: Inspect the data the model actually used

Inspect the inputs before you check the answer. Ask the AI assistant to show which files or tables it read, which columns it used, and the date range and filters applied. Compare those details with the source data or database schema. A language model can invent a plausible column name when information is missing), so a field named in its explanation does not prove that field exists. Our explainer on why LLMs hallucinate covers the mechanism in more detail.

Check how many rows the assistant actually analyzed. A chart may look reasonable even if the tool read only a preview of the file or excluded records through a filter you did not request. Compare the input row count with the source, then inspect a few records at the start and end of the requested date range. If the assistant cannot show what it used, retrieve the data yourself before relying on its result.

Step 3: Reproduce the key numbers independently

Recalculate the headline figures from the source data using a different method. If an AI assistant reports $120,000 in monthly revenue, make a pivot table from the transaction export or run a separate query. Use the same date range and definition of revenue, but do not reuse the assistant’s code or its reported total.

Compare the totals, then trace any difference to the underlying rows. Duplicate orders, missing refunds, or an unexpected filter can change a plausible-looking figure. An independent calculation can also catch a number the assistant supplied without deriving it from the data, before that number reaches a report. If you cannot access the source data or resolve a mismatch, label the figure unverified rather than sharing it as fact.

Step 4: Read the generated code or SQL line by line

Read the generated SQL or code line by line, even if its final chart looks plausible. Start with each join. A join on customer name instead of customer ID can match unrelated records, while a one-to-many join can duplicate sales before the query sums them. Compare row counts before and after the join, and check whether an inner join drops records you expected to keep.

Next, inspect every filter, including conditions the AI added without telling you. A date cutoff or a filter that excludes null values can silently change the population. Check what each group-by represents. Grouping by order line when you need totals per order changes the unit being counted. For window functions, verify which rows each partition includes and how the code orders them. If you cannot explain how a line affects the reported number, check it against the underlying data before sharing the result.

Step 5: Sanity-check magnitudes and direction

Compare the headline number with last period and a known business total. If an AI-generated chart shows $120 million in monthly revenue for a business that recorded $15 million in the previous year, check the units, date range, and whether a join duplicated transactions. For a per-employee figure, multiply it by headcount and see whether the implied total makes sense. Check direction, too. If the summary says revenue rose, confirm that the source data shows an increase.

Step 6: Test edge cases and boundary conditions

A correct headline total can hide records that the analysis dropped or counted twice. Check rows with missing values, segments with no records, and unusually large or small values against the source data. If a chart shows no sales for a region, confirm whether the region had zero sales or whether a filter excluded it.

Step 7: Label assumptions and confidence explicitly

Before you share an AI-generated analysis, attach a note that states the assumptions behind its numbers. Record the date range, excluded records, treatment of missing values, and any sampling. For example, a revenue chart might include completed US orders through June 30 but exclude returns recorded afterward.

State how confident you are in the conclusion and what you could not verify. If you reproduced the revenue total but could not check the returns filter, disclose that limit instead of calling the chart fully verified. NIST’s AI Risk Management Framework provides voluntary guidance for managing AI risks. You, not the model, decide what confidence the completed checks support.

Reusable verification checklist

  • Restate the business question, including the metric, population, and time period.

  • Confirm which files or tables the AI used. Check columns, date ranges, filters, and whether it sampled the data.

  • Recalculate each number you plan to share with a direct query, pivot table, or calculator.

  • Read generated code or SQL for incorrect joins, dropped rows, hidden filters, and misleading groupings.

  • Compare totals and trends with prior periods and known business figures.

  • Test null values, empty groups, outliers, and rows at the start and end of the date range.

  • Attach assumptions, unresolved limits, and an appropriate confidence level to the result.

Make verification part of how you work

Checking AI output is now a core analyst skill, not an optional extra. The Data Analytics Course is an 11-week live program with one class per week and about 6 to 8 hours of weekly work; it moves from SQL and Python through statistics and experimentation to a dedicated AI-native analytics week and a final capstone. For developers, the AI Engineering Course runs eight weeks with one 2-hour live class per week and includes a week on evaluation and observability, the engineering side of testing what models produce.

FAQ

  • How is checking AI analysis different from checking a human analyst’s work? You still check the question, source data, calculations, and conclusions. With AI, pay particular attention to whether a named column or table exists and whether the tool used the full dataset. A fluent explanation does not establish that the analysis used the right inputs.

  • What is the minimum check for a low-stakes chart? Confirm the chart uses the intended data and date range, then reproduce its main number with a pivot table, query, or calculator. Check the axis labels and units before sharing. If you cannot trace the plotted values to source rows, hold the chart back until you can.

  • Does reproducing numbers manually defeat the point of using AI? No. You can let AI draft the query, chart, or summary while you independently check the few figures that carry the conclusion. A second query or pivot table can verify a headline total without rebuilding the entire analysis. If the numbers disagree, inspect the filters and joins before sharing either result.

Keep learning

Dan Patiño

I'm Dan Patiño, head of AI Strategy & Innovation at Coderhouse. My day-to-day work involves merging the tactical management of e-commerce (CRO, Email Marketing and SEO) with the development of disruptive solutions. I specialize in building internal AI-powered apps to automate tasks and boost innovation within the team. I firmly believe that technology is strategy's best ally. To dive deeper into my professional journey, I'll be waiting for you on my LinkedIn profile.