Skip to content

Nori Use cases

How to enforce data governance checks on every new table and dbt model

On each pull request, an agent checks new models for an owner, a classification tag, a retention policy, and masking on PII columns. If anything is missing, it comments the exact YAML fix or pushes it to the branch.

Quick answer

Write your governance rules once in the repository. A webhook from GitHub starts a Nori agent on every pull request that adds or changes a dbt model. The agent checks each new model for an owner, a classification, a retention policy and masking on PII columns. When something is missing, it comments the exact YAML to add, or pushes the fix to the branch for the author to review. The pull request stays blocked until the check passes.

What every new model must declare

Governance usually breaks at creation time. A new model ships on a Friday with no owner and an email column nobody tagged, and the catalog learns about it months later. Checking at pull request time fixes that, because the author is still there and the change is still small.

The rules sit next to the models, where reviewers and agents read the same file:

# governance/model_rules.yml
applies_to: ["models/**/*.sql", "snapshots/**/*.sql"]
required_meta:
  owner: "github handle or team, must exist in CODEOWNERS"
  classification: [public, internal, confidential, restricted]
  retention_days: "integer, at most 2555"
pii:
  detect: [column_name, sample_values]
  column_tags: [pii_direct, pii_sensitive, pii_indirect]
  require_masking: true          # a masking policy or masked view
  restricted_if_any_pii_sensitive: true
mode:
  default: comment               # comment | push
  push_allowed_paths: ["models/staging/**"]

The four checks are deliberately boring: owner present and real, classification from an allowed list, retention set and within limits, and every PII column tagged with a masking rule. Boring rules are easy for an agent to apply the same way on every pull request. dbt stores all of it in meta config, which most catalogs already read. See the dbt documentation on meta.

How to add governance checks to pull requests, step by step

  1. Commit the rules file. Put governance/model_rules.yml in the dbt repository with your data governance lead as a required reviewer in CODEOWNERS.
  2. Give the agent scoped access. Connect GitHub through the Nori GitHub app. For PII detection on sample values, add a read-only warehouse role that can read the development schema, scoped to this agent only.
  3. Create a webhook automation. Point a GitHub pull_request webhook at a Nori automation and filter to pull requests that touch models/ or snapshots/. Each event starts a fresh session.
  4. Write the prompt once. Check every new or changed model in this PR against governance/model_rules.yml. Post one comment with a pass/fail table and the exact YAML for each fix. Push fixes only under push_allowed_paths. Set a failing check status if anything is missing.
  5. Make the check required. In branch protection, add the agent's status check, so a model with missing governance stays blocked until it passes.
  6. Teach the edge cases. When the governance lead decides something, such as event_id is not PII even when it contains a hash, save it as a shared memory. Every later run applies it.

Worked example: the comment on a pull request

An analytics engineer opens a pull request adding models/marts/fct_support_contacts.sql. Ninety seconds later the agent comments:

Governance check: 1 model, 3 of 4 checks failed

fct_support_contacts
  owner            FAIL  missing
  classification   FAIL  missing
  retention_days   PASS  730
  pii masking      FAIL  2 untagged PII columns

Evidence
  customer_email   name match; 100% of 200 sampled values are emails
  caller_phone     98% of sampled values are E.164 phone numbers

Add this to models/marts/_fct_support_contacts.yml:

models:
  - name: fct_support_contacts
    meta:
      owner: "@support-analytics"     # from CODEOWNERS for models/marts/support/
      classification: confidential
      retention_days: 730
    columns:
      - name: customer_email
        meta: {pii: pii_direct, masking: sha256_salted}
      - name: caller_phone
        meta: {pii: pii_direct, masking: sha256_salted}

Reply "@nori push it" to have me commit this to the branch.

The suggested owner comes from CODEOWNERS, and the classification follows the rules file: any pii_direct column makes the model at least confidential. The author replies @nori push it, the agent commits the YAML, the check reruns, and the status turns green.

How the agent handles each failed check (illustrative).
CheckFix the agent proposesWhere the value comes from
Ownermeta.ownerCODEOWNERS for the model's folder
Classificationmeta.classificationHighest class implied by the column tags
Retentionmeta.retention_daysFolder default in the rules file
PII maskingColumn meta tags plus a masking policyColumn names and sampled values

Comment mode or push mode

Start in comment mode everywhere. The author sees the exact YAML and learns the rules. After a few weeks, turn on push mode for low-risk folders such as models/staging/, where the fix is almost always the folder default.

Keep marts and anything restricted in comment mode. A wrong classification on a finance mart is a decision a person should make, and a comment keeps that person in the loop. In both modes the agent never merges. The author and reviewers still approve.

Why the whole team gets this for free

The check runs on Nori, so it behaves the same for every engineer and every pull request:

  • Webhooks and schedules. The pull request webhook catches new models. A weekly automation can sweep the whole project for models created before the rules existed and open one cleanup pull request per folder.
  • Slack for questions. When the agent is unsure about a column, it asks in your data governance channel and links the pull request.
  • Skillsets and memories. The rules file and a dbt-governance skill live in your org skillset. Decisions become shared memories. Every harness reads them: Claude Code, Codex, Gemini CLI or Jiro, Nori's own agent.
  • Your subscription. Runs use your Claude or ChatGPT subscription or API keys. Nori never charges for tokens.
  • Your network. Enterprise deploys the full stack in your AWS VPC or Azure VNet, so sampled values never leave your cloud.

This check keeps new models compliant. To take existing tables all the way to certified, follow the governance pipeline worked example. To catch bad data after merge, add nightly data health checks.

Frequently asked questions

Does this work with dbt Cloud and dbt Core?

Yes. The check reads the model files and YAML in your repository and, for PII detection, samples a development schema. It works the same whether you run dbt Core in CI or dbt Cloud jobs.

Can the agent push to our branches?

Only where you allow it. Push mode is limited to the paths listed in the rules file, and the agent never merges. In comment mode it only posts the YAML for the author to apply.

How does it detect PII columns?

It combines the column name, the data type and a small sample of values from a development schema, and shows the evidence in its comment. Uncertain columns are raised as questions instead of being tagged silently.

What if a model is a false positive?

The author or governance lead replies in the pull request. The agent records the decision as a shared memory so the same column pattern is handled correctly on later pull requests.

Does it slow down pull requests?

A typical run finishes in a minute or two and starts as soon as the pull request opens. Pull requests that do not touch models do not start a session at all.

What does it cost?

Nori starts with a 30-day free trial with no card. Developer is $99 a month for one person and Team is $250 a month with unlimited members. Model usage runs on your own subscription or keys.

Sources

Read on November 23, 2026.