Designing Governed AI with Snowflake

A practical architecture case study: design a governed, multi-agent AI platform on Snowflake, starting with the prerequisites and project setup.

  • #snowflake
  • #ai
  • #data engineering
  • #architecture
Part 1 of 1— Governed AI with Snowflake
  1. Designing Governed AI with Snowflake

A bank analyst asks why profitability fell this quarter. The answer may sit across finance tables, unusual transaction patterns, internal procedures, and regulatory guidance. Designing an AI system to investigate that question means solving more than a prompting problem: the data, tools, permissions, evidence, and human review all matter.

In this series, I’ll teach the architecture behind Northstar Finance, a governed AI investigation platform for a hypothetical European bank. Throughout the series, I’ll focus on the system around the model: how to shape the data foundation, divide work into bounded capabilities, control tool access, evaluate results, and operate the whole platform responsibly.

The problem I want to address

Financial teams often have data spread across systems and documents. Investigating a change can mean stitching together reports, checking definitions, and searching for relevant policy by hand. AI can help bring that evidence together, but a confident-sounding answer is not enough when people need to understand where it came from and what remains uncertain.

Northstar Finance gives us a concrete architectural case study. A user asks a focused business question; the system orchestrates approved work across data and knowledge sources; the response brings back evidence, uncertainty, and next steps. Any consequential action stays with a human reviewer. I’ll show how to design that flow so the result is inspectable, bounded, and useful to the people making decisions.

What I plan to build

The architecture combines a Snowflake data foundation with structured financial analytics, search over approved documents, and specialist AI capabilities coordinated by an explicit agent workflow. The key design choice is to make responsibilities and boundaries visible: which data and tools each component can access, how findings are combined, and what happens when evidence is missing or an AI agent fails.

We’ll work through financial performance investigations, unusual patterns in synthetic transaction data, and policy or regulatory research, then see how those findings can support a cross-domain investigation. Along the way, I’ll explain the trade-offs in orchestration, semantic context, retrieval, least-privilege access, evaluation, and observability.

Built with synthetic data, explained with evidence

Northstar Finance is fictional, and the project will use synthetic data only. It is a reference implementation, not a production banking system. It will not make credit decisions, determine regulatory compliance, identify real people as fraudulent, or take autonomous account actions.

Those boundaries are part of the engineering challenge, not footnotes. A credible enterprise AI design accounts for access control, human review, evaluation, monitoring, and cost alongside agents and data models.

Before you start: prerequisites

You don’t need banking knowledge or real banking data to follow along, but you do need a few things in place. Check that you have each of them before you start.

Skills

  • Comfortable reading and writing SQL, and enough Python to run small scripts.
  • Everyday Git: branches, commits, and pull requests.
  • Basic Snowflake vocabulary: warehouse, database, schema, and role. If those terms are new, my dbt and Snowflake setup post explains them with examples.

A Snowflake account

RequirementWhy Northstar Finance needs it
Standard edition or higherEvery step in this post works on Standard, Snowflake’s base edition, so that’s the baseline for the series. A free trial lets you choose the edition when you sign up.
An EU regionI have designed the scenario around a European bank, so its data and AI processing should stay in Europe. Cortex AI model availability also varies by region.
ACCOUNTADMIN accessA few one-off steps need it: the spending limit, the cross-region inference setting, and AI access grants. Most of the work in the series uses a dedicated project role.
A monthly credit ceilingWarehouses and AI calls both consume credits. Pick the limit now, not after the first bill.

Masking and row access policies require Enterprise edition. These are Snowflake’s column-level controls (masking policies hide or redact sensitive values) and row-level controls (row access policies limit which rows a role can see). Neither is available on Standard. On Standard, this series approximates them with secure views and separate roles: each role reads a view that filters out rows and hides columns it shouldn’t see. The difference is where the rule lives. A policy is attached to the table, so it applies to every query. A secure view only protects data read through that view, so the underlying tables must stay out of reach of every other role, and the rules are spread across view definitions, which makes them harder to audit. If you’re on Enterprise, use the policies directly. The editions page lists what each edition includes.

Local tools

  • Git, and an empty repository for the project.
  • Python 3.11 or later, which Snowflake CLI requires.
  • Snowflake CLI (snow), to run SQL files and test connections from the terminal.
  • Access to Snowsight, Snowflake’s web interface, for the one-off admin steps.

