---
title: "A trustworthy AI analysis workflow | Optimize All Academy"
description: "The opportunity and the trap AI assistants can now read spreadsheets, write formulas, generate SQL and Python, run code in sandboxes, draw charts and…"
url: https://optimizeall.com/learn/ai-for-data-analysis-and-decision-making/ai-analysis-workflow
updated: 2026-10-05
---

AI for Data Analysis & Decision Making · Foundations: AI as your analysis partner · lesson 1 of 16 · 11 min

# A trustworthy AI analysis workflow

## The opportunity and the trap

AI assistants can now read spreadsheets, write formulas, generate SQL and Python, run code in sandboxes, draw charts and summarize findings in plain language. For analysts, marketers and product people, this compresses hours of work into minutes. The trap is that the same fluency makes wrong answers look right. A confident paragraph about "a 23% uplift" is persuasive whether or not the number is real.

The goal of this course is to get the speed without the trap: **AI does the heavy lifting; you stay in charge of the questions, the checks and the conclusions.**

## Two modes of AI analysis

1. **Code-executing mode.** The assistant writes and runs code (for example Python in a sandbox) on your uploaded data and reports results. Numbers come from computation, which is far more reliable, and you can inspect the code.
2. **Text-only mode.** The model reads data pasted into the prompt and answers from "reading" it. Fine for small tables and qualitative observations, but models can miscount, misadd and misremember rows, especially in large tables.

**Rule:** for any number that matters, make sure it comes from executed code or a formula you can check, not from the model's reading of the data.

## The six-step workflow

1. **Frame the question.** What decision will this analysis inform? What would change your mind? Write it down.
2. **Understand the data.** Source, time period, definitions, granularity (one row per what?), known issues.
3. **Prepare the data.** Clean, standardize and document every change (next lesson).
4. **Explore and analyze.** Summaries, segments, trends, comparisons, with AI generating code and you reviewing it.
5. **Verify.** Reconcile totals to a trusted source, spot-check rows, rerun key numbers a second way.
6. **Communicate.** Charts, narrative, uncertainty, and the recommendation, with assumptions stated.

AI can help at every step, but steps 1, 5 and the final judgment in 6 are yours.

## Prompting for analysis

A strong analysis prompt includes context about the data and the decision:

```text
Context: This CSV has one row per online order from Jan-Jun 2026 for our
UK and UAE stores. Columns: order_id, order_date, country, channel,
revenue_gbp (converted at monthly average rate), discount_code, new_customer.

Decision: whether to continue the "SUMMER10" discount in July.

Task: Using Python, (1) check data quality (missing values, duplicates,
date range), (2) compare average order value and repeat-purchase rate for
orders with and without SUMMER10, by country, (3) show the code and
results. Flag anything that limits what we can conclude.
```

Notice: grain (one row per order), definitions (currency conversion), decision, explicit request for code and limitations.

## Data privacy first

Before uploading data to any AI tool:

- Check your organization's policy on which tools are approved for which data.
- Remove or pseudonymize personal data you do not need (names, emails, phone numbers). Often an ID is enough.
- Be careful with commercially sensitive data; check the tool's data retention and training settings.
- Aggregate where possible: many questions can be answered from summarized data.

## Worked example

A marketing manager asks an assistant, in text-only mode, "Which campaign had the best return?" after pasting 400 rows. The assistant confidently names a campaign and a figure. Rerunning the question in code-executing mode shows a different winner: the text-only answer had silently skipped rows. The lesson is not that AI is useless, but that the mode matters and verification is non-negotiable.

## What good looks like

At the end of an AI-assisted analysis you should be able to answer:

- Where did every key number come from (which code or formula)?
- What cleaning was applied, and could someone reproduce it?
- What are the main limitations and alternative explanations?
- What would you need to see to change the recommendation?

## Hands-on: an analysis brief you paste before every task

Save this as a snippet. It front-loads the context that models otherwise guess:

```text
ANALYSIS BRIEF
Decision:        what will we decide, by when, who decides
Data:            file/table names; grain (one row per ___); period; source system
Definitions:     revenue = ___ (gross/net, VAT?); active customer = ___; currency and FX rule
Known issues:    test orders, refunds, tracking changes, missing periods
Method rules:    compute every number with code and show it; report group sizes; no causal claims
                 unless the data is from a controlled test; flag limitations
Output:          1) data-quality summary 2) tables with counts 3) chart(s) 4) 5-line summary with caveats
```

## A verification log

Keep a short log per analysis so anyone can audit it later:

```text
Number                      Where computed            Checked how                          Result
Total revenue H1            pandas: df.revenue.sum()  Reconciled to finance export         within 0.4%
SUMMER10 AOV (UAE)          groupby cell 12           Recomputed in pivot table            match
Repeat rate difference      cell 15                   Group sizes checked (n=1,204 / 988)  ok, but not causal
```

