Data Contracts: How to Enforce Them and Recover When They Break
Table of Contents
Every data team has a version of the same Slack thread. Someone asks whether anything changed in the orders table. Two people say no. An hour later somebody finds the nullable column that shipped on Tuesday, and the revenue dashboard has been quietly wrong for three days.
Data contracts exist to make that thread unnecessary. They take the informal understanding between the team that produces a dataset and the teams that depend on it, and turn it into something written down, machine-readable, and checked automatically before a change lands.
This article covers what belongs in a data contract and how teams enforce one. It also covers three things most explainers skip: what to do when a violation reaches production anyway, why versioning the contract is not the same as versioning the data, and which standard to adopt now that the field has consolidated on one.
What Are Data Contracts?
A data contract is an agreement between a data producer and the consumers of its data that defines a dataset’s structure, semantics, quality expectations, and service commitments in code rather than in prose. Because the terms are code, a pipeline can evaluate them automatically and reject a change that would violate them before anyone downstream is affected.
The producer owns the contract. It lives in version control next to the code that generates the data, it carries a version number, and it is discoverable by the teams that consume it. That combination is what separates a contract from an internal note about how a table is supposed to behave: someone has committed to the terms, and something enforces them.
Data Contracts vs. Data Quality Checks
A quality check tests data. A contract commits a producer to terms and then tests them.
The difference is who owns the assertion and when it runs. Quality checks usually accumulate downstream, written by the consuming team after something broke, and they fire once the data has already arrived. A contract inverts that: the producer publishes the assertions, versions them alongside the code that produces the data, and evaluates them at a defined point in the lifecycle. The check tells you the data is wrong, the contract is why nobody shipped it in the first place.
What a Data Contract Is Not
Four things get mistaken for contracts. Each is adjacent, and none is a substitute.
Not this | What it does | What it misses |
|---|---|---|
DDL | Defines physical structure: columns, types, what the database will accept | Semantics, freshness, and what happens on failure. A status column holding lifecycle stages and one holding HTTP codes are the same type either way |
Schema Registry | Validates structure in transit | Semantic drift, where a field keeps its type and changes its business meaning |
Data Catalog | Documents what exists and what it means | Enforcement. Documentation does not prevent breakage, it makes breakage easier to describe afterward |
Data Product | A curated collection of assets with ownership and governance | The per-asset guarantee. One data product typically relies on several contracts |
Are Data Contracts Just dbt Tests With More Process?
This deserves a direct answer, because a good share of the people searching ‘data contracts’ arrive skeptical rather than curious. A thread in r/dataengineering puts it in the bluntest available terms: “I’m once again asking: WTF is a Data Contract?” The “once again” means this reader has already looked and come up empty.
The objection is fair. If you already run dbt tests, Great Expectations suites, or validation logic inside your pipeline orchestration, you have most of the raw material.
What is actually different is the status of the assertions, not the assertions themselves. In a contract, the producing team publishes the assertions as a commitment it owns, versioned so a change to the terms is visible and reviewable. It’s discoverable by the teams that depend on them, and enforced at a defined point in the lifecycle rather than checked somewhere downstream after the data has moved. Your dbt tests are a good starting inventory for a first contract. The work is deciding which of those assertions your team is willing to be held to, and putting the enforcement where it can still prevent something.
What Goes Inside a Data Contract
A data contract covers six kinds of terms: schema, semantics, freshness, volume, quality, and governance. It also names who owns the commitment and what happens when an assertion fails. Each type catches a different class of failure, which is why a contract with only a schema section catches only the most visible one.

