Summary
Set up the way Snowflake's wizard builds it, the agent passed 20 of 27 questions. With the business definitions written down, it passed all 27.
The failures are the interesting part. None of them looked wrong. 1995 revenue came back as $33.22 billion instead of $33.26 billion, off by 0.13%.
That's the kind of number nobody questions in a meeting, and it was still the wrong definition of revenue.
If your team has a Cortex agent in front of business users, this is the risk to check for: answers that are plausible, consistent and quietly built on a definition your finance team doesn't use.
How it was tested
One agent, two versions, one fixed question set.
| Before | After | |
|---|---|---|
| Data | TPC-H SF1 (Snowflake sample): 1.5M orders, 6M order lines, 1992 to Aug 1998 | Same |
| Agent | Cortex Agent, Claude Sonnet 5.5, version 1 | Same agent, version 2 |
| Semantic view | Generated by Snowflake's Autopilot wizard, accepted as is | Written by hand: named metrics, default meanings, scope rules |
| Agent instructions | One line, generic tool description | Scope, answer style, a tool description that says what the data covers |
| Questions | 27, in five groups | Same 27 |
The question groups are plain lookups, ambiguous business terms ("revenue", "active customers", "biggest customers"), join traps that double-count, questions the data can't answer, and a separate round of breaking changes to the tables.
What the wizard setup got wrong
All seven failures came from the same root: the agent had to guess what a business word meant, and it guessed reasonably but differently from the house definition.
| What was asked | What the agent did | Why it matters |
|---|---|---|
| Revenue for 1995, for Q2 1996, by region for 1996 | Dated revenue by order date, not ship date. On two of the three, it also listed net and gross revenue side by side | Figures were 0.1% to 0.5% off, close enough to pass a casual check |
| Top parts in 1995, profit by supplier nation, same-nation revenue in Asia | Same order-date choice | Rankings and totals that don't reconcile with finance |
| "How many active customers do we have?" | Returned three different numbers | No definition existed, so the agent offered options instead of an answer |
What the wizard setup did well matters too. It refused to invent revenue for 2023, said Singapore isn't in the data, and said there is no customer satisfaction data rather than making up a proxy. The problem isn't a careless agent. It's an agent left to make business decisions nobody wrote down.
What changed
The business definitions went into the semantic view, the layer the agent reads before it writes any SQL. Most teams try to fix wrong answers by adding text to the agent's prompt. That puts the rule in a layer that doesn't make the decision, so the fix is fragile.
| Gap in the wizard setup | What the semantic view now says | Questions fixed |
|---|---|---|
| No metrics, so the agent builds formulas on the fly | 15 named metrics, e.g. net revenue = price × (1 − discount) | All seven |
| "Revenue" undefined | Default is net revenue dated by ship date; gross only when asked | 6 of the 7 |
| "Active customer" undefined | Ordered in the 12 months to the latest order date | 1 |
| One country table shared by customers and suppliers | Customer and supplier geography kept apart | 2 |
| Data range not stated | 1992-01-01 to 1998-08-02; "latest" means latest in the data | Sharper answers on empty periods |
The agent's own instructions changed too: what the data covers, when not to use the tool, and to state the definition it used. Each rule sits in the layer that owns it: meaning in the semantic view, wording in the agent.
Result: all 21 automatically scored questions passed, up from 14, and none that passed before broke.
When the data changed
A well-defined agent is only right until the data moves under it. Three changes that happen in real warehouses were made to the tables, then the improved agent was asked the affected questions again.
| Change | What the agent did | Verdict |
|---|---|---|
| Discount column renamed | Said net revenue couldn't be calculated because a column was missing, and didn't guess | Good A clear stop, not a wrong number |
| Discount stored as 5 instead of 0.05 | Noticed revenue had gone negative, rewrote the formula itself, and got the right figure, labelled "provisional" | Risky Right number, but an agent shouldn't quietly change a governed metric |
| New orders added after the documented end date | Trusted the written "data ends August 1998" and left the new orders out | Wrong The documentation went stale |
Writing definitions down fixes accuracy. Those definitions then need the same regression tests as code.
A test suite that runs after every schema change or data load is what catches this, not a person reading answers.
Five checks for your own Cortex agent
- Ask it for "revenue" for last quarter, then ask finance. If the numbers differ by a fraction of a percent, find out which date and which discount the agent used.
- Open your semantic view and count the metrics. If there are none, every answer depends on the agent inventing a formula.
- Ask a question with an undefined business term, such as "active customers". One number with its definition is good. Several numbers, or one number with no definition, means the term needs writing down.
- Check where your fixes live. If past fixes were added to the agent's prompt, some of them are probably in the wrong layer.
- Ask what happens after the next schema change. If nobody re-tests the agent's answers after a column rename or a data load, you'll find out from a business user.
How a client audit goes further
This demo is deliberately simple. Here is where real work differs, and why the audit is built the way it is:
- The fixes here were written knowing the questions. In an audit, the questions come from your business users, and a held-back set the fixes never see decides the final score.
- Two layers changed at once here. In an audit, each fix is tested on its own, so you know which change earned which point.
- The data here is a clean public benchmark. Your warehouse has messier keys, late-arriving data and more ways to be wrong, which is where a regression suite earns its keep.
- This is one model on one day. Agent behaviour shifts between model versions, so the suite is built to be re-run, not run once.
A naming note: Snowflake announced a separate Business Ontology feature in November 2026, now in private preview. Nothing here uses it. Everything in this test runs on semantic views and Cortex Agents, which are generally available today.
Next in this series: the same questions and definitions on an agent built directly on the Claude API.
Everything published here uses public benchmark data. The demo code (question set, scoring rules and semantic views) is available on request.