← CDO Compass
Foundations

Data Governance as Code: What It Is, How It Works, and When It Makes Sense

Policy documents require human interpretation. Code enforces rules automatically. Here is what that shift means in practice, and where it breaks down.

A question that comes up regularly in conversations with data leaders: how do we govern data fast enough to be useful? Teams have built catalogues, appointed stewards, and defined ownership matrices. And yet governance still feels like a speed bump. Quality issues surface in production. Compliance checks happen after the fact. One serious response is to embed governance directly into the technical processes themselves, rather than layer it on top as a separate activity. That discipline is called Data Governance as Code.

This article explains what it is, how it works, and when it makes sense. The goal is an honest picture, including the conditions under which it is probably not the right investment.

74%
Of data professionals say business stakeholders identify data quality issues before the data team does, "all or most of the time."
Monte Carlo / Wakefield Research, State of Data Quality 2023 [1]
67
Average number of data quality incidents per month in a typical mid-size data environment, up from 59 the year before.
Monte Carlo / Wakefield Research, State of Data Quality 2023 [1]
54%
Of data teams still rely on manual testing or have no initiative in place at all to address data quality in their AI pipelines.
Monte Carlo State of Data Quality Survey 2024 [2]

Part I · The Concept

Where the Idea Comes From

Data Governance as Code borrows its logic from a well-established practice in technology: managing infrastructure and configuration through version-controlled files rather than manual, one-off operations. The same principle applied to governance means expressing policies, quality rules, access controls, and data agreements as files that systems can read and enforce automatically, rather than documents that a person has to read, interpret, and apply each time.

The shift matters because governance documents and checklists rely on consistent human interpretation. When you have many data pipelines, several teams producing and consuming data, and information moving quickly, that consistency breaks down. Different people read the same policy differently. Things get missed. Problems are discovered after they have already affected something downstream.

DGaC does not remove human judgment from governance. It changes where that judgment is applied. A person still writes the rule and decides what it should say. The system then enforces it automatically and consistently, every time, without requiring someone to check each individual case. Humans stay involved in defining policy and handling exceptions, not in routine enforcement.

DAMA-DMBOK and COBIT provide solid foundations for data quality, ownership, and access control. Where they are less specific is on challenges introduced by machine learning systems: tracking which dataset was used to train which model, detecting when training data has gone stale, or creating an audit trail for model inputs. These are not fundamental gaps in the frameworks so much as areas where practical tooling has historically lagged. DGaC is partly a response to that lag.

Part II · How It Works

The Central Mechanism: Data Contracts

The most concrete and immediately useful component of DGaC is the data contract. A data contract is a formal, versioned agreement between the team that produces a dataset and the teams that use it. It specifies what the data looks like, how fresh it must be, what quality standards it must meet, who owns it, and what it can and cannot be used for, in a form that systems can check automatically.

The practical value is straightforward. Without a contract, when a team changes a field in a dataset, downstream teams often find out when their reports break, sometimes days later. With a contract in place, the change is flagged automatically before it is deployed, because the system detects that it would violate the agreement. What was previously a production incident becomes a prevented one.

Anatomy of a Data ContractThe six things a contract specifies — and who cares about each
Data Contract Producer ↔ Consumer machine-readable · versioned Structure Field names, types, required / optional Freshness SLA Updated within last 6 hours Ownership Named team, named accountable person Quality thresholds Completeness, nulls, value ranges Usage terms Who can use it, for what purpose Version history Every change tracked, rollback possible

The Open Data Contract Standard (ODCS / Bitol project) is emerging as the working industry default for this format.

Beyond contracts, DGaC also encompasses automated quality checks that run every time data moves through a pipeline; access and usage policies enforced at the system level rather than through manual approval processes; and automatic lineage tracking that records where data came from and what transformations it passed through. These components can be adopted independently. Most organisations start with contracts and quality checks, and extend from there if the need and the capacity exist.

Where Problems Surface: Without vs. With Data ContractsHow the point of detection shifts when governance moves upstream
WITHOUT CONTRACTS WITH CONTRACTS Data Source Transform Pipeline Data Warehouse Report / Dashboard ⚠ Problem found here days later Data Source Contract Check ✓ Data Warehouse Report / Dashboard Works as expected ⚠ Bad data blocked only valid data passes