## Second worked example: a Karachi distributor's credit decision

A distributor asks an assistant whether to extend 60-day credit terms to small retailers. The analyst writes the brief first: decision (extend or not, by region), grain (one row per invoice), definitions (late = paid more than 15 days after due date), known issues (two months of missing data after a system migration). The assistant, in code-executing mode, computes late-payment rates by region and retailer size with counts, flags the missing months, and notes that current late rates under 30-day terms may not predict behavior under 60-day terms. The recommendation becomes a limited pilot in one region, not a blanket change.

## Going further

For recurring analyzes, move from chat to scripts or notebooks: ask the AI to produce a reusable, commented script that reads the raw export, applies the documented cleaning, and outputs the tables and charts. You then review it once, version it, and rerun it monthly, rather than re-prompting and hoping for consistent results.

## Video lecture: A trustworthy AI analysis workflow

Lecture coming soon · 15 chapters · about 9 minutes. Read the full transcript below.

1. The AI analysis workflow
2. Why it matters
3. Two modes
4. The rule
5. Six steps
6. Division of labor
7. Example 1: the skipped rows
8. Example 2: Karachi credit terms
9. Watch me do it, part 1
10. Watch me do it, part 2
11. Privacy first
12. Common mistakes
13. What good looks like
14. Recap
15. Try this now

## Lecture transcript

### The AI analysis workflow

An AI assistant just told you that your summer discount increased repeat purchases by twenty-three percent. It sounds precise. It sounds confident. Is it true? You have no idea yet, and that's the point of this lecture. You'll learn the two modes AI works in when it analyzes data, a six-step workflow that keeps you in charge, an analysis brief you can paste before every task, a verification log that makes your work auditable, and the privacy basics before you upload anything.

### Why it matters

Why does this matter? Because AI assistants can now read spreadsheets, write formulas, generate SQL and Python, run code, draw charts and summarize findings in plain language. Work that took hours takes minutes. The trap is that the same fluency makes wrong answers look right. A paragraph about a twenty-three percent uplift is persuasive whether or not the number is real. The goal of this course is simple: get the speed without the trap. AI does the heavy lifting. You stay in charge of the questions, the checks and the conclusions.

### Two modes

Here's the core idea: AI analyzes data in two very different modes. In code-executing mode, the assistant writes and runs code, usually Python, on your uploaded data, and reports the results. The numbers come from computation, and you can inspect the code. In text-only mode, the model reads data pasted into the prompt and answers by reading it. That's fine for small tables and qualitative observations, but models can miscount, misadd and skip rows. Think of it like the difference between a calculator and someone doing sums in their head while talking.

### The rule

So here's the rule: for any number that matters, make sure it comes from executed code or a formula you can check, not from the model's reading of the data. In twenty twenty-six, the major assistants, ChatGPT, Claude and Gemini, can all run code on uploaded files in many plans, and spreadsheet tools like Excel and Google Sheets have built-in assistants. Next lesson covers the tool landscape. For now, just check which mode you're in before you trust a number.

### Six steps

Now the six-step workflow. One, frame the question: what decision will this inform, and what would change your mind? Two, understand the data: source, period, definitions, granularity, meaning one row per what, and known issues. Three, prepare it: clean, standardize and document every change. Four, explore and analyze, with AI generating code and you reviewing it. Five, verify: reconcile totals to a trusted source, spot-check rows, rerun key numbers a second way. Six, communicate: charts, narrative, uncertainty and a recommendation with assumptions stated.

### Division of labor

AI can help at every step, but steps one and five, and the final judgment in step six, are yours. Here's an analogy. AI is like a very fast junior analyst who never gets tired but has never met your business. You'd happily let them build the tables and draft the charts. You would not let them decide what question matters, or sign off the numbers, or tell the board what to do. That division of labor is the heart of trustworthy AI analysis.

### Example 1: the skipped rows

First example, a simple one. A marketing manager pastes four hundred rows into a chat, in text-only mode, and asks which campaign had the best return. The assistant confidently names a campaign and a figure. Rerunning the same question in code-executing mode gives a different winner. The text-only answer had silently skipped rows. The lesson isn't that AI is useless. It's that the mode matters, and verification is non-negotiable.

### Example 2: Karachi credit terms

Second example, a business case. A Karachi distributor asks whether to extend sixty-day credit terms to small retailers. The analyst writes a brief first. Decision: extend or not, by region. Grain: one row per invoice. Definition: late means paid more than fifteen days after the due date. Known issue: two months of missing data after a system migration. The assistant, running code, computes late-payment rates by region and retailer size with counts, flags the missing months, and notes that behavior under thirty-day terms may not predict behavior under sixty-day terms. The recommendation becomes a pilot in one region.

