Home / Resources

Keep SOC 2 change controls working when agents write the code

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.

Updated November 25, 2026

How required reviews and branch protection quietly break

What breaksHow it happens with agentsWhat the auditor seesHow to catch it
Required reviewSomeone lowers approvals to zero to unblock a batch of agent pull requests, and it stays that wayMerges without approval during the periodDaily check of review rules on every production repository
New repositoriesAn agent or engineer creates a repository that ships to production, with no rules appliedA system in scope with no change controlApply rules at organization level; check new repositories daily
Bypass listA bot, GitHub App or admin team is added to the bypass list so automation can mergeChanges merged around the reviewReview the bypass list monthly; alert on changes
Self-approvalThe agent's identity, or the person who prompted it, approves its own changeNo independent reviewRequire approval of the most recent push by someone else
Stale approvalAn agent pushes new commits after the human approvedApproved code isn't the merged codeDismiss stale approvals on new commits
Required CI checkA renamed or removed CI job blocks merges, and the required check is dropped to unblock themUntested changesCheck the required status checks against your policy
Out-of-band infrastructure changeAn agent with cloud credentials changes IAM or a resource directly, outside a pull requestA production change with no approval recordAlert 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

Every production repository

Rules apply to every production repository, including new ones.

Independent approval

One approval from someone other than the last pusher.

Stale approvals

Stale approvals are dismissed on new commits.

Code owners

Code owners are required for infrastructure, IAM and CI paths.

Required checks

Required CI checks match your policy.

Bypass list

The bypass list is empty or documented.

Agent identity

Agents use their own identity without admin or bypass rights.

Out-of-pipeline changes

Cloud changes outside the pipeline raise an alert.

Drift detection

Scheduled drift detection runs on infrastructure code.

Rule history

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.