You do not need all six on day one, and few teams start with all six. Knowing what each is for lets you choose deliberately instead of discovering the gap during an incident.
Schema covers field names, types, nullability, and structure. Most teams already have this in some form, and it catches the failures that announce themselves: a column that disappeared, a type that changed, a nested structure that gained a level.
Semantics covers what a field actually represents, including business logic, units, and the categories a field is allowed to hold. An amount column that switches from gross to net keeps its type, passes validation, and changes every number downstream of it. This is the section that requires a conversation with the producing team rather than an inspection of the table.
Freshness is an operational commitment rather than an aspiration: no more than four hours behind, measured at the consumer’s edge, not at the producer’s job start time. It catches the pipeline that stopped running quietly, which is a surprisingly common way for a dashboard to be wrong.
Volume covers expected row counts and acceptable variance between refreshes, because a partial load looks exactly like a normal load if nobody is counting. A job that delivers sixty percent of yesterday’s rows passes every schema check ever written.
Quality covers null constraints, uniqueness, format rules, and referential expectations. The test for a good quality term is whether a tool can evaluate it and return a pass or fail without a human interpreting the result. “Customer records should be accurate” is not a quality term. “customer_id is unique and non-null, and every value appears in the customer dimension” is.
Governance covers classification, access, retention, and residency. It is the term type most likely to exist as documentation and least likely to be enforced, which is the whole problem: a policy saying personally identifiable information (PII) must not land in the analytics prefix does not prevent it from landing there. Written as a contract term, a pipeline can check it before the data moves.
Ownership and Enforcement Terms
The producing team owning the contract is what makes it work. That is an organizational fact more than a technical one, and it is the part teams most often skip.
The enforcement decision is the one to make deliberately, because it has three real answers and they are not interchangeable. Alert tells someone and lets the data through. Block stops the change and holds up the producer. Quarantine routes failing records aside and lets clean ones proceed. Alert is the cheapest to adopt and the weakest, because it converts a data problem into a notification and leaves the consequences downstream. Block is the strongest and the most political, since the producing team now feels the cost of their own contract. Picking per term rather than per contract is usually the right move: block on schema, quarantine on quality, alert on volume drift.
Taken together, the six types plus enforcement terms are what turn a dataset governed by a data contract into a trustworthy data product: something a consuming team can build on without first re-deriving whether it can be believed. That is the actual output of a well-enforced contract. Not a document, and not a passing test suite, but a dataset with terms attached that someone owns.
The Data Contract Standards Just Consolidated
For the last few years, adopting data contracts meant choosing between two competing formats. That choice is now settled with the release of the Open Data Contract Standard (ODCS) v3.1.0 (Version v3.2.0 is now available). The maintainers of the alternative Data Contract Specification deprecated their own format and pointed users at ODCS, citing a commitment to a single industry standard. So if you are starting now, start with ODCS.
ODCS is governed by Bitol, an incubation-level project under the Linux Foundation’s LF AI & Data. That matters for a boring reason that turns out to be the important one: a format governed by a neutral foundation has no commercial reason to prefer one enforcement product over another. Most vendors writing about data contracts express contracts in their own object model instead, which is convenient for the vendor and creates work for you the day you change tools.

What ODCS Covers
An ODCS contract is a single YAML file: fundamentals such as identifier, name, version and status; the schema and its properties; data quality rules; service level agreement (SLA) terms; servers describing where the data physically lives; and roles for access control, plus optional pricing and custom properties.
The part that changes day-to-day work is the published JSON Schema. Your editor can validate a contract as you write it, and your pipeline can reject a malformed one before it ever runs. That validation is strict, and got stricter in v3.1: unrecognized fields are errors, not silently ignored extras, so a typo in a field name surfaces immediately instead of quietly disabling a check you thought you had.
Here is a minimal contract that validates against the published v3.1 schema. One property, one quality rule, one freshness commitment:
apiVersion: v3.1.0
kind: DataContract
id: 6f1c9e28-3b7a-4d51-9c2e-8a4f0b73d115
name: orders
version: 1.0.0
status: active
domain: sales
dataProduct: order-analytics
tenant: ExampleCo
description:
purpose: One row per completed customer order, for revenue reporting and demand forecasting.
usage: Read from the analytics prefix. Refunds arrive as separate negative-amount rows.
limitations: Test orders are excluded upstream and never appear here.
schema:
- name: orders
logicalType: object
physicalName: orders_v1
physicalType: table
description: Completed orders, partitioned by order date.
properties:
- name: order_id
logicalType: string
physicalType: varchar(36)
required: true
unique: true
primaryKey: true
primaryKeyPosition: 1
description: Unique identifier for the order.
quality:
- name: No duplicate order IDs
type: library
metric: duplicateValues
mustBe: 0
unit: rows
dimension: uniqueness
severity: error
businessImpact: operational
slaDefaultElement: orders.order_id
slaProperties:
- property: latency
value: 4
unit: h
driver: analytics
- property: frequency
value: 1
unit: h
driver: analyticsNote: Two details could trip up teams migrating an existing contract. Quality checks in v3.1 use metric rather than rule, which the schema now marks deprecated. And because unrecognized fields are errors, the v2-era isUnique and isNullable fail validation rather than passing with the check ignored.
What the Deprecation Means If You Already Have Contracts
Nothing breaks today, and the migration is a command rather than a project.
If your contracts are already in ODCS v3.0.x, v3.1 is backward compatible: existing contracts remain valid, and you adopt the new fields when you have a reason to. If your contracts are in the older Data Contract Specification format, the maintainers recommend migrating before the end of 2026 as their commitment to supporting the old format in the Data Contract CLI and in Entropy Data expires at that time. The CLI will do the conversion for you:
datacontract export --format odcs --output odcs.yaml datacontract.yamlMigrate before the deadline gets close rather than at it, because the conversion is the easy part. Re-pointing whatever enforces your contracts, and re-reviewing terms nobody has looked at since they were written, is the part that takes actual planning.
How Teams Enforce Data Contracts

