# Branches and protection

> The default branch, protection rules, and who can push where.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://git.docs.sypnia.com/repos/branches-and-protection/

For agents: Protection rules per branch pattern: no force-push, no deletion, changes only through pull requests, N required approvals (dismissed on new commits), required status checks (e.g. sypnia-run/preview, cases/check), linear history, signed commits, who may bypass (nobody by default; never agents). New repositories protect the default branch (main) with: PR required, 1 approval, no force-push.

New repositories protect their default branch (`main`) from the start: changes come through pull requests, one approval, no force-push.

| Rule                           | What it does                                                                |
| ------------------------------ | --------------------------------------------------------------------------- |
| **Pull request required**      | no direct pushes to the branch                                              |
| **Approvals**                  | how many reviewers must approve; new commits dismiss old approvals          |
| **Required checks**            | status checks that must pass, such as `sypnia-run/preview` or `cases/check` |
| **No force-push, no deletion** | history on the branch cannot be rewritten                                   |
| **Linear history**             | only squash or rebase merges                                                |
| **Signed commits**             | every commit verified ([Security](https://git.docs.sypnia.com/security))    |
| **Who may bypass**             | nobody by default; never an agent                                           |

Rules apply to a branch name or a pattern (`release/*`). Agents, Sypnia Agent included, can push to their own branches and open pull requests; merging into a protected branch is a person's decision ([Sypnia Agent](https://agent.docs.sypnia.com/safety/permissions)).
