To stop SOC 2 change-management controls breaking when Claude Code or Cursor write your pull requests, enforce review and testing at the merge boundary for every author, human or agent, and check daily that those rules are still in place. Agents rarely break change management by writing bad code. They break it by adding more changes, identities and repositories than anyone rechecks.
How required reviews and branch protection quietly break
| What breaks | How it happens with agents | What the auditor sees | How to catch it |
|---|---|---|---|
| Required review | Someone lowers approvals to zero to unblock a batch of agent pull requests, and it stays that way | Merges without approval during the period | Daily check of review rules on every production repository |
| New repositories | An agent or engineer creates a repository that ships to production, with no rules applied | A system in scope with no change control | Apply rules at organization level; check new repositories daily |
| Bypass list | A bot, GitHub App or admin team is added to the bypass list so automation can merge | Changes merged around the review | Review the bypass list monthly; alert on changes |
| Self-approval | The agent's identity, or the person who prompted it, approves its own change | No independent review | Require approval of the most recent push by someone else |
| Stale approval | An agent pushes new commits after the human approved | Approved code isn't the merged code | Dismiss stale approvals on new commits |
| Required CI check | A renamed or removed CI job blocks merges, and the required check is dropped to unblock them | Untested changes | Check the required status checks against your policy |
| Out-of-band infrastructure change | An agent with cloud credentials changes IAM or a resource directly, outside a pull request | A production change with no approval record | Alert on cloud API changes not made by your deployment pipeline; run drift detection |
Each of these is a form of coding-agent compliance drift: the control was right at the audit and changed afterwards.
GitHub rulesets and branch protection that hold up with Claude Code and Cursor
For every repository that ships to production, in GitHub rulesets or branch protection:
Pull request required. Require a pull request before merging, with at least one approval.
Last push approved by someone else. Require approval of the most recent reviewable push, so the person who pushed last cannot approve.
Stale approvals dismissed. Dismiss stale approvals when new commits are pushed.
Code owners. Require review from code owners for infrastructure, IAM and CI paths.
Status checks. Require your CI status checks to pass.
No force pushes. Block force pushes and branch deletion.
Short bypass list. Keep the bypass list empty, or limited to named people with a documented reason.
Agent identities and permissions
Own identity. Give agents their own identity, a bot account or GitHub App, with no admin rights and no place on the bypass list.
Central settings. Set agent permissions centrally rather than per laptop. Claude Code supports managed settings for this; check the equivalent for each tool you allow, including Cursor.
No cloud credentials. Keep cloud credentials out of agent sessions where you can, so infrastructure changes go through pull requests.
When agents change Terraform, IAM and GitHub settings during SOC 2 Type 2
If changes land several times a day, a quarterly review won't catch a broken control in time. Three checks cover most of it.
Changes outside the pipeline. Alert on cloud management events, such as IAM policy or security group changes, made by any identity other than your deployment pipeline. AWS CloudTrail with EventBridge, or AWS Config rules, can do this.
Drift between code and cloud. Run a scheduled plan of your infrastructure code in CI. Any difference means someone changed production outside a pull request.
Changes to the rules themselves. Watch the GitHub audit log for changes to rulesets, branch protection and bypass lists, and check the current settings daily against your policy.
The CC8.1 evidence your auditor will sample
The pull request. Its approver and the approval time.
CI results. The test results for the merged commit.
Deployment. Proof that the merged commit is what was deployed.
Rules during the period. Repository rules as they stood during the period, not only today.
Exceptions. For any exception, who approved it and why.
The rules-during-the-period item is the one teams miss. If review was off for two weeks in March, a screenshot taken in June won't cover it. SOC 2 CC8.1 explains the criterion.
Where ZeroTB fits
ZeroTB checks GitHub branch protection rules, required reviews and CI gates daily against the change route your company approved, including new repositories and routes for agent-written contributions. In AWS, it checks deployed settings against your agreed baseline after changes.
Checking every day rather than every quarter is what continuous compliance means in practice.
When a rule fails, the gap gets an owner and ZeroTB prepares the fix as a pull request your engineers review and merge. ZeroTB rechecks before closing, and the signed Verified Control Record keeps the requirement, before and after state, approval and recheck. ZeroTB starts read-only, and AI cannot mark a control healthy or close it independently.
Change control checklist for agent-written code
Rules apply to every production repository, including new ones.
One approval from someone other than the last pusher.
Stale approvals are dismissed on new commits.
Code owners are required for infrastructure, IAM and CI paths.
Required CI checks match your policy.
The bypass list is empty or documented.
Agents use their own identity without admin or bypass rights.
Cloud changes outside the pipeline raise an alert.
Scheduled drift detection runs on infrastructure code.
Rule settings are checked daily, with history kept for the audit period.
FAQ
Does SOC 2 require a human to review code written by an AI agent?
SOC 2 CC8.1 requires changes to be authorized, tested and approved before they reach production. It doesn't name agents. Most auditors expect the same independent review for agent-written changes as for any other change.
Can an agent approve its own pull request?
It shouldn't. Give the agent its own identity, and require approval of the most recent push by someone else.
How do we prove review was on for the whole Type 2 period?
Keep a daily record of the repository rules, not only the pull requests. A gap in the rules is a gap in the evidence.
Start with the Pilot
In the eight-week Pilot, we map up to 25 commitments from your report and take two real gaps through verified restoration.