Data contract enforcement happens in one of three places: in the producing system before the data is written, in the pipeline after it’s produced, or at a promotion gate that decides whether consumers ever see it. The patterns differ in one respect that matters more than the others, which is how much has already happened by the time a violation is caught.
Most teams end up running more than one. The useful question is not which pattern to adopt, but which terms belong in which place.
Validation at the Producer
The earliest point of enforcement is the producing system itself, before data is written at all. For event streams, that usually means a schema registry rejecting an incompatible message. For application-produced data, it means contract tests in the producer’s continuous integration (CI) pipeline, failing the build when a change would violate the published contract.
This is the strongest position available, because the violation never becomes data. It is also the most limited. It requires a controlled interface you can put a check in front of, which rules out third-party feeds, vendor exports, and anything produced by a transformation you do not own. And it can only evaluate terms that are knowable before the data exists. Schema compatibility, yes. Row counts, freshness, and whether an amount column changed from gross to net, no.
Validation in the Pipeline
The most common pattern, and the one most teams already have some version of, is validation after the data lands. This is where data quality tools operate: dbt tests, Great Expectations suites, Soda checks, assertions inside orchestration, and observability platforms watching for anomalies.
The advantage is coverage. Because the data exists, every term is evaluable, including the ones the producer-side check could not reach. The catch is the same fact. Because the data exists, it may already be sitting in a table consumers are querying, which means the check is a detector rather than a preventer. And detection defaults to alerting, which is the weakest of the three enforcement responses. An alert that fires into a channel with forty people in it and no named owner is not enforcement; it’s a notification that enforcement did not happen.
This is a solvable problem, and the solution is not a better alert. It is moving the check to a point where failing it can still stop something.
Validation at a Promotion Gate
The third pattern writes the data somewhere consumers cannot see, runs the contract against the actual data, and promotes it only if every term passes. In the wider industry this is known as write-audit-publish, and Apache Iceberg supports a version of it through branches.
It combines what the other two patterns each have half of. It evaluates every term against real data, including volume, freshness, and semantics, and a failure stops the change instead of describing it, because failing the gate means consumers continue reading the last version that passed.
The requirement is an isolation boundary: somewhere the data can exist, be queried and tested at full scale, and still be invisible to consumers until you say otherwise. Some platforms provide that natively and some do not, and teams without one tend to improvise with staging tables and swap logic, which works until the swap is not atomic and someone reads halfway through it.
Pattern | When it runs | What it catches | What has already happened |
|---|---|---|---|
Producer validation | Before the data is written | Schema and compatibility violations, breaking changes at the interface | Nothing. The violation never became data |
Pipeline validation | After the data lands | Every term type, evaluated against real data | The data exists, and consumers may already be reading it |
Promotion gate | After the data lands, before consumers see it | Every term type, evaluated against real data | The data exists, in a location consumers cannot reach |
Read that last column top to bottom and the trade-off is visible. Producer validation is cheapest to run and narrowest in what it can see. Pipeline validation sees everything and arrives late. A promotion gate gets both, and asks you to have somewhere to stage.
None of the three is airtight, which is the part most treatments of this topic leave out. Contracts encode the failures you thought of. The next section is about the ones you did not.
Rolling Back Fast When a Violation Slips Through
Detection is only the first half of a data contract incident. Recovery means putting consumers back on a version of the data that satisfied the contract, and most storage layers keep only the current state. Without a known-good version to return to, a rollback is just a re-run.
Something always gets through. The failures nobody thought of cause the expensive incidents: a semantic change no term covered, a third-party feed that shifted without notice, a term that was written correctly and then quietly stopped being enforced when a pipeline was refactored. Treating full coverage as achievable is how teams end up with excellent detection and no recovery plan.
Ask what actually happens next, and the answer is a sequence rather than an action. Identify the affected window. Locate upstream source data and confirm it is still available. Re-run the pipeline, assuming it is deterministic and the upstream system has not moved on. Then reconcile the derived artifacts: aggregate tables, materialized views, caches, feature stores, exports that already left the building, and any model trained during the window. Each step is tractable. Together they are why data incidents turn into projects.

