Two Net Revenues, One Agent: Building a Governed Business Ontology in Snowflake Before the Native… Snowflake has announced Business Ontology, a governance layer for enterprise metric definitions, but the feature is in private preview and was not available in the author's account, so the author rebuilt the same governance model from generally available Snowflake primitives and deployed it end to end. The build treats a governed ontology as an authorization problem first, using a single row access policy (CORE.RAP_ONTOLOGY_OBJECT) over concepts, versions, edges, representations, drift and audit rows, and a probe procedure that showed role functions inside an EXECUTE AS OWNER procedure see the owner while CURRENT_USER() returns the caller. The author's example is two conflicting definitions of net revenue — Finance's recognized revenue after refunds and discounts versus Sales' bookings net of discounts at signing — which an agent pointed at both semantic views cannot choose between. Ask an AI agent “what was net revenue last quarter?” and it will happily give you a number. The problem is that most enterprises have at least two correct answers. Finance means recognized revenue after refunds and discounts. Sales means bookings net of discounts at signing. Semantic views fix how a number is computed, but they don’t record which meaning the business stands behind , who approved it, or who is allowed to see it. Snowflake has announced Business Ontology for exactly this gap. It is in private preview, and it wasn’t available in the account I was working in. So I built the same governance model from generally available primitives and deployed it end to end. The thesis: a governed ontology is an authorization problem first and a modeling problem second. If you get the trust boundaries wrong, the agent will quote definitions to people who should never see them. A semantic view is authoritative for a calculation. It is not an approval workflow, and it doesn’t model the relationship between two teams’ definitions. In the demo estate I built, both of these exist and both are right: Finance.Net RevenueSales.Net RevenueDefinitionRecognized revenue after refunds and discountsBookings net of discounts at signingTime policyRecognition dateSigning dateExclusionsIntercompany invoices, test accountsNoneComputed byFINANCE REVENUE SV → INVOICES.NET REVENUESALES BOOKINGS SV → BOOKINGS.NET REVENUEApproverFinance stewardSales steward An agent pointed directly at both semantic views has two metrics with the same name and no basis for choosing between them. Three decisions shape everything else: One policy covers concepts, versions, edges, representations, drift and audit rows. It takes domain id, status, author : php ALTER ROW ACCESS POLICY CORE.RAP ONTOLOGY OBJECT SET BODY - IS ROLE IN SESSION 'ONTOLOGY ADMIN' OR -- every strict ancestor domain must be navigable USAGE SELECT COUNT FROM CORE.DOMAIN ANCESTOR a WHERE a.domain id = p domain id AND a.depth 0 = SELECT COUNT DISTINCT a.ancestor id FROM CORE.DOMAIN ANCESTOR a JOIN CORE.DOMAIN ACCESS x ON x.domain id = a.ancestor id AND x.privilege = 'USAGE' WHERE a.domain id = p domain id AND a.depth 0 AND IS ROLE IN SESSION x.role name AND EXISTS SELECT 1 FROM CORE.DOMAIN ACCESS x WHERE x.domain id = p domain id AND IS ROLE IN SESSION x.role name AND x.privilege = 'MODIFY' OR x.privilege = 'READ' AND p status IN 'APPROVED','SUPERSEDED' OR x.privilege = 'SUGGEST' AND p author = CURRENT USER ; What matters here: Consumers get SELECT on API secure views and nothing in CORE. An integration test asserts that even a steward can't query CORE.CONCEPT directly. My first design checked steward rights inside owner’s-rights procedures with IS ROLE IN SESSION. Before writing any workflow code, I deployed a probe procedure and called it from a restricted role with secondary roles off: {"role": "ONTOLOGY ADMIN", "user": "SATISH", "in probe": false} Inside an EXECUTE AS OWNER procedure, role functions see the owner, but CURRENT USER is the caller . Any steward check written with IS ROLE IN SESSION would silently evaluate the service role's privileges. Approving would either always succeed or always fail, depending on what the service role holds. So authorization walks the grant graph upward from the domain’s privilege role until it reaches the calling user: python def user holds role session, role, user : frontier, visited = role.upper , set while frontier: r = frontier.pop if r in visited: continue visited.add r for g in session.sql f'SHOW GRANTS OF ROLE "{r}"' .collect : g = g.as dict if g "granted to" == "USER" and g "grantee name" .upper == user.upper : return True if g "granted to" == "ROLE": frontier.append g "grantee name" .upper return False The consequences, which I’d rather state than hide: Every write procedure validates, writes and records its AUDIT EVENT in one transaction. Callers have no DML at all. I enforced only rules that change how a concept is interpreted. Each one is a unit test: The APPLIES TO rule is what lets the agent say "periods by recognition date" without the policy being baked into its prompt. The agent has two ontology tools, search business ontology and get concept details. Both are caller's-rights SQL procedures over the secure views: tool resources: search business ontology: type: procedure identifier: ONTOLOGY DB.API.SEARCH CONCEPTS execution environment: {type: warehouse, warehouse: COMPUTE WH} A Cortex Search service would have ranked better. My reasoning a design assumption, not something I benchmarked was that a service built over the concept table indexes it with its owner’s view of the data. Role filtering would then become a filter the agent chooses to apply, rather than a policy the platform enforces . A caller’s-rights procedure keeps the row access policy in the path. The search returns policies, edges, implementing metrics and an ambiguous terms list. That list is the agent's cue to ask a clarifying question instead of guessing. I wrote 21 integration tests that run as six personas: author, Finance steward, Sales steward, Finance analyst, an exec with both domains, and an outsider. The checks include: All 21 pass, along with 20 unit tests and 2 agent-behavior tests. Lessons from making them pass. None of these are in a tutorial. One more environment constraint is worth stating plainly. My Snowsight sandbox routes connections through a proxy that only accepts OAuth, so the key-pair persona users couldn’t log in. The harness has a fallback mode: my own user holds exactly one persona role at a time, with secondary roles off. Visibility and privilege checks remain fully real. Separation of duties can’t be tested positively with one human, so dev turns it off, and a dedicated test proves it blocks self-approval when on. CI uses separate users. As a role with both Finance and Sales READ: User: What was net revenue last quarter? Agent: “Net revenue” has two approved definitions… Finance.Net Revenue… Sales.Net Revenue… Which one should I use? User: Finance. Agent: … $3,767,662.13 … from 784 reportable invoices. Policies applied: Finance.Revenue Recognition Policy. Exclusions: intercompany invoices, test accounts. Number: GOVERNED FINANCE REVENUE SV.INVOICES.NET REVENUE . An independent SUM invoice - SUM refund - SUM discount over the reportable view for July–September 2026 returned the same $3,767,662.13 across 784 invoices. As the Finance-only analyst, the agent never asked a question. It couldn't see the Sales definition, so for that user there was no ambiguity. The demo data is synthetic, so treat this as proof of behavior, not a business result. Deploy with bash deploy.sh, which unit-tests, deploys, seeds the demo and smoke-tests in one go. Then run these. The full list is in docs/TESTING.md. 1. Ambiguity is per user. Ask the agent in Snowsight AI & ML → Agents → ONTOLOGY AGENT “What was net revenue last quarter?” under two roles: GRANT ROLE ONT DEMO EXEC ROLE TO USER