Sub topic 16
Governance, Lineage and Compliance
Prerequisites: You should understand supervised model training, Git, basic deployment, and the main stages of the machine learning lifecycle. This chapter focuses on how teams control those stages and prove what happened.
What governance controls
Governance is the set of rules, responsibilities, and evidence used to manage an ML system. It answers questions such as:
- Who owns the model and its data?
- Which uses are allowed?
- What risks must be tested before release?
- Who can approve deployment?
- How long must records be kept?
- What happens when the model behaves incorrectly?
Governance applies throughout the lifecycle, not only at deployment. A team might require a documented purpose during problem framing, data-quality checks during preparation, approval before release, and incident records after deployment.
Good governance makes decisions repeatable. It does not mean that every experiment needs a lengthy approval process. Low-risk experiments can use lightweight controls, while high-impact systems need stronger review.
Lineage: connecting evidence across the lifecycle
Lineage records how one artifact was produced from another. An artifact is a stored output such as a dataset, feature table, training run, model, evaluation report, or deployment.
For a model version, useful lineage answers this chain:
- Which source data and data version were used?
- Which validation and feature transformations ran?
- Which code commit and dependencies were installed?
- Which parameters and random seed were used?
- Which evaluation results supported release?
- Where was the model deployed?
- Which production observations and decisions followed?
This chain helps reproduce a result and investigate an incident. For example, if performance falls after deployment, lineage can show whether the input data changed, the feature code was modified, or a different model artifact was released.
A model registry often stores the model version and approval status. It may link to experiment tracking, pipeline runs, dataset versions, and deployment records. These links are more valuable than a model file with an unclear filename.
Compliance and risk controls
Compliance means meeting applicable laws, regulations, contracts, and internal policies. Requirements depend on the system and its context. A recommendation model and a model used in lending may need very different controls.
Common controls include:
| Control | Evidence to retain | Purpose |
|---|---|---|
| Data access control | Permission records and access logs | Limits exposure of sensitive data |
| Data documentation | Source, purpose, consent, and retention details | Shows whether data use is appropriate |
| Evaluation | Metrics by relevant groups and test reports | Finds harmful or uneven behavior |
| Approval workflow | Reviewer, decision, timestamp, and conditions | Proves who authorized release |
| Monitoring | Alerts, incidents, and responses | Shows that the deployed system is supervised |
Collect only the data needed for the documented purpose. Protect sensitive fields, restrict access, and define retention and deletion rules. Compliance evidence must be trustworthy, so logs should be timestamped, access-controlled, and resistant to casual editing.
Applying governance in practice
For each model release, create a small release record containing:
- model and dataset identifiers;
- code commit and environment version;
- evaluation results and known limitations;
- intended use and prohibited use;
- owner, reviewer, approval date, and deployment location;
- rollback and incident-response instructions.
The record should link to immutable or access-controlled artifacts. If a result changes, create a new version instead of silently overwriting the old one. This preserves the history needed for audits and debugging.
Exercise
A production model produces an unexpected decision. Which lineage questions should you answer first?
Show answer
Identify the deployed model version, its data and code versions, the feature pipeline, the release approval, and the recent production inputs and monitoring alerts.