Three things make the difference between that sequence and an actual rollback. A known-good version that still exists, meaning not a backup of the source but the exact state consumers were reading before the bad change landed. An atomic way to return to it, because partial rollback where three tables have gone back and two have not is often worse than the original problem, producing results that are internally inconsistent and perfectly plausible. And knowledge of which version was good, which sounds obvious and is the one teams discover they cannot answer under pressure.
The usual candidates each cover part of this. Backups restore the source but not the consumer-visible state. Storage-layer snapshots are coarse and rarely aligned to anything meaningful about your data. Time travel in table formats such as Apache Iceberg and Delta Lake gets closest, but it operates per table, and when a pipeline writes eight tables that only make sense together, rolling each back to its own most recent good snapshot does not reconstruct a moment when all eight were consistent.
The business case for closing this gap is more straightforward than the case for detection. Incident cost scales with duration, and duration is dominated by recovery, not by detection. Most teams have invested almost entirely in the first half. Cutting mean time to recovery (MTTR) from a day to a few minutes changes what a data incident is: not an all-hands event that gets discussed in a business review, but a routine operation a single on-call engineer performs before the affected teams have finished reading the alert.
That is an achievable target, and the teams that have it did not get there by writing better contracts. They got there by keeping their data in a form where returning to a previous version is a normal operation rather than a reconstruction project. That form has a prerequisite most teams have not met, and it is not the one they expect.
Contract Versioning Is Not Data Versioning
These are two different things that sound like one. Versioning a contract tracks how the terms changed over time. Versioning data tracks how the dataset itself changed. A team can have rigorous semantic versioning on its contracts and still be unable to answer which version of the terms a given dataset was actually checked against.
Contract versioning borrows wholesale from software. The contract carries a version number, breaking changes bump the major, additive changes bump the minor, and consumers are told which version they are coding against. ODCS supports this through its version field, and teams that have been at it a while usually run two versions in parallel during a migration window.
That solves coordination between people. It does not create any link between a set of terms and the bytes those terms were evaluated against.
Consider what a versioned contract over unversioned data can actually tell you. The contract history says v2.1 was in effect from March through May. The storage layer holds whatever the table contains right now. Neither one records that the March 14 partition passed v2.0 before the migration, or that the April 2 load was written while a pipeline refactor had quietly disabled two of the checks. The contract is a statement of intent with a timestamp. It is not evidence about a dataset.

