Sub topic 5
Approval Workflows and Separation of Duties
This chapter covers how to design an approval workflow for model releases and how to enforce separation of duties in code. It assumes you can read basic Python and know what CI/CD pipelines and a model registry do. It builds on the audit event design from the previous chapters, because every approval is itself an event you must record.
Why approvals matter for ML
In ordinary software, a pull request review checks the code. An ML release has more to check: the training data, the evaluation results, the intended use, and the risks of putting the model in front of real people. A code reviewer often cannot judge all of these.
An approval workflow makes these checks explicit. It answers three questions for every release:
- Who asked for this model version to move forward?
- Who reviewed it, and in what role?
- What did each reviewer decide, and when?
The EU AI Act expects documented human oversight and a quality management system for high-risk systems. A recorded approval is evidence for both. Later chapters map this evidence to specific obligations.
Core concepts
An approval is a recorded decision by a named person, in a named role, about a specific model version. A role describes the responsibility the person holds, such as model owner or risk reviewer. A gate is an automated check that blocks a release until the required approvals exist.
Separation of duties means that no single person can both request a change and approve it. The goal is to prevent one person's mistake, or one person's bad intent, from reaching production unchecked.
Two related ideas are worth keeping apart:
| Idea | What it means | Example |
|---|---|---|
| Separation of duties | Different people perform conflicting steps | The requester cannot approve their own release |
| Role coverage | Every required kind of review happens | Both the model owner and the risk reviewer sign off |
| Least privilege | People hold only the permissions their job needs | Data scientists cannot edit approval records |
A workflow needs all three. Role coverage without separation of duties lets one person with two roles approve alone. Separation without role coverage lets two colleagues of the same role approve and skip a required perspective.
A typical workflow
The order matters. Automated checks run first, because humans should not spend time on a model that fails its evaluation thresholds. The gate runs last and re-checks everything, so a stale or edited approval cannot slip through.
Implementing a promotion gate
The following function allows promotion only when every required role has approved and no approval came from the requester.
REQUIRED_ROLES = {"model_owner", "risk_reviewer"}
def can_promote(approvals: list, requested_by: str) -> bool:
"""Allow promotion only if every required role has approved
and no approval came from the person who requested the release."""
approved_roles = {
a["role"]
for a in approvals
if a["decision"] == "approved" and a["approver"] != requested_by
}
return REQUIRED_ROLES <= approved_roles
approvals = [
{"approver": "alice", "role": "model_owner", "decision": "approved"},
{"approver": "bob", "role": "risk_reviewer", "decision": "approved"},
]
print(can_promote(approvals, requested_by="carol")) # True
print(can_promote(approvals, requested_by="alice")) # FalseIn the second call, Alice requested the release, so her approval is discarded. Only the risk reviewer role remains covered, and the gate returns False.
The code uses set logic. REQUIRED_ROLES <= approved_roles is true when every required role appears among the valid approvals. Filtering out the requester's own approvals before building the set is what enforces separation of duties.
What this simple gate does not check
The function is a starting point. In production you also need to handle these cases:
- One person, two roles. If Bob holds both
model_ownerandrisk_reviewer, he could submit two approvals. Require that the approvers for different roles are different people. - Rejections. A single
rejecteddecision from a required role should usually block the release, even if another person from that role approved. - Stale approvals. An approval applies to one model version and one set of artifacts. If the model is retrained or the evaluation report changes, earlier approvals must not carry over.
- Expiry. Approvals given months ago may no longer reflect current risk. Many teams set a time limit.
- Identity. The
approverfield is only a string here. A real system takes it from the authentication layer, never from user input.
A stricter version handles the first two:
REQUIRED_ROLES = {"model_owner", "risk_reviewer"}
def can_promote_strict(approvals: list, requested_by: str) -> bool:
if any(a["decision"] == "rejected" for a in approvals):
return False
valid = [
a for a in approvals
if a["decision"] == "approved" and a["approver"] != requested_by
]
approvers_by_role = {}
for a in valid:
approvers_by_role.setdefault(a["role"], set()).add(a["approver"])
if not REQUIRED_ROLES <= approvers_by_role.keys():
return False
# Each required role must be covered by a distinct person.
people = set()
for role in REQUIRED_ROLES:
# Pick any approver for this role who is not already used.
free = approvers_by_role[role] - people
if not free:
return False
people.add(sorted(free)[0])
return True
dual_hat = [
{"approver": "bob", "role": "model_owner", "decision": "approved"},
{"approver": "bob", "role": "risk_reviewer", "decision": "approved"},
]
print(can_promote_strict(dual_hat, requested_by="carol")) # FalseThe greedy choice of one free person per role works for two roles but is not a general solution. With more roles, a matching algorithm is the correct tool, so treat this code as an illustration of the rule and not a finished implementation.
Recording approvals as evidence
An approval that exists only in a chat message is not evidence. Store each decision as an audit event with the same structure you designed earlier: actor, action, model, version, details, and timestamp. Put the approval into the hash-chained log so that nobody can quietly edit or remove it.
The release record gathers everything a reviewer needs to see in one place, together with the approvals:
release_record:
model: credit-scoring
version: 2.4.0
training_data_ref: dataset-snapshot-2026-03-01
code_commit: "<git-sha>"
evaluation_report: reports/eval-2.4.0.json
intended_purpose: "Assist loan officers in assessing creditworthiness"
risk_tier: high-risk
human_oversight: "Loan officer reviews every score before a decision"
approvals:
- role: model_owner
approver: alice
decision: approved
- role: risk_reviewer
approver: bob
decision: approvedReviewers approve this record, so the approval is tied to a precise data snapshot, code commit, and evaluation report. If any of these change, the record changes, and the old approvals no longer match.
Common errors
- Approving in the same tool the requester controls. If the requester can edit the approval table, separation of duties exists only on paper. Make approval records append-only and writable only through the gate service.
- Rubber-stamp reviews. Approvals that take seconds suggest reviewers do not look at the evidence. Show the evaluation report and lineage in the review screen, and log how long reviewers spent.
- Emergency bypasses without a trail. Teams need a fast path for urgent fixes. Allow it, but record who used it, require a later retrospective approval, and alert on its use.
- Role definitions that drift. If the
risk_reviewerrole is given to half the company, it stops meaning anything. Review role membership on a schedule. - Gates enforced only in the UI. Enforce the check in the registry or deployment pipeline, so that calling an API directly cannot skip it.
Exercises
Exercise
A release is requested by Carol. Alice approves as modelowner and Bob approves as riskreviewer. Later, Carol also approves as risk_reviewer using a second account she controls under the name "dave". Which weakness does this expose, and which control addresses it?
Show answer
It exposes an identity weakness: the gate trusts the approver name, so one person can appear as two. The control is to take the approver identity from the authentication system, tie each account to one verified person, and compare approvers against the requester by verified identity and not by display name. Logging approvals in a tamper-evident audit trail also lets reviewers detect the pattern afterwards.
Exercise
Using canpromote, what is returned when approvals contain one approval from alice (modelowner) and one from bob (risk_reviewer), but bob is also the requester? Explain why.
Show answer
It returns False. Bob's approval is filtered out because approver equals requestedby, so only modelowner remains in approvedroles. REQUIREDROLES is not a subset of that set, so the gate blocks the release.