Branch protection is a small number of switches, and each one closes a specific hole. The useful way to design a rule set for agent commits is to start from the holes rather than the switches.
An agent is not a special kind of author as far as the forge is concerned. It is an account, an app installation, or a token with a permission set. GitHub's branch protection rules apply to pushes and merges on matching branches, and by default the restrictions do not apply to people with admin permissions or a role carrying the "bypass branch protections" permission about protected branches. That default is the first failure mode and it has nothing to do with whether the author is a human.
The second failure mode is approval staleness. An agent opens a pull request, a reviewer approves it at a commit that passes tests, then the agent pushes a follow-up commit that weakens an assertion or deletes a test. If the approval is not dismissed on new commits, the merge button stays green. GitHub documents the option to dismiss stale pull request approvals when commits are pushed about protected branches, and it also documents that with that setting, approving reviews are dismissed as stale if the merge base introduces new changes after the review was submitted managing a branch protection rule.
The third failure mode is the direct push. A bot with a bypass goes straight past the pull request and the status checks, which is exactly the scenario people raise when they want automation to bump a version file the bypass status check thread. You may want that for a narrow class of commits. You almost certainly do not want it for an agent that edits application code.
The fourth failure mode is self-review. If the agent's account can approve, or if a single code owner is the only approver and the agent is mapped to that owner team, the review requirement is decorative. Teams hit this in practice, including automated actions that had to use two separate bot accounts so one could approve the other the code owner self review thread. Treat that workaround as a smell: two bots approving each other is not a human review.
| Failure mode | What it looks like | Control that closes it |
|---|---|---|
| Admin or bypass role | A maintainer merges an agent pull request with red checks | Include administrators, or use rulesets and audit the bypass list |
| Stale approval | Approval given at commit A, agent pushes commit B | Dismiss stale approvals when new commits are pushed |
| Direct push | Bot pushes to the protected branch with no pull request | Bypass list limited to a named group, force push and deletion blocked |
| Self review | Agent account or its owner team approves | Require review from someone other than the last pusher, remove bots from approver teams |
| Ambiguous check | Two workflows share a job name, required check passes on the wrong one | Unique job names per workflow, required check points at one workflow |