The gap shows up in three situations, none of them hypothetical. A consumer asks whether a specific dataset met the terms, and the honest answer is that the terms in effect at the time said so, which is an inference from two separate records rather than a fact about the data. A new quality rule ships in v2.2 and nobody can say whether historical data satisfies it, because finding out requires the old data to still exist in the state it was in. Or a violation is discovered late, and scoping the damage means knowing which loads were checked under which terms. Without a per-version record, the safe assumption is everything since the last known-good point, which is usually far more than was actually affected, and the cleanup is scoped to match.
Proving a Contract Was Honored
There is a difference between knowing your contracts are enforced and being able to show it, and the two audiences for that difference are not the same people.
An alert proves something failed. A dashboard proves something is being watched. Neither is evidence about a specific dataset at a specific moment, which is what auditors, regulated workloads, model risk reviews, and increasingly customers themselves are asking for. The question is narrow and factual: this dataset, on this date, under which terms, with what result.
Answering it requires the two records to be bound rather than correlated. When those exist, the answer is a lookup. When they do not, it is a reconstruction from job logs, orchestration history, and whatever the pipeline code looked like at the time, which is the kind of task that gets scoped as a project. Versioned contracts are necessary and they are not sufficient. The evidence lives in the pairing.
How Data Contracts Improve AI and ML Reliability
Contracts do more for machine learning (ML) workloads than for reporting, because a training job does not fail when its input degrades. It completes, produces a model that behaves slightly differently, and reports success. Contracts turn that silent degradation into a check that fires before the data reaches the model.
Training Failures Are Silent, Not Loud
A broken dashboard announces itself. Someone sees a number that cannot be right and says so in a channel within the hour.
A training pipeline has no equivalent. Feed it a categorical field that gained three new values nobody declared, and the encoder maps them to unknown and carries on. Feed it a column that started arriving null forty percent of the time, and imputation fills the gap with a median. The job succeeds, the artifact is written, evaluation metrics move by a point or two, and the run is marked green. Nothing in that sequence looks like an incident.
The cost shows up later as model performance drifts, and the investigation almost always starts in the wrong place. Someone reviews the model code, the hyperparameters, the evaluation split, and the architecture, because those are the things a machine learning engineer controls. The team examines the input data last, which is a reasonable ordering given what the team can see and an expensive one given where the problem usually is.
The terms that earn their place here are aimed at values rather than structure: declared ranges, allowed category enumerations, null rate ceilings, and volume expectations. Schema terms alone catch none of the failures above, because in every one of them the schema held.
Feature Pipelines Multiply the Boundaries
Raw data arriving from a source system is one producer and consumer boundary. A feature pipeline creates several more, because every transformation that produces something another job consumes is a boundary in its own right, whether anyone has treated it as one.
That has a practical consequence for where contracts go. A contract on the raw ingest says nothing about the aggregation four steps later that actually feeds the model. Teams that put contracts only at the edge of the platform find they have covered the least consequential boundary.
Training and serving skew is the sharpest version. When the same feature is computed by two code paths, one for training and one for inference, both need to satisfy the same terms, and a contract is the only artifact that says what “the same” means. Without one, the implementations drift apart in small ways that are individually defensible and collectively responsible for a model that performs worse in production than it did in evaluation.
Reproducibility depends on the same pairing described in the previous section. A model retrained weekly produces fifty-two training sets a year, each governed by whichever contract version was in effect at the time. When the model that shipped in March behaves differently from the one that shipped in June, the difference is in the data far more often than in the code, and demonstrating that requires both versions to be recoverable. For formal model risk review, that stops being a convenience and becomes the requirement.
If you are choosing where to start, the features feeding models currently in production are the highest-value place to put the first contract.
Agent Workflows Remove the Human Check
Every pattern above assumes a person somewhere in the loop, and automation is removing that assumption.
The informal safety net in most data platforms is human recognition. Someone eventually looks at a number and knows it is wrong. That check is unreliable, undocumented, and load-bearing, and it does not survive automation. An agent reading a dataset does not know that revenue is usually within a certain range, and it does not hesitate. It acts on what it reads, writes derived output, and other agents consume that output at machine speed.
Two things change when consumers are automated. Volume, because the number of boundaries grows past what any review process can cover manually. And latency, because the interval between a bad value entering the platform and something irreversible happening downstream shrinks from days to seconds.
Machine readability is what makes contracts the mechanism that scales here. A YAML file with declared terms is something an automated consumer can evaluate before acting, and something an automated producer can be held to. Prose documentation of the same terms is not.
Together, these patterns describe a clear place to start. Put contracts on the datasets that feed models already in production, cover the terms aimed at values rather than structure, and keep the data versioned so a training set can be reproduced. That is a starting scope, not a program, and it addresses the failure mode that costs the most while being the hardest to see.
How to Implement Data Contracts Step by Step

