Sensitive code and infrastructure changes
The risk: an AI agent or a person changes sensitive code, such as infrastructure, authentication or payments, and the change merges before the team that owns it has reviewed it, or before the checks it needs have passed.
What Arbiter does: a change to a path your policy requires approval for is not authorized until a member of the team you name approves it on GitHub and each check you name for that path passes on its latest commit. Arbiter does not read the code: it judges the change by where it is, not by what it says.
The rule
Section titled “The rule”- Every change to a listed path needs what you name for it: a new file, an edited file, a deleted file, and a file renamed into or out of the path.
- An approval from your named team (
acme/platformforinfrastructure/**in the starter policy). The approval counts only if it is the reviewer’s latest decisive review, approves the latest commit, and comes from an active member of that team in your organization whose account is also on the policy’s approver list (policy-author manual, P16), who did not open the pull request, author or commit any of its commits, or create or push to its branch. A review by a bot does not count, and neither does an approval from someone outside the team. Withmin_approvals: 2, two different members must approve. - A passing run of each check you name (in the starter policy,
terraform-validateis a trusted check: it runs from your trusted repository, and only its result from the pinned commit counts). Arbiter uses the newest qualifying run on the latest commit, and onlysuccesspasses: a failed, skipped or cancelled run does not. A check of the same name from another App or another workflow never counts. A GitHub Actions run counts only if it ran for this pull request, so a passing run does not count if another pull request was ever opened from the same branch, if the target branch was changed, or if the run started before the latest push. - A change to how checks run needs a second team. While the pull request also changes a workflow or action
(
.github/workflows/**,.github/actions/**,**/action.yml,**/action.yaml) or a path incheck_definitions.paths, its check results count only if thecheck_definitions.approversteam approves too (acme/securityin the starter policy). - IAM paths are also held. In the starter policy,
infrastructure/iam/**is part ofinfrastructure/**, so a change there needs all of the above and is also held foracme/security(IAM changes in Terraform). - An AI agent’s pull request needs two different approving accounts by default. Arbiter does not detect AI by reading the change. A pull
request is an agent’s when its author, or any commit’s author or committer, is a GitHub App bot (Dependabot, Renovate,
github-actions[bot], your own Apps) or an account the policy lists as an agent. On every path where the policy asks for a team’s approval, such a pull request needs at least 2 different approving accounts from that team, or the number you set (1 to 10; policy-author manual, P15). Arbiter counts GitHub accounts, not people, and only listed accounts can approve. A person’s pull request that holds one bot commit counts as an agent’s. Every other pull request needs the number the rule names. - Co-authors cannot approve. An account GitHub resolves as a commit’s co-author (
Co-authored-by:) is left out of the approvals, like the author and everyone who committed or pushed. - Every pull request also needs the checks the policy requires on all pull requests, such as the starter’s secret scan.
Set it up
Section titled “Set it up”The starter policy (Starter policy and onboarding) protects infrastructure/** with a
platform approval and terraform-validate, a trusted check that runs terraform validate (not a plan) from your trusted
repository; set its placeholder commit before you block. Change it to the paths, teams and checks your repository uses.
-
List every path that holds sensitive code, for example infrastructure, authentication, payments and deployment code. Patterns use
**for any depth and*within one folder. -
Add each one to
protected_pathswithrisk_class: "standard", and add an evidence requirement with the same pattern that names the team and, if you want one, the check:protected_paths:- pattern: "services/payments/**"label: "Payments service"risk_class: "standard"evidence_requirements:- path_pattern: "services/payments/**"required_approvals: { team: "acme/payments-owners", min_approvals: 1 }required_checks:- name: "payments-tests"app_id: 15368 # GitHub Actionsworkflow: ".github/workflows/payments.yml" # runs on pull_request -
Name teams in the organization that owns the repository, as
<org>/<team-slug>. A team in another organization counts no one. Also list each approver underapprover_accounts, with a GitHub account id: an account that is not on the list cannot approve, even as a member of the team (policy-author manual, P16). -
For a GitHub Actions check, give
app_id: 15368and the workflow file under.github/workflows/. The workflow must run onpull_request: a run started by any other event does not count. A requirement with a check must also name a team (policy-author manual, P3). -
Switch on blocking when you are ready: the starter runs in advisory mode (below).
In the starter policy, risk_class: "high" also holds the change for acme/security, so use it only where you want
that hold. Patterns ignore letter case, so Services/Payments/** and services/payments/** protect the same folder; an
exemption (!docs/**) still matches only as written. They also match dot-files and dot-folders.
What it does not cover
Section titled “What it does not cover”- A change outside the paths you list. If sensitive code lives somewhere you did not list, that change is not covered by this rule. Listing every path is what gives you the protection.
- A protected path with no evidence requirement. It needs no approval or check from this rule.
- Who is on the approver list. Arbiter trusts the list in your policy. It counts accounts, not people: a person who controls two listed accounts can approve twice. A change to the list needs 2 approvals from accounts already on it, and the policy repository’s own protection must hold (P16).
- The content of the change. Arbiter does not read the code or the check’s output. A passing check means only
that its run ended in
success, and an approver can miss a dangerous edit. - Files a check runs that Arbiter does not follow. Arbiter follows a required check’s workflow and the scripts it
runs, so a change to one also needs the
check_definitions.approversteam (policy-author manual P4). It reads them and does not run them, so it can miss a file a tool finds on its own, without a step naming it, and the other cases P4 lists. List each such file incheck_definitions.paths, so that a change to it also needs thecheck_definitions.approversteam. - A pull request from a fork. Arbiter cannot count approvals or ordinary checks on a fork, so the pull request is not allowed until the change is opened from a branch in your repository. The check says GitHub data could not be read, and the comment tells the author to open the pull request from a branch in this repository.
- Advisory mode. The rule blocks the merge only in enforce mode, with Arbiter’s check required on the branch. In advisory mode, which the starter ships with, the check is neutral (“Would block”, or “Would hold” for an IAM change) and the pull request can merge. Two exceptions: Arbiter denies every pull request, in every mode, when it cannot confirm that the policy repository is protected, or when the target branch does not require the check with “Require branches to be up to date before merging” on.
- A merge that bypasses the check. Anyone your GitHub rules allow to bypass
Arbiter / authorizecan merge without it. The administrator manual (A9) reports whether anyone can.
What the pull request author sees
Section titled “What the pull request author sees”- The check:
Arbiter / authorizenames the first thing missing, for example “Blocked: needs approval from acme/platform” or “Blocked: needs trusted check terraform-validate to pass” (“Would block: …” in advisory mode), with “(+1 more)” or similar when something else is also missing. - The comment names the protected area the change touched, for example
Infrastructure (Terraform), what is missing, and one step for each, such as “Ask members ofacme/platformto approve (1 needed)” or “Let the trusted scanacme/arbiter-trusted/.github/workflows/terraform-validate.ymlrun on the latest commit”. Arbiter checks the pull request again after each push, each review and each run of a named check. - The pull request author guide explains which approvals count, why the author’s own does not, and how to get a required check to pass.
What Arbiter reads
Section titled “What Arbiter reads”This rule uses the paths the pull request changes, its reviews on GitHub, whether each approver is an active member of the named team and on the policy’s approver list, and the runs of the named check. For a GitHub Actions check it also reads the workflow runs behind them, the other pull requests from the same branch, and changes to the target branch. To find who cannot approve, Arbiter reads who opened the pull request, who authored and committed its commits, and who pushed to its branch. This rule reads no file contents and no check output. (Arbiter also reads the files an ordinary required check runs; the data rule lists every read.) The decision record keeps the approvals Arbiter counted and the check runs it used (What Arbiter receives, keeps and deletes).
Built from Arbiter 0.1.3 at commit 05d1dcb.