### Watch me do it, part 1

Watch me write an analysis brief. Decision: whether to continue the SUMMER10 discount in July. Data: orders CSV, one row per order, January to June twenty twenty-six, UK and UAE stores. Definitions: revenue in pounds, converted at the monthly average rate; a repeat customer ordered again within ninety days. Known issues: test orders from our own email domain, and refunds shown as negative rows. Method rules: compute every number with code and show it, report group sizes, no causal claims unless the data comes from a test. Output: quality summary, tables with counts, one chart, and a five-line summary with caveats.

### Watch me do it, part 2

Then I keep a verification log as I go. For each key number: where it was computed, how I checked it, and the result. Total revenue for the first half: computed with pandas, reconciled to the finance export, within half a percent. Average order value for SUMMER10 in the UAE: recomputed in a pivot table, match. Repeat rate difference: group sizes checked, around twelve hundred and a thousand, fine, but not causal. Three lines, and anyone can audit my work later, including me in six months.

### Privacy first

Now privacy, before you upload anything. Check your organization's policy on which tools are approved for which data. Remove or pseudonymize personal data you don't need, like names, emails and phone numbers. Often an id is enough. Be careful with commercially sensitive data, and check the tool's retention and training settings. And aggregate where possible, because many questions can be answered from summarized data. A table of revenue by week and channel is rarely a privacy problem. A table of customers with their phone numbers is.

### Common mistakes

Common mistakes. Trusting numbers from text-only mode. Skipping the framing step, so the analysis answers a question nobody asked. No reconciliation to a trusted total. Uploading personal data because it was quicker. And re-prompting every month instead of saving a reviewed script. For recurring analyzes, ask the AI to produce a reusable, commented script or notebook, review it once, version it, and rerun it.

### What good looks like

How do you know your workflow is working? At the end of any AI-assisted analysis, you should be able to answer four questions. Where did every key number come from? What cleaning was applied, and could someone reproduce it? What are the main limitations and alternative explanations? And what would you need to see to change the recommendation? If you can answer all four in a couple of minutes, your analysis is trustworthy, whoever or whatever did the typing.

### Recap

Recap. AI speeds up analysis, but fluent answers can be wrong. For numbers that matter, use executed code or checkable formulas. Follow six steps: frame, understand, prepare, explore, verify, communicate, and keep framing, verification and judgment for yourself. Paste a brief before every task, keep a verification log, and protect personal data before uploading.

### Try this now

Try this now. Take a question you need to answer from data this month. Write the analysis brief from the lesson: decision, data grain, definitions, known issues, method rules and output. Paste it into an assistant in code-executing mode, run the analysis, and start a verification log with at least three numbers you've checked a second way.

## Video transcript

Welcome to AI for Data Analysis and Decision Making. Let's start with the most important idea in the whole course.

AI assistants have become astonishingly good at analysis work. They can clean messy spreadsheets, write formulas, SQL and Python, draw charts, and explain results in plain language. But the same fluency that makes them useful makes them dangerous. A wrong number, written confidently, looks exactly like a right one.

So here's the rule. For any number that matters, make sure it came from executed code or a formula you can check, not from the model reading your data and telling you what it thinks it saw. When you paste hundreds of rows into a chat, models can skip rows, misadd, or blend things up. When the assistant writes code and runs it, the numbers come from computation, and you can inspect exactly how.

We'll use a simple six-step workflow throughout the course. Frame the question: what decision does this analysis inform? Understand the data: where it came from, and what one row represents. Prepare it, documenting every change. Explore and analyze, with AI writing the code and you reviewing it. Verify, by reconciling totals and checking a few rows by hand. And finally, communicate: charts, a clear story, and honest uncertainty.

AI can help at every step. But framing, verification and the final judgment stay with you. That's not a limitation. It's what makes your analysis trustworthy, and it's what makes you valuable.

## Key takeaways

- AI speeds up analysis, but fluent answers can be wrong; you own questions, checks and conclusions.
- For numbers that matter, use executed code or checkable formulas, not the model's reading of pasted data.
- Follow six steps: frame, understand, prepare, explore, verify, communicate.
- Protect personal and sensitive data before uploading, and move recurring work into reviewed scripts.

## Try it

Take a question you need to answer from data this month. Write the decision it informs, the data grain and definitions, and a prompt following the example structure.

- [Next: The AI analysis tool landscape in 2026: assistants, spreadsheets, notebooks and MCP](https://optimizeall.com/learn/ai-for-data-analysis-and-decision-making/ai-analysis-tools-2026)
- [All lessons of AI for Data Analysis & Decision Making](https://optimizeall.com/learn/ai-for-data-analysis-and-decision-making)