Start with one dataset, not a program. Pick a production asset where failures have real consequences, write a small contract for it, enforce it automatically, and expand from there. Teams that attempt broad coverage first usually produce a large set of contracts that nobody enforces, which is pretty much documentation with extra steps.
Step 1. Select one high-value dataset. Revenue reporting, a compliance-relevant table, or the feature set behind a model in production are all good candidates. Do not start with the dataset that is easiest to contract. Start with the one where enforcement pays for itself the first time it fires.
Step 2. Identify the producer and the consumers. Name the team that owns the dataset. List the teams and systems that read it. This step is administrative and it is the one that most often reveals the actual problem: no clear owner, or consumers the producer did not know existed.
Step 3. Write a minimal contract. A schema definition and one freshness commitment are enough for a first version. Use ODCS rather than a bespoke format. Store the contract in Git, in the repository that holds the code that produces the data. Do not attempt to encode every rule the team can think of. An enforced contract with four terms is more useful than a comprehensive one that nobody is using.
Step 4. Convert existing checks into contract terms. Review the quality checks that already exist for this dataset. Move the assertions the producer is prepared to commit to into the contract, and leave the rest where they are. This is faster than writing terms from scratch and it produces a more realistic contract, because the existing checks encode failures the team has actually experienced.
Step 5. Choose an enforcement response per term. Block, quarantine, or alert, assigned per term rather than per contract. Be conservative in the first iteration. Blocking on schema violations and alerting on everything else is a reasonable starting position, and it can be tightened once the team trusts the checks.
Step 6. Enforce automatically in the pipeline. Wire the contract in so that validation runs without anyone remembering to run it. Place the check at the strongest point available: before the write if the interface allows it, or at a promotion gate if the data must land before it can be evaluated by the consumer. A contract that requires a human to invoke it is not enforced. See data quality framework for the surrounding practices this fits into.
Step 7. Notify the producer, not only the consumer. Route failures to the team that owns the data. This is a technical step with an organizational purpose: it puts the cost of a violation on the team positioned to prevent it.
Step 8. Expand by dependency, not by convenience. Identify the next dataset by intersecting two lists: the assets most depended upon, and the assets that fail most often. Contract the overlap first. Lineage metadata, if the platform provides it, makes this a query rather than a survey.
Step 9. Review the contract on a fixed schedule. Contracts decay when business logic changes and the terms do not. A quarterly review is sufficient for most datasets.
Budget a few days for the first contract, spread across two teams, most of it spent in Step 2 and Step 5 rather than in writing YAML. The second one takes an afternoon. The first contract is where a team learns its own conventions, and the cost curve drops steeply once those conventions exist.
Data Contract Examples