When ML Systems Are in Scope

The most acute governance gap today is not in standard reporting pipelines. It is in machine learning. When a model is trained, the governance questions are specific: which data was used, was it classified correctly and properly consented, how old is it, and if the model later produces a wrong output, can you trace the problem back to the data? Without automated lineage and contract enforcement, most organisations cannot answer these questions reliably.

This matters for regulatory reasons as much as operational ones. The EU AI Act requires organisations deploying high-risk AI systems to demonstrate governance of their training data, covering its quality, origin, and sensitivity classification. That is not a philosophical requirement. It means documentation, reproducibility, and audit trails. Organisations that have already embedded data contracts and lineage tracking into their pipelines are well positioned. Those relying on manual records are not.

Software teams have spent two decades building automated checks that catch problems before they reach production. Data and ML teams are now doing the same, and finding that governance is one of the main beneficiaries of that discipline.

Bernard Millet, DataEdgePro.net

Part III · When It Makes Sense

An Honest Assessment

DGaC has genuine benefits. It also has real limitations that are worth stating clearly, because the gap between what the concept promises and what an organisation actually delivers is often where projects stall or fail quietly.

Where it genuinely helps

  • Consistency you cannot get from process aloneOnce a governance rule is encoded, it applies the same way every time, across every team and every pipeline. Manual governance is inconsistent by nature. People are busy, interpretations vary, and exceptions accumulate quietly.
  • Audit trails without the overheadWhen policies are tracked in version control, you automatically have a complete record of what was enforced, when each rule changed, and who approved it. This is directly useful for regulatory reviews and for post-incident investigations.
  • Problems caught earlier and more cheaplyDetecting a data quality issue or a broken agreement at the point of change is far less costly than finding it when a report is wrong or a downstream system has already been affected.
  • Governance capacity freed for harder problemsAutomating routine enforcement means governance teams spend less time on checklist work and more on contested definitions, exception handling, and organisational alignment. That is where human judgment is actually needed.
  • A credible answer to regulatory traceability requirementsFor organisations facing BCBS 239, EU AI Act Article 10, or GDPR data processing obligations, automated lineage and contract enforcement is the most credible technical path to demonstrating compliance continuously, not just at audit time.

Where it is harder than it looks

  • It assumes an engineering foundation many organisations do not yet haveDGaC works well when data teams already deploy changes through structured, automated pipelines. If that foundation is not in place, you are not automating governance. You are building infrastructure while calling it governance. The two are different problems and should not be conflated.
  • Contracts encode your current understanding, including its blind spotsA contract is only as good as the business knowledge behind it. Contested definitions, unclear ownership, and missing domain expertise do not get resolved by writing a contract. They surface in it. That is sometimes useful but requires organisational appetite to work through rather than paper over.
  • The tooling market is still settlingThe standards and tools in this space are evolving quickly. Committing heavily to a specific combination of tools today carries integration risk as the market consolidates over the next two to three years. That is not a reason to wait indefinitely, but it is a reason to avoid over-engineering early.
  • It does not make governance decisions for youDGaC enforces rules that people have already agreed on. It cannot set priorities, resolve conflicts between business domains, or decide what a policy should say. A governance body with business and IT representation still needs to exist, meet regularly, and make those calls. Code is the enforcement mechanism. It is not the decision-making process.
  • The upfront cost is real and the payback horizon is longFormalising data agreements, integrating checks into existing pipelines, and changing how teams think about data ownership takes sustained effort. The benefits accrue over months and years. Organisations without the appetite for that horizon tend to start well and end up with contracts nobody maintains.

Three Things Worth Weighing Before Starting

Data contracts are a business decision as much as a technical one. A contract specifies who owns a dataset, what it must contain, how it can be used, and who is accountable when something goes wrong. Those are not engineering questions. If the CDO office does not own the standard and hold domain owners to it, contracts will be defined inconsistently across teams or simply not maintained after the initial enthusiasm fades.

Starting broad is the most reliable way to fail. A wide mandate to govern everything tends to produce contracts that nobody uses and checks that nobody monitors. The more effective approach is to identify the two or three data products where a quality failure or broken agreement has actually caused visible pain, start there, and let the results make the case for going further. The scope can grow but the foundation needs to work first.

