CMP-36Recommended
Prove every production change was reviewed
For every production deploy, keep a link to the commit, the pull request, an approval by someone other than the author, and the passing checks.
How to do it
Protect the main branch as the main branch rule describes. Let the deploy job record the commit and pipeline ID. Once a quarter, a script lists every deploy and fetches its pull request and reviews from the code host API. Emergency changes without review get a review within one working day, recorded the same way. SOC 2 criterion CC8.1 and ISO/IEC 27001:2022 control A.8.32 cover change management.
Examples
JavaScript example
export const isIndependentlyApproved = (pullRequest, reviews) =>
reviews.some(review => review.state === 'APPROVED' && review.user.login !== pullRequest.user.login);
Python example
def is_independently_approved(pull_request: dict, reviews: list[dict]) -> bool:
return any(review["state"] == "APPROVED" and review["user"]["login"] != pull_request["user"]["login"]
for review in reviews)
How to check
The quarterly script fails on any deploy without a merged pull request or a passing check run. It also fails without approval from someone other than the author.
Sources
Related rules
- AID-51 Keep a person's sign-off before release in AI-assisted development
- DAT-25 Fix production data with reviewed scripts in Data and databases
- INF-3 Review the plan and apply only from CI in Infrastructure and environments
- ENG-15 Protect the main branch in Engineering
- IOT-30 Keep a signed remote switch for each risky feature in Connected devices
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/compliance/controls-and-evidence/change-evidence">Agent Wranglers compliance and governance playbook</a>. In code you write, add a comment next to it with the same link.