The terms that matter vary by domain. A customer table lives or dies on semantics and governance; an event stream lives or dies on volume and freshness. Below are four dataset types and the terms that carry the weight in each, which is more useful than a generic template.
Customer Data
Semantics and governance lead here. The schema is usually stable, and the failures come from meaning and handling rather than structure: valid enumerations for status and lifecycle fields, format rules for email addresses and phone numbers, classification marking which fields hold PII, retention periods, and residency constraints.
The failure this prevents: a product team adds a new account status, ships it, and six downstream consumers silently bucket it as inactive. No column changed, so nothing structural caught it.
Transaction and Financial Data
Quality and freshness lead, and the tolerance for both is lower than anywhere else in the platform: uniqueness on the transaction identifier, non-null on amount and currency, referential integrity against the account dimension, declared value ranges that catch sign errors and unit mistakes, and a freshness commitment tied to the reporting cycle.
Late-arriving data is the interesting case. A contract that simply declares data must be under two hours old will fire constantly in a domain where corrections legitimately arrive later. The term that works declares completeness as of a stated cutoff and treats revisions as a separate, expected flow. Contracts written without that distinction get switched off.
Event Streams
Volume and schema lead, and enforcement moves earlier in the path than it does for batch data: an event schema with explicit required and optional fields, additive-only evolution rules, expected volume per interval with a floor as well as a ceiling, and a maximum acceptable delay between event time and processing time.
The volume floor is the term teams forget. A stream that stops carrying half its events looks healthy on every dashboard that measures errors, because there are no errors. There is just less. A declared floor turns absence into a failure, which is the only way absence gets noticed.
Machine Learning Feature Data
Values and lineage lead: ranges per feature, null rate ceilings, category enumerations for anything encoded, and a statement of which upstream datasets the feature depends on. The term specific to this domain is a distribution expectation rather than a row-level rule, because a feature can satisfy every range and null constraint on every row and still have shifted enough to degrade the model.
Data Contract Challenges and Best Practices
Most failed contract initiatives fail for organizational reasons, not technical ones. The specification is stable and the tooling is mature. What stalls teams is unclear ownership, terms drafted by the wrong side of the boundary, and enforcement that gets switched off the first time it blocks a release under pressure. Each of those has a known counter.
Issue | What goes wrong | What to do instead |
|---|---|---|
Ownership incentive | The producing team absorbs the cost of writing terms, meeting them, and being blocked. The consuming team gets the benefit. Pilots succeed and nothing spreads. | Make contracts a platform expectation rather than a favor, and route failures to the producer so the team that can prevent recurrence is the team that hears about it. |
Who drafts the terms | A contract written by the consumer and handed over for sign-off is a wish list. It contains terms the producer cannot meet and omits constraints the producer knows are fragile. | Terms originate with the side that can honor them. The consumer negotiates rather than dictates. |
Aspirational terms | Terms nobody believes get ignored, then disabled, and the team learns that contracts are theater. | Start from constraints the producing team would defend anyway, then tighten once the checks have earned trust. |
External sources | Vendor feeds, third-party exports, and systems owned outside the company will not sign anything. | Contract the first internal dataset downstream. The ingest layer becomes the producer and takes on the obligations. |
Enforcement blamed for the outage | A blocking check stops a release, someone is waiting, and the fastest path forward is to switch it off. This is the failure mode that ends initiatives quietly. | Assign a response per term rather than per contract, and make failure cheap to resolve with a rollback path so disabling the check is never the fast option. |
Contract drift | A contract stored in a separate governance system stops matching the pipeline it is supposed to describe. | Keep the contract in the repository that holds the code producing the data, under the same review process. |
Evidence gap | Versioned terms record what was promised. They cannot show that a specific dataset met them. | Version the contract and version the data. Only the pair answers the question an auditor actually asks. |
Coverage sprawl | Broad coverage first produces a large set of contracts that nobody enforces. | Expand by dependency. Contract the intersection of most depended upon and most frequently failing. |
Half of this table is change management rather than engineering, which is the part most teams underestimate. For a fuller treatment of driving adoption across teams, see Joe Pringle’s article and his talk from the AI-Ready Data Summit on driving end user adoption of AI-ready data.
How lakeFS Supports Data Contract Enforcement
lakeFS is the control plane for AI-ready data. For contracts, it provides the enforcement point and the evidence, not the contract language. Built on a highly scalable data version control architecture, lakeFS applies Git-like branching to object storage: teams write data to a zero-copy isolated branch, validate it against contract terms before anyone sees it, and merge only when the checks pass. The contract stays in ODCS, and the validation logic stays in whatever tool the team already runs.
That division is the practical point. Teams do not need to replace dbt tests, Great Expectations suites, or an ODCS validator to get a promotion gate. They need a zero-copy branch where the data can exist while a validator checks it, which object storage does not otherwise provide.
The mechanism is hooks. Declarative YAML action files under the _lakefs_actions/ prefix in the lakeFS repository define actions that run on pre-commit or pre-merge events, and a failing action blocks the merge to the main branch. Consumers reading from main never see data that did not pass. The write-audit-publish pattern described earlier becomes a property of the storage layer rather than something each pipeline reimplements.
Two things follow, and they map onto the two problems this guide has spent the most time on.
Recovery becomes a revert rather than a repair. When a violation does reach the main branch, either because a term was set to alert or because the failure mode was not covered, the previous state is a commit that still exists. Restoring it does not require reconstructing data from backups or replaying pipelines.
Evidence becomes a lookup. Because each load is a commit, lakeFS gives you an immutable, addressable version of the exact dataset the contract ran against. The pairing described earlier stops being an inference from two separate records. Which data, which terms, which result, retrievable months later.
For regulated workloads and model risk review, that changes what the team is agreeing to when it says yes. An audit request stops being unplanned work that displaces a sprint and becomes a query someone runs between meetings. And the platform team can commit to a new regulated workload without first calculating how much of the evidence burden it will absorb.
For machine learning specifically, the same property is what makes a training set reproducible. See data versioning for how commits and branches work over object storage, and AI-ready data management for the broader practice this sits inside. For agent-driven workloads, where the volume and latency problems described earlier are sharpest, securing data access for AI agents covers the access patterns in more depth.
The lakeFS documentation covers hook configuration in full.
Two honest limits. lakeFS does not author contracts, evaluate terms, or replace a data quality tool. And a promotion gate only helps where data can be staged before publication, so streaming paths that must land in place need in-flight validation instead, as covered earlier.
Start with One Dataset
Data contracts work when three things are true at once. The terms are ones the producer already believes. Enforcement runs automatically at a point where failure is cheap. And the data is versioned alongside the contract, so a question about a specific dataset has a factual answer rather than an inferred one.
Most teams have the first and are missing the third. Contracts get written, checks get wired up, and then someone asks whether the March data met the terms in effect at the time, and the answer has to be assembled from job logs. Versioned terms describe intent. Versioned data records what arrived. The pairing is what turns a contract from documentation into evidence.
The starting point is one dataset. Pick a production asset where failure has consequences, write four terms the producing team will defend, enforce them at a promotion gate, and keep the data versioned so the check has something durable to point at.
What the team gets for it is not really fewer incidents, though that happens too. It is that a violation stops being an event. Something fails a check, the merge does not happen, the producing team fixes it, and nobody downstream learns about it because nothing downstream broke. The engineers who currently spend their best hours reconstructing what went wrong last Tuesday spend them building instead, and the on-call rotation stops being the place where good people decide they are done.
None of that arrives with the first contract. It arrives with the twentieth, and the first one is how a team finds out it can get there.
If you want the enforcement gate and the versioned evidence behind it, the lakeFS documentation covers wiring a pre-merge check, or book a demo to see it against your own data.
Frequently Asked Questions
A data contract is a machine-readable agreement between a data producer and its consumers that declares the structure, meaning, quality, and delivery expectations for a dataset. It lives in version control, runs automatically in pipelines, and belongs to the team that produces the data.
A data quality check tests whether data meets a condition. A data contract declares which conditions the producing team commits to, who owns them, and what happens when they fail. Checks are the enforcement mechanism. The contract is the agreement those checks enforce, plus the ownership and response terms around it.
Use the Open Data Contract Standard (ODCS), maintained by the Bitol project under the Linux Foundation. The competing Data Contract Specification was deprecated with the release of ODCS v3.1.0, with support continuing in the Data Contract CLI and Entropy Data through the end of 2026. Existing contracts migrate with a single export command.
No. Most teams convert existing dbt tests into contract terms rather than discarding them. The difference is scope and ownership: a dbt test lives in the transformation layer and belongs to whoever wrote the model, while a contract sits at the producer and consumer boundary and carries a named owner and a defined response.
Ideally at the producer, before data is published. Where that is not possible, run it at a promotion gate: write to an isolated location, validate, and publish only on success. Validation that runs only after consumers can already read the data is monitoring rather than enforcement.
Training jobs do not fail when inputs degrade, they complete and produce a worse model. Contract terms aimed at values rather than structure, such as declared ranges, null rate ceilings, and category enumerations, catch that degradation before training. Versioned data makes the resulting training set reproducible.
Table of Contents