This requires a CDO and engineering partnership, not a handoff. DGaC needs governance expertise to define what rules should exist and engineering capability to build the systems that enforce them. Organisations that hand the project entirely to one side end up with either policies that are well-intentioned but unenforced, or automation that is technically functional but encodes the wrong rules. Both failure modes are common and both are expensive to unpick.

DGaC Readiness: Where Does Your Organisation Sit?Engineering maturity vs. governance pressure — four starting positions
Engineering maturity (pipeline automation) Governance pressure (regulation / scale) Low High Low High Start with foundations Governance is premature. Build pipeline discipline first. Good time to experiment Maturity is there. Start with contracts on one data product. High risk zone Pressure is real but foundation is weak. Invest in both in parallel. ⚠ Do not skip to tooling. Sweet spot for DGaC Strong case to invest. Contracts, quality checks, and lineage tracking will all pay off.

When to Invest: Three Signals

DGaC makes most sense when at least two of these three conditions apply. If fewer than two are present, foundational data management work probably comes first.

Scale
Manual governance is already visibly inconsistent — different teams following the same policy differently, or production incidents caused by ungoverned data changes.
Maturity
Your data teams already deploy changes through structured pipelines with some automated testing in place. DGaC extends what exists; it does not replace missing foundations.
Pressure
You have concrete regulatory obligations — traceability, data quality documentation, access controls — that need to be demonstrable continuously, not just at the point of an audit.

5 Questions to Ask Before Committing

  • Do our data teams already deploy changes through structured, automated pipelines — or would we be building that foundation at the same time as the governance layer?
  • Can we name the two or three data products where a quality failure or broken agreement has actually hurt the business? Those are the right place to start, not a broad programme.
  • Are the data definitions we would put into contracts agreed across the business, or are they still contested between domains?
  • Is there a named engineering owner for the technical layer alongside the governance owner for the policy layer — and do they have a joint mandate from leadership?
  • Does the organisation have the appetite to maintain contracts and checks over a multi-year horizon, or is this likely to be treated as a project with an end date?

Conclusion

Data Governance as Code is not a new idea and it is not a universal answer. It applies a discipline that software engineering has used for decades, encode the rule, enforce it automatically, track every change, to the problem of governing data at scale. For the right organisations, the benefits are real: more consistent enforcement, automatic audit trails, problems caught earlier, and a credible path to meeting traceability obligations that regulators are increasingly serious about.

But the limitations deserve equal weight. It requires an engineering foundation that takes time and investment to build. It surfaces contested definitions rather than resolving them. The tooling market is not yet settled enough to reward heavy early bets. And it does not reduce the need for human governance judgment. It changes where that judgment is applied, but it does not replace it.

This last point is worth stating directly. Data Governance as Code is not a substitute for a governance body. Someone still has to decide which data products matter most, what quality standards are acceptable, how competing priorities between business domains get resolved, and when a policy needs to change. That work requires people, business and IT together, with a mandate and a regular cadence. Code can enforce what they agree on. It cannot do the agreeing for them.

The useful question is not whether DGaC is the right direction in general. For organisations of a certain scale and maturity, it probably is. The useful question is whether your organisation is in the position to do it well, and whether the problems it solves are the ones actually costing you the most right now.

Sources & references

  1. Monte Carlo / Wakefield Research, State of Data Quality Survey 2023. 74% of data professionals report business stakeholders identify issues first; average of 67 incidents per month. montecarlodata.com
  2. Monte Carlo, State of Data Quality Survey 2024. 54% of teams rely on manual testing or have no initiative for AI data quality. montecarlodata.com
  3. Bitol Project, Open Data Contract Standard v1.1. Open-source specification and reference implementations. bitol.io
  4. Gartner, Magic Quadrant for Data and Analytics Governance Platforms 2025. Market assessment of governance platform vendors. gartner.com
  5. European Parliament, EU Artificial Intelligence Act, Article 10: Data and Data Governance. Requirements for training data quality and provenance in high-risk AI systems. eur-lex.europa.eu
  6. Basel Committee on Banking Supervision, BCBS 239: Principles for Effective Risk Data Aggregation and Risk Reporting. bis.org
  7. DAMA International, DAMA-DMBOK: Data Management Body of Knowledge, 2nd edition. Reference framework for data governance and quality management. dama.org