CI workflow changes
The risk: an AI agent edits a workflow or an action so that a required check passes whatever it tests, or so that CI runs new code once the change reaches your default branch, and the change merges because it looks like routine CI upkeep.
What Arbiter does: every change under .github/, and to any action.yml or action.yaml, needs an approval from
your platform team. While a pull request changes a workflow or action, its check results count only if your security
team approves too. This rule does not read the workflow: it acts on where the change is, not what it says. If you
also turn on the workflow analysis (workflow_analysis in your policy, off unless you add it), Arbiter reads the
changed workflow and action files and holds a change that adds a risky trigger, a widened permission, an unpinned
action or untrusted input in a script.
The rule
Section titled “The rule”- Every change to a listed path needs one approval from your platform team (
acme/platformin the starter policy). The starter lists.github/**,**/action.ymland**/action.yaml, so this covers workflows, local actions, aCODEOWNERSfile under.github/, Dependabot settings and an action defined in any folder. GitHub also reads aCODEOWNERSfile at the root or indocs/, which the starter does not list: add it if you keep it there. A new file, an edited file, a deleted file and a file renamed into or out of a listed path all count, and so do dot-files such as.github/workflows/.hidden.yml. - A change to how checks run needs your security team too (
acme/security, thecheck_definitionsapprovers). These paths are.github/workflows/**,.github/actions/**,**/action.ymland**/action.yaml, always, plus any you add undercheck_definitions.paths. So is an action’s whole folder (the built code and the script an action runs, beside itsaction.yml), and so is what a required check’s workflow calls: a local reusable workflow, a local action, a JavaScript action’smain,preandpostfiles, and a Docker action’sDockerfile. So is what a required check runs: Arbiter reads everyrun:step and follows the scripts it starts (shell, aMakefile, apackage.jsonscript, a command found throughPATH, Python, JavaScript and TypeScript, and Terraform), and the test files a test runner finds by itself (policy-author manual P4). While a pull request changes one of them, none of its required checks count until that team approves, not even a passing trusted scan. The starter requires the secret scan on every pull request, so every workflow or action change needs both approvals. - Some setups make the ordinary required checks count as missing, and no approval clears it (policy-author manual
P4): a link or submodule where checks are defined (replace it with a file); a call to code by a name that can
move, such as a tag or branch (
@v4,@main), an image tag or an expression, which you pin to a full commit (a step that calls an action fromactions/orgithub/is exempt); a pinned workflow or action in another repository that Arbiter can’t read; a check from a service other than GitHub Actions; arun:step Arbiter can’t trace (an unknown variable,eval, a program fed by a pipe such ascurl … | bash, a script in another language, a build, task or container tool such asgo,cargo,gradleordocker, or a shell form outside the fixed set it reads: the manual lists them, with a rewrite for the common ones); and more than 8 calls deep, 400 files or 8 MB. A trusted check is not affected. CODEOWNERSanddependabot.ymlunder.github/need only the platform approval, as they do not change how checks run.- Each 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 (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.
Set it up
Section titled “Set it up”The starter policy (Starter policy and onboarding) already has these rules. Adapt them to your repository.
-
Name your teams: the platform team in each
required_approvals, and the security team incheck_definitions.approvers(policy-author manual, P4). Pick two different teams, so two groups see the change. -
List the files outside
.github/that CI reads and that Arbiter does not follow:- a config file a tool finds on its own, without a step naming it (a scanner’s config file, for example), and any file the manual says Arbiter can miss (P4).
Arbiter already treats an action’s whole folder, what a required check’s workflow calls, and what it runs (the scripts its
run:steps start, and the files they use), as check definitions: a change to one needs thecheck_definitionsapproval without a listing. A link or submodule where checks are defined makes the ordinary required checks count as missing, and no approval clears it. Replace it with a regular file; listing the file it points to does not help. -
Add each one three times, to also ask your platform team to approve a file or folder (a CI scripts folder, for example): to
protected_paths, toevidence_requirementswith the platform approval, and tocheck_definitions.paths. Keep the paths already in that list:protected_paths:- pattern: "ci-scripts/**"label: "CI scripts"risk_class: "standard"evidence_requirements:- path_pattern: "ci-scripts/**"required_approvals: { team: "acme/platform", min_approvals: 1 }check_definitions:paths: ["**/.gitleaks.toml", "**/.gitleaksignore", "ci-scripts/**"]approvers: { team: "acme/security", min_approvals: 1 } -
Pair it with GitHub’s own settings, listed in the starter guide, to limit what a pull request’s workflow run can reach.
setup-checkreports where they stand: the default token, approval for outside contributors’ runs, secrets any workflow can use, and long-lived cloud keys; the last two need the administrator’s own GitHub token (administrator manual, A9c). -
Switch on blocking when you are ready: the starter runs in advisory mode (below).
Patterns ignore letter case, so a change under .Github/ is held like one under .github/, and Action.yml is a check
definition like action.yml.
The workflow analysis (optional)
Section titled “The workflow analysis (optional)”Off unless your policy has a workflow_analysis section (policy-author manual,
P13). A sample policy with it on
is the starter’s policies/acme/ci-workflows.
When a pull request changes a workflow file (directly in .github/workflows/, named .yml or .yaml) or an action
file (action.yml or action.yaml, at any depth), Arbiter reads that file at the pull request’s head and at its
merge base, and names what the change adds. Every kind but privileged_trigger compares the file with its merge-base
version:
privileged_trigger: the workflow runs on a trigger not proven safe. Onlypull_request,push,scheduleandworkflow_dispatchare; every other trigger,pull_request_target,workflow_runandmerge_groupincluded, is privileged. It is raised on any change to such a file, not only when the trigger is new, so even a typo fix in apull_request_targetworkflow is held.permissions_widened: a job, or the workflow’s default, gains awritepermission it didn’t have; a job that is new, or was narrower before, and has nopermissions:block (it then counts as getting every permission the repository allows); or a job that newly passessecrets: inherit.unpinned_action: auses:that is not pinned to a full 40-character commit SHA (a Docker image to itssha256digest). Actions from the owners inpin_exempt_ownersneed no pin; by default those areactionsandgithub.untrusted_input: a${{ }}expression in arun:script, or anactions/github-scriptscript, that reads a value an outsider can set, such asgithub.head_refor a pull request’s title. Only a short list of values, such asgithub.shaandsecrets.<name>, counts as safe.base_moved: the base branch changed the file after the pull request branched off, so the check may not be reading the file you will merge.unparsed: part of the file Arbiter could not read.
Each finding is held until the team the section names approves. A kind listed under deny is denied, and no approval
clears it; listing any kind also denies unparsed and base_moved. The check, its comment and the decision record show
each finding’s kind, file and line, never what the file says.
Tested by automated tests only in this release. Its live end-to-end cases on real repositories come in a later release. Turn it on in advisory mode first, and check its findings on your own pull requests before you switch on blocking.
It reads GitHub within a request budget: a GitHub answer without its rate-limit header denies the pull request
(request_budget), so run one Arbiter server per installation.
When Arbiter can’t read the change, it denies the pull request, and no approval clears it
(CHANGE_ANALYSIS_UNREADABLE): more than 200 changed workflow or action files; a file over 1 MiB, or over 32 MiB
in all; a changed file that is a link or not a regular file; a file with a duplicate key, a YAML tag, more than 100
aliases or nesting past 64 levels; more than 10 seconds of parsing; or GitHub unreadable or out of requests. The
analysis works only on a running Arbiter server, not on the GitHub Action: with the section in the policy, the Action
denies every pull request.
What it does not cover
Section titled “What it does not cover”- A pull request’s own workflow run. GitHub can run a branch’s workflows, as the branch changed them, as soon as
it is pushed, before anyone approves and before Arbiter’s check on its pull request. Arbiter’s check can hold only
the merge; it does not stop or cancel a workflow run. GitHub’s settings limit what that run can reach:
setup-checkreports them (A9c) but does not change them, and a workflow file can still raise its ownpermissions:whatever the repository’s default token allows. - The content of the change, unless you turn on the workflow analysis. Without it, a new
pull_request_targettrigger and a typo fix get the same rule, and your approvers judge the change. With it, Arbiter looks only for the findings above. It does not see: an untrusted value passed throughenv:, written toGITHUB_ENVorGITHUB_OUTPUT, or given to an action’swith:inputs;actions/github-scriptcode that reads the event payload with no${{ }};runs-on,environment:,containerorserviceschanges; what a reusable workflow or action in another repository contains (only its pin); a 40-character pin that names a commit in a fork of the action’s repository; a permission scope GitHub adds later; a new step that reuses an expression already used elsewhere in the same job. - A private repository that sends secrets or write tokens to fork pull-request workflows.
pull_requestcounts as safe because GitHub’s default withholds both from a fork’s run. The workflow analysis doesn’t read that setting, so on a repository that changes it, apull_requestworkflow is not held.setup-checkreports the setting (W2, administrator manual A9c). - A file Arbiter does not follow. Arbiter follows what a required check’s workflow calls and runs, and an action’s
whole folder, by reading the files; it does not run them. A pull request can change a file a check runs without
Arbiter asking for the
check_definitionsapproval in the cases the policy-author manual lists under “What Arbiter can miss” (P4): for example a config file a tool finds on its own without a step naming it, a library that imports a repository file by a string name, or a test runner whose root isn’t its config’s folder. A script that no required check’s workflow runs is not followed at all, and neither is a trusted check’s code (it lives in another repository). Arbiter also refuses a safe check in some cases (the ordinary required checks then count as missing). Closing these is planned for a later release. Until then, make an important check a trusted check, or list the file you know it reads. - Another repository. A reusable workflow or action kept in another repository changes there, not in this pull request. It must be called by a full commit: Arbiter reads it at that commit when its App is installed there, and counts the ordinary required checks as missing when it can’t read it. Keep it under that repository’s own review.
- One person in both teams. An approval from someone in both teams counts for each, so one review can meet both.
- A pull request from a fork. Arbiter cannot count approvals on a fork, so a change to a listed path is not allowed until it is opened from a branch in your repository. The check says GitHub data could not be read.
- Advisory mode. The rule blocks the merge only in enforce mode, with Arbiter’s check required on the branch (administrator manual, A8). In advisory mode, which the starter ships with, the check is neutral (“Would block”) 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.
What the pull request author sees
Section titled “What the pull request author sees”- The check: for a workflow change with no approval,
Arbiter / authorizereads “Blocked: needs approval from acme/platform (+1 more)” (“Would block: …” in advisory mode). With the platform approval alone it reads “Blocked: changes how checks are defined”. - The comment names the protected area, for example
GitHub configuration (workflows, actions, CODEOWNERS, Dependabot)with the changed file, and says what is missing: an approval fromacme/platformthat counts on the latest commit, and, for a workflow or action, that the pull request “changes how checks are defined, so check results cannot count”. Its next steps are to ask members ofacme/platform, then ofacme/security, to approve (1 needed each). - Arbiter checks the pull request again after each push and each review.
- The pull request author guide explains the comment and which approvals count.
What Arbiter reads
Section titled “What Arbiter reads”The path rule adds nothing to what Arbiter reads: it uses the paths the pull request changes, the approvals on GitHub, the
members of the named teams, and the results of the checks your policy requires. When your policy requires an ordinary
check, Arbiter also reads the repository’s file list and, in memory, the workflow, action and script files that check
runs, to work out which paths are check definitions; it keeps none of them and logs only a fixed reason. With the workflow
analysis on, Arbiter reads the changed workflow and action files in memory and keeps only
each finding’s kind, file and line; see What Arbiter receives, keeps and deletes.
setup-check’s reads of the Actions settings are in that page’s “Setup check” row, and the workflow analysis’s
reads are in its “Workflow and dependency files” row.
Built from Arbiter 0.1.3 at commit 05d1dcb.