There’s no agent framework or orchestration library on the list. Those will be introduced with the workflows that need them.

Step 1: Lay out the project foundation

Before creating any agents, set up a small repository that makes the project’s scope and assumptions visible from the first commit. Here is the whole thing at the end of this post:

northstar-finance/
├── README.md                  # scope, safety boundaries, how to run the checks
├── .gitignore                 # keys, .env files, virtual environments
├── docs/
│   ├── architecture.md        # components and data flow, kept short
│   ├── risks.md               # what could go wrong and how we'd notice
│   └── adr/                   # architecture decision records
├── fixtures/
│   └── profitability/         # synthetic finance data and the expected answer
└── snowflake/
    ├── setup/                 # account setup SQL from Step 2
    └── checks/                # smoke test from Step 3

Each file has one job:

  • README.md states that Northstar Finance is fictional, uses synthetic data only, and makes no credit decisions or account actions. It also names the first workflow: investigating a change in profitability.
  • docs/risks.md starts with the risks you already know about, such as AI usage not being covered by the warehouse spending limit (more on that in Step 2).
  • docs/adr/ starts empty. As the series makes material decisions, each gets one short record here: the context, the decision, and its consequences.
  • fixtures/profitability/ will hold a small synthetic dataset and the evidence-backed answer we expect, so the first workflow can be tested locally before it touches Snowflake.

Notice what’s missing: no agents/ folder, prompt library, or orchestration code. Each gets added in the post that needs it, so the repository only describes what exists.

Step 3 creates a private key outside the repository. These .gitignore patterns catch it if a copy ever lands inside:

.venv/
.env
*.p8
*.pem

Step 2: Prepare the Snowflake account

Run these statements in a Snowsight worksheet, and commit them to snowflake/setup/ so the setup is reviewable and repeatable. Each block uses the least powerful role that can do the job.

Create a project role

-- snowflake/setup/01_role.sql: run as USERADMIN, which manages roles.
use role useradmin;

create role if not exists northstar_developer
  comment = 'Builds and tests Northstar Finance with synthetic data';

-- Attach the role to SYSADMIN so administrators can still manage what it creates.
grant role northstar_developer to role sysadmin;
grant role northstar_developer to user <your_user>;

One role is enough for now. Later posts add narrower roles for each specialist capability, so each one can reach only the data and tools it needs.

Add compute with a spending limit

-- snowflake/setup/02_compute.sql
use role sysadmin;

create warehouse if not exists northstar_wh
  warehouse_size = 'XSMALL'
  auto_suspend = 60              -- pause after 60 idle seconds
  auto_resume = true
  initially_suspended = true
  comment = 'Northstar Finance development compute';

grant usage on warehouse northstar_wh to role northstar_developer;

-- Only ACCOUNTADMIN can create resource monitors and assign them.
use role accountadmin;

create resource monitor if not exists northstar_monitor
  with credit_quota = 20         -- monthly ceiling; choose your own
  frequency = monthly
  start_timestamp = immediately
  triggers on 75 percent do notify
           on 100 percent do suspend
           on 110 percent do suspend_immediate;

alter warehouse northstar_wh set resource_monitor = northstar_monitor;

An X-Small warehouse uses about one credit per running hour, so 20 credits is roughly 20 hours of compute. At 100% the monitor suspends the warehouse once running queries finish; at 110% it cancels them.

There’s an important gap: resource monitors work for warehouses only. They don’t cap serverless features or AI services, so Cortex AI calls won’t stop at this limit. Track those with a Snowflake budget and add the gap to docs/risks.md.

Create a home for synthetic data

-- snowflake/setup/03_database.sql
use role sysadmin;

create database if not exists northstar_dev
  comment = 'Northstar Finance: synthetic data only';

create schema if not exists northstar_dev.raw
  comment = 'Synthetic source data, as generated';
create schema if not exists northstar_dev.curated
  comment = 'Cleaned finance tables the investigation reads';

grant usage on database northstar_dev to role northstar_developer;
grant usage, create table, create view on schema northstar_dev.raw to role northstar_developer;
grant usage, create table, create view on schema northstar_dev.curated to role northstar_developer;

