

How to test AI for finance before you trust it with the close
AI for finance teams does well today at repeatable analysis with a checkable answer: flagging budget variances, drafting variance commentary, catching errors and anomalies, pulling figures out of documents, and answering questions about governed data. Before the team relies on it, the tool needs the controls finance already applies to people and spreadsheets: a test against known answers, a qualified reviewer for anything material, a record of the query behind each number, and a retest after every change.
COSO, which publishes a widely used internal control framework, warns that generative AI "can be confidently wrong" (COSO). Variance commentary shows the risk most plainly. A fluent paragraph that names the wrong cause can pass a rushed month-end review because it reads well.
Where finance teams use AI now
Gartner's 2025 AI in Finance Survey of 183 CFOs and senior finance leaders found 59% using AI in the finance function. The most common uses were knowledge management (49%), accounts payable process automation (37%), and error and anomaly detection (34%). The largest obstacles were data literacy and technical skills, and data quality and availability (Gartner survey, reported by CPA Practice Advisor). COSO's guidance announcement notes that organizations already use AI-enabled tools "to automate reconciliations, accelerate analysis, and support decision-making" (COSO).
Task by task, the work divides between the tool and a person:
| Task | What AI does | What a person owns |
|---|---|---|
| Variance flags | Computes budget versus actual by account and applies the materiality rule | The rule, and the budget version it compares against |
| Variance commentary | Drafts the first explanation from ledger and operating detail | Sign-off, and any cause the data does not show |
| Error and anomaly checks | Flags duplicate payments, unusual journal entries, and breaks in a trend | Whether a flag is an error or a known event |
| Document extraction | Pulls amounts, dates, and terms from invoices and contracts | Low-confidence fields, and anything that posts to the ledger |
| Questions on governed data | Answers a question such as contractor spend by department, with the query shown | The metric definitions it uses |
| First-draft forecasts | Projects drivers from history | The assumption behind each driver |
Flags, error checks, extraction, and governed questions all produce output that a person can check against arithmetic or a source document, and those tasks work best. Commentary and forecasts are judgments, so they need more review.
Testing an AI variance check on October's close
Picture the controller at a software company in the first week of November. October is closed, and the team wants an AI tool to compute expense variances, apply the materiality rule, and draft commentary for the lines it flags. Both the company and its ledger are invented and describe no real customer. A short script recomputed every ratio below.
The rule flags an expense account when the variance from the approved reforecast is at least $25,000 and at least 10% of budget. Variance is actual minus budget, so a positive variance means overspend.
| Account | Budget | Actual | Variance | Variance % | Flagged |
|---|---|---|---|---|---|
| Payroll | $820,000 | $836,000 | +$16,000 | +2.0% | No |
| Contractors | $120,000 | $168,000 | +$48,000 | +40.0% | Yes |
| Cloud hosting | $210,000 | $246,000 | +$36,000 | +17.1% | Yes |
| Software subscriptions | $95,000 | $101,000 | +$6,000 | +6.3% | No |
| Travel | $60,000 | $31,000 | -$29,000 | -48.3% | Yes |
| Marketing programs | $300,000 | $272,000 | -$28,000 | -9.3% | No |
| Rent | $150,000 | $150,000 | $0 | 0.0% | No |
| Recruiting fees | $40,000 | $52,000 | +$12,000 | +30.0% | No |
| Total | $1,795,000 | $1,856,000 | +$61,000 | +3.4% | — |
Contractors, cloud hosting, and travel meet both tests. Marketing programs is $28,000 under budget but only 9.3% off, so the rule skips it, and recruiting fees is 30% over but only $12,000. The rule works as written. If the CFO wants to hear about a $28,000 swing in marketing, change the rule in writing and retest; do not patch the prompt.
Before go-live, the team runs the same check on July, August, and September: 24 account-months where the controller's team already knows the answer. The reference flags 9 of them.
| Run | AI flags | Matched reference | False alarms | Missed | Catch rate | False-alarm share |
|---|---|---|---|---|---|---|
| First run | 10 | 8 | 2 | 1 | 88.9% | 20.0% |
| Second run, after the definition fix | 9 | 9 | 0 | 0 | 100.0% | 0.0% |
Catch rate is matched flags divided by reference flags: 8 ÷ 9 = 88.9%. False-alarm share is false alarms divided by AI flags: 2 ÷ 10 = 20.0%. All three errors in the first run had one cause. The tool compared actuals with the original annual budget, while the finance team reviews against the approved reforecast. A written definition and a retest fixed it.
The controller then reads the nine draft explanations from the second run, accepts six as written, edits two, and rejects one that blames the contractor overrun on a project no ledger line supports. That is 6 ÷ 9 = 66.7% accepted unchanged, and 1 ÷ 9 = 11.1% unsupported.
The two results call for different treatment. The flags are arithmetic, so after a passing test they can run every month, with a retest after any change. The commentary is judgment, and with one draft in nine unsupported, every explanation keeps a named reviewer. A test this small, 24 account-months and nine drafts, is enough to start on, and repeating it each quarter builds the record.
What COSO expects, mapped to the October test
COSO's publication, Achieving Effective Internal Control Over Generative AI, released in February 2026, explains why AI needs controls of its own. Generative AI outputs "are probabilistic and can be confidently wrong." COSO's response: "Controls should treat outputs as claims requiring validation, rather than as facts to accept by default." Models, prompts, and the data they retrieve "can evolve frequently," and automation that scales quality can also scale errors. AI is easy enough to adopt that "shadow AI" appears: AI used outside formal IT oversight (COSO).
An MIT Sloan article based on a conversation with finance professor Andrew Lo makes the same point about language models, which "are trained to convey confidence in their outputs, regardless of whether those outputs are correct" (MIT Sloan). The rejected draft in the October test fits that description: well written, specific, and backed by no ledger line.
COSO lists controls for all AI uses and stricter ones for judgment and forecasting work. Each one maps onto the October check:
| Control | COSO's expectation | In the October check |
|---|---|---|
| Validation | Test AI performance before and after deployment, and retest periodically | Run the check on closed months with known answers, and retest after any model, prompt, or definition change |
| Segregation of duties | Separate configuring AI settings from approving or reviewing outputs | The person who edits the materiality rule does not sign the commentary |
| Guardrails | Require more review or source citations, or block action, when output confidence is too low | Every explanation names the ledger lines behind it, and drafts without support go back |
| Change control | Documented approvals and evidence for changes to prompts, thresholds, and retrieval sources | Log each change to a threshold or definition, with the approver |
| Qualified review | Qualified reviewers for all material outputs | A named controller signs each flagged line |
| Hindsight analysis | Compare forecasts with actual results and investigate significant variances | Compare each AI forecast with actuals the following month |
COSO's own reconciliation example shows these controls working together. An AI agent posts a match automatically only when its confidence exceeds a validated threshold and no policy exception applies. Every other item goes to a human review queue, and any change to the threshold needs multi-party approval and post-change sampling. COSO also suggests tracking metrics such as forecast mean absolute percentage error, a hallucination rate from sampling, and the percentage of decisions with reviewer sign-off.
The rules to write down, and the shortcuts that undo them
Before AI touches the close, finance should settle these in writing:
- Which budget or forecast version each report compares against. The October test failed on this one.
- The materiality rule: the dollar and percentage thresholds, and whether both must hold.
- Data access: who may see payroll and other sensitive lines, and whether the AI tool applies the same limits to each person who asks.
- The evidence to keep: the query, the input data, the output, the reviewer, and the date.
- Retest triggers: a new model version, a prompt change, a new definition, or a change to the chart of accounts.
The common shortcuts each skip one of those rules. Teams judge a draft by how well it reads, when the cited ledger lines deserve the first look. They let AI post or approve without a validated threshold and a review queue. An analyst pastes a trial balance into a personal chat account, which is the shadow AI COSO warns about. And a vendor ships a model update that nobody retests, although COSO notes that performance shifts "as data changes or a vendor releases an update," which makes the update a change like any other.
Running the variance check in Orion
Spreadsheets handle the October table well, and most variance files start in one. Invoice capture, matching, and posting belong in the ERP or close software that owns the transaction, because the approval record lives there too. A general chat assistant can help draft a memo or explain a formula, but pasting ledger extracts into one is how shadow AI starts.
Gravity's analytics platform, Orion, handles the recurring analysis between the ledger and the review. The controller gives it the finance team's rules: the budget version to compare against, the materiality thresholds, the owner of each cost center, and what a complete explanation contains. Those rules go into Orion's Context pages, which every analysis reads, so the comparison that tripped the first test run is settled once, in writing.
When the ledger cannot explain a line, such as travel at half its budget, Orion puts the question to the team on an Observatory card. If an answer changes a rule, Orion proposes the revised rule as a Context card that the team can apply or dismiss. The same cards carry the analyses Orion suggests, such as the monthly variance check itself.
Each analysis keeps its SQL and Python in a notebook that the controller can inspect, edit, and rerun, so the reviewer has the query behind every number. To try it on October, the controller might ask: "Using the approved reforecast defined in Context, compare October actuals with budget by expense account. Flag accounts where the variance is at least $25,000 and at least 10% of budget. For each flagged account, draft a one-sentence explanation that cites the ledger lines behind it, and mark any explanation the data does not support. Show the SQL."
When the flags match the reference calculation and the team asks for it, Orion builds the check into a Workflow and dry-runs it before anything is saved. After the controller approves it, the Workflow runs each month after close: it computes the variances, flags the lines that meet the rule, and drafts commentary for those lines. Read against the COSO table, the Context page records the written definition and the notebook keeps the evidence. Qualified review stays with the controller, who signs each explanation, and posting stays in the ERP. For more on AI-assisted analysis in business teams, see the practical guide to augmented analytics.
Start with the variance flags
Pick one recurring task with a known answer, such as the variance flags, and test it on closed months before anyone relies on it. Write down the pass mark, the reviewer, and the retest triggers.
In the October test, the flags passed after one definition fix, and the commentary still needed a reviewer. Carry that split into the close: the arithmetic can run on a schedule, and a named person stays accountable for every explanation that reaches the CFO.