# Data contracts: keeping an AI system's inputs from moving

> An AI system makes quiet assumptions about the tables it reads. Here's how we pin down schema, meaning, freshness and ownership with upstream teams, using dbt model contracts, Snowflake data quality checks and the Open Data Contract Standard.

Data engineering · Field note · October 26, 2026 · 7 minute read · By Nabil Ahmed
Canonical: https://farside.works/insights/data-contracts-for-ai/

![The Soyuz 19 spacecraft in orbit, with its docking port facing the camera, photographed from the Apollo spacecraft](https://farside.works/content/images/2026/10/astp-soyuz-19.jpg)

An AI system is only as steady as the tables it reads. A support agent that looks up an account's entitlement tier, a forecasting feature that reads the order history, a retrieval pipeline that indexes product records: each of them makes quiet assumptions about column names, types, meanings and how recent the data is. When an upstream team changes any of those, nothing in the AI system crashes. It just starts giving slightly different answers, and nobody finds out until someone downstream asks why the numbers moved.

A data contract is how we stop that from happening by accident. It's a written, versioned agreement between the team that produces a dataset and the teams that consume it. This note covers what goes in one and how we enforce it.

## Why AI raises the stakes

A person reading a dashboard usually notices when a number looks wrong. An AI system reads the data on its own, often thousands of times a day, and acts on what it reads.

Gartner put the gap plainly in February 2025. In a survey of 1,203 data management leaders, 63% said their organization either doesn't have, or isn't sure it has, the right data management practices for AI. Gartner predicts that through 2026, organizations will abandon 60% of AI projects that aren't supported by AI-ready data. Its definition of AI-ready is useful: the data must be representative of the use case, including the patterns, errors and outliers the model will meet. Gartner also says AI-ready data is not "one and done," and that once data is feeding a model, teams should test and monitor it and track changes over time.

Bitol, the group behind the Open Data Contract Standard, makes the same point from the other side. In its September 2026 release notes it writes that an LLM pointed at a warehouse "reads column names and infers the rest," and that it "infers confidently; it infers wrong, and nobody finds out until the number slips."

## What a contract has to cover

Most of the trouble we see comes from four kinds of change. A useful contract pins down all four.

- **Schema.** Column names, types and nullability. The easiest part to enforce.
- **Semantics.** What a value means. Is `amount` in US dollars or the account's local currency? Does `is_active` mean "has a current contract" or "logged in this quarter"? A type check passes either way. The AI system's answer doesn't.
- **Freshness.** How old the data can be before it's wrong for the job. An agent that quotes yesterday's entitlement to a customer who upgraded this morning is working as built, on stale inputs.
- **Ownership.** A named team that answers when something breaks, and a channel for telling consumers about planned changes. Without this, the other three are just documentation.

## Inside the warehouse: dbt model contracts and data tests

If the data passes through dbt, the cheapest enforcement point is the model that the AI system reads. dbt has two tools here, and they do different jobs.

**Model contracts fix the shape.** Setting `contract: {enforced: true}` on a model makes dbt run a preflight check before it builds: the query must return exactly the column names and data types declared in YAML, or the model doesn't build. When the contract is enforced, every column has to be declared. dbt also compares against the previous project state and reports breaking changes, such as removing a column, changing a column's data type, or removing or modifying a constraint. dbt recommends contracts for "public" models that other teams, projects or outside systems depend on. An AI feature is exactly that kind of consumer.

```yaml
models:
  - name: account_entitlements
    config:
      contract:
        enforced: true
    columns:
      - name: account_id
        data_type: varchar
        constraints:
          - type: not_null
        data_tests:
          - unique
      - name: entitlement_tier
        data_type: varchar
        data_tests:
          - accepted_values:
              values: ['standard', 'premium', 'enterprise']
      - name: updated_at
        data_type: timestamp_ntz
```

**Data tests check the content.** A dbt data test is a query that selects the rows that break an assertion. If it returns no rows, the test passes. dbt ships four generic tests (`not_null`, `unique`, `accepted_values` and `relationships`), and any assertion you can write as a `select` can become a test. dbt's own documentation explains why tests sit outside the contract: in a software API, the structure of the response is the contract, while quality and uptime matter but are separate.

One Snowflake detail matters here. dbt's constraint table for Snowflake shows that `not_null` is both definable and enforced, but `primary_key`, `unique` and `foreign_key` are definable and not enforced. A model will still build with duplicate keys. On Snowflake, uniqueness has to be a data test, not a constraint.

**Source freshness covers the input side.** dbt can check whether the raw sources are as recent as the agreed service level. Two practical notes from dbt's docs: `dbt build` does not run freshness checks, so they need their own job step; and freshness jobs should run at least twice as often as the tightest SLA they're checking. On Snowflake, dbt calculates source freshness from the `LAST_ALTERED` column, which has known limitations, so we usually configure a loaded-at timestamp column instead.

## On the platform: Snowflake data quality checks

Not every consumer goes through dbt, and not every change happens during a dbt run. Snowflake's data quality monitoring (an Enterprise Edition feature) runs checks on a schedule, inside the account. A check combines a data metric function, which measures something, with an expectation, which says what counts as a pass. Snowflake ships system functions for most of what a contract needs, including `NULL_COUNT`, `FRESHNESS` and `SCHEMA_CHANGE_COUNT`, which counts columns added, dropped, renamed or retyped between evaluations. It can also detect anomalies in volume and freshness from history.

We use these as the second line. dbt stops a bad build. Snowflake checks catch the change that arrived between builds, or the table that a replication job rewrote over the weekend.

![Apollo commander Thomas Stafford, upside down in the docking tunnel, checking a bundle of spacecraft connectors](https://farside.works/content/images/2026/10/astp-stafford-tunnel.jpg)
*Apollo commander Thomas P. Stafford checking spacecraft connectors at the tunnel during the Apollo-Soyuz Test Project, July 1975. Where two spacecraft meet, the connectors have to match on both sides. Photo: NASA (AST-05-302), via the U.S. National Archives, Wikimedia Commons.*

## Between teams: the Open Data Contract Standard

dbt and Snowflake enforce a contract. They don't give the producing team and the consuming team one document to agree on, review and change together. That's what the Open Data Contract Standard (ODCS) is for.

ODCS is maintained by Bitol, a Linux Foundation AI & Data project that announced its graduation from the foundation in July 2026. A contract is a YAML file with sections for fundamentals, schema, data quality, team, roles, support channels, service levels and more. Because it's YAML, it can be versioned and reviewed like code. Its quality section includes a small library of portable metrics such as `nullValues`, `invalidValues`, `duplicateValues` and `rowCount`, and it can also point to SQL checks or tool-specific checks such as dbt tests. Its service-level section covers properties like latency (which the standard prefers to the word freshness), update frequency, retention and time of availability.

Here's a trimmed contract for the entitlement table from the dbt example, written to ODCS v3.2.0:

```yaml
apiVersion: v3.2.0
kind: DataContract
id: 6f1c2a9e-account-entitlements
name: account_entitlements
version: 1.2.0
status: active
domain: customer
description:
  purpose: Current support entitlement per account, read by the case triage agent.
  limitations: One row per account. Does not include trial accounts.
schema:
  - name: account_entitlements
    physicalName: analytics.support.account_entitlements
    properties:
      - name: account_id
        logicalType: string
        primaryKey: true
        required: true
        quality:
          - metric: duplicateValues
            mustBe: 0
      - name: entitlement_tier
        logicalType: string
        required: true
        description: Tier from the active service contract, not the opportunity.
        quality:
          - metric: invalidValues
            arguments:
              validValues: ['standard', 'premium', 'enterprise']
            mustBe: 0
      - name: updated_at
        logicalType: timestamp
        required: true
    context:
      constraints:
        - constraint: Do not infer a tier for accounts missing from this table.
slaProperties:
  - property: latency
    value: 1
    unit: d
    element: account_entitlements.updated_at
team:
  name: CRM data engineering
  members:
    - username: jdoe
      role: Owner
```

The `description` on `entitlement_tier` is where semantics live. It's the line that stops someone from repointing the column at the opportunity record because the types happen to match. The `context` block is new in v3.2.0. Bitol describes it as guidance for agents and tools, including `constraints`, "what an agent must not do", so a rule like the one above travels with the data instead of living in one prompt.

The ODCS file is the agreement. The dbt contract, the dbt tests and the Snowflake checks are how it's enforced. We keep them in the same repository, and a change to one without the others fails review.

## How we roll this out

1. **Start from what the AI system reads, not from the whole warehouse.** List the tables and columns the agent touches. That's usually a handful.
2. **Write the semantics down with the producing team.** A half-hour conversation per table usually turns up at least one column that means something different from what its name suggests.
3. **Agree the freshness the use case needs**, then set checks to run at least twice that often.
4. **Enforce at build time where you can, and monitor where you can't.** dbt contracts and tests on the models, Snowflake checks on the tables.
5. **Treat a breaking change as a new major version.** The producer publishes the new version alongside the old one, and consumers move on a date both sides agreed.
6. **Connect it to the evals.** When a contract changes, the nightly evaluation run is how you find out whether the AI system's answers changed with it.

## Questions to ask about your own inputs

- Can you list every table and column your AI system reads, and who owns each one?
- If an upstream team renamed or retyped one of those columns tomorrow, what would fail, and who would hear about it first?
- Is the meaning of each key field written down somewhere both teams have agreed to?
- Do you know how stale each input can be before the answers are wrong, and is anything checking it?
- On Snowflake, are uniqueness and key rules running as tests, or only declared as constraints that aren't enforced?
- When a contract changes, does anyone rerun the evaluation set?

None of this needs a new platform. A YAML file per input, a few dbt settings and a scheduled check will catch most of what moves under an AI system.

---

**Sources**

- Gartner, ["Lack of AI-Ready Data Puts AI Projects at Risk"](https://www.gartner.com/en/newsroom/press-releases/2025-02-26-lack-of-ai-ready-data-puts-ai-projects-at-risk), February 26, 2025.
- dbt Labs, ["Model contracts"](https://docs.getdbt.com/docs/mesh/govern/model-contracts), dbt Developer Hub.
- dbt Labs, ["Add data tests to your DAG"](https://docs.getdbt.com/docs/build/data-tests), dbt Developer Hub.
- dbt Labs, ["Source freshness"](https://docs.getdbt.com/docs/deploy/source-freshness), dbt Developer Hub.
- Snowflake, ["Introduction to data quality checks"](https://docs.snowflake.com/en/user-guide/data-quality-intro), Snowflake Documentation.
- Snowflake, ["System data metric functions"](https://docs.snowflake.com/en/user-guide/data-quality-system-dmfs), Snowflake Documentation.
- Bitol, ["Open Data Contract Standard (ODCS)"](https://bitol-io.github.io/open-data-contract-standard/latest/), specification (see also the [Data Quality](https://bitol-io.github.io/open-data-contract-standard/latest/data-quality/) and [Service-Level Agreement](https://bitol-io.github.io/open-data-contract-standard/latest/service-level-agreement/) sections).
- Bitol, ["Data Contracts & Data Products for AI"](https://bitol.io/data-contracts-data-products-for-ai/), September 8, 2026.
- Bitol, ["Three Years, 59 RFCs, One Vote: Bitol Graduates"](https://bitol.io/bitol-graduates/), July 28, 2026.