Two schemas are enough for the first workflow. More schemas will be created and introduced when we need them.

Decide where AI inference may run

When a model isn’t available in your region, Cortex AI can send the request to another region. That’s convenient, but for a European bank it is a data-residency decision, so make it deliberately. Check the current setting first:

-- snowflake/setup/04_ai_access.sql
use role accountadmin;
show parameters like 'CORTEX_ENABLED_CROSS_REGION' in account;

Don’t assume the default. According to the cross-region inference documentation, organizations created after 9 March 2026 start with ANY_REGION, which allows processing in any region. For Northstar Finance, I limit it to EU regions on the same cloud. On Azure, the value is AZURE_EU; Google Cloud has no EU-only option, so use DISABLED there:

alter account set cortex_enabled_cross_region = 'AWS_EU';

DISABLED is stricter: requests stay in your account’s region, but fewer models are available.

Grant AI access explicitly

By default, Snowflake grants Cortex AI access to the PUBLIC role, so every user in the account can call models. Grant it to northstar_developer directly, so Northstar’s access doesn’t depend on that default:

-- snowflake/setup/04_ai_access.sql (continued)
grant database role snowflake.cortex_user to role northstar_developer;

Revoking the default from PUBLIC is the stricter option, but in a shared account it would cut off everyone who relies on it. I’m leaving that to the security post and recording it in the risk list. The AI privileges documentation lists what each function needs.

Step 3: Connect from your machine and prove it works

With the account ready, connect from the terminal as the project role. Install Snowflake CLI in a virtual environment:

cd northstar-finance
python3 -m venv .venv
source .venv/bin/activate
pip install snowflake-cli
snow --version

Use key-pair authentication instead of a password, so there’s no secret to type or store in plain text. Generate the key outside the repository:

mkdir -p ~/.snowflake/keys
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out ~/.snowflake/keys/northstar_key.p8 -nocrypt
openssl rsa -in ~/.snowflake/keys/northstar_key.p8 -pubout -out ~/.snowflake/keys/northstar_key.pub

-nocrypt leaves the private key unencrypted to keep this example short. Use a passphrase-protected key for anything beyond a personal sandbox.

Register the public key with your user, pasting the key body without the BEGIN and END lines:

use role accountadmin;  -- or another role that can alter your user
alter user <your_user> set rsa_public_key = '<public key body>';

Then add a connection to ~/.snowflake/config.toml (create the file if it doesn’t exist). It lives outside the repository:

[connections.northstar]
account = "<orgname>-<account_name>"
user = "<your_user>"
authenticator = "SNOWFLAKE_JWT"
private_key_file = "/absolute/path/to/.snowflake/keys/northstar_key.p8"
role = "NORTHSTAR_DEVELOPER"
warehouse = "NORTHSTAR_WH"
database = "NORTHSTAR_DEV"
chmod 0600 ~/.snowflake/config.toml
snow connection test -c northstar

Finally, run a smoke test to prove the role, warehouse, region, and AI access work together:

-- snowflake/checks/smoke_test.sql
select current_role(), current_warehouse(), current_region();

-- Use a model that is available to your account and region.
select ai_complete('<model>', 'Reply with one word: ready');
snow sql -c northstar -f snowflake/checks/smoke_test.sql

You should see NORTHSTAR_DEVELOPER, NORTHSTAR_WH, an EU region, and a one-word reply. If the AI call fails, the usual causes are the model name, regional availability, or the cross-region setting.

Before moving on

You should now have:

  • a repository with the project structure and docs from Step 1;
  • a project role, an auto-suspending warehouse under a resource monitor, and a database for synthetic data;
  • a deliberate limit on where AI inference may run;
  • a working CLI connection and a passing smoke test, or a note in docs/risks.md on what failed and why.

There are no agents yet, and that’s deliberate.

Follow the build

In this post we’ve set out the architecture, the series agenda, and the project foundation. From here, I’ll take the system from its data foundation through orchestration, specialist workflows, governance, security, evaluation, and operations. I’m really excited to help you understand and build governed AI with Snowflake.

By the end of this series, you should have a practical way to reason about a governed AI system—not just assemble a chatbot, but design the data, controls, workflow, and evidence that make it fit for serious use.