Secrets in a change
The risk: an AI agent commits a credential, such as an API key or a password in a config file, and the change merges because the file it sits in looks harmless.
What Arbiter does: every pull request, whatever it changes, needs a passing secret scan before Arbiter allows it. Arbiter does not scan the files itself: it reads the result of a gitleaks scan that your own workflow runs, and judges it like any required check.
The rule
Section titled “The rule”- Every pull request needs a passing
gitleaksresult, docs and app code included. The starter policy lists it underalways_required_checks. No result, an unfinished scan or a failed scan means the pull request is not allowed. - Only the trusted scan’s result counts. The starter’s entry names a workflow in a separate repository
(
acme/arbiter-trusted), which you protect so that pull requests cannot change it. Arbiter counts a result only when GitHub’s identity token shows it came from that workflow file at the commit your policy pins, for the pull request’s latest commit and current target branch. A check namedgitleaksfrom any other workflow does not count. - It never stands in for anything else. It is one more thing that must pass: a change under
infrastructure/**still needs its platform approval and itsterraform-validatecheck. - A change to how checks run needs a security approval first. While a pull request changes a workflow, an action
definition, or a
.gitleaks.tomlor.gitleaksignorefile, the scan’s result counts only ifacme/securityalso approves. - The scan reads every commit in the pull request and the whole tree at its latest commit. A secret added in one commit and deleted in a later one still fails it. So does an older secret still in the tree, for example one already on your default branch, until it is removed.
- Your repository cannot turn rules off. Every
.gitleaksignore,.gitleaks.tomland.gitattributesfile is set aside before the scan, so it changes nothing, and is then scanned like any other file. Agitleaks:allowcomment has no effect. The rules are gitleaks’ default rules with its own allowlists removed, plus one Arbiter test rule, so files a default gitleaks run skips, such asnode_modules/, are scanned too. - The scan fails on what it cannot read, such as a submodule, a Git LFS pointer, a symlink that points outside the repository, a file over 5 MB, or an archive that is damaged, encrypted, nested more than two deep or in a format the scan does not unpack.
Set it up
Section titled “Set it up”The starter policy (Starter policy and onboarding) already has the gitleaks entry.
-
Create your trusted repository from the trusted workflows and their setup guide, which come with the starter (its
trusted-workflowsfolder). Protect it like the policy repository: whoever can merge to it controls the scan. -
Call the scan from each pilot repository with the small caller workflow the guide gives.
-
Pin it in the policy. Replace
acme/arbiter-trustedand the placeholder commit with yours:always_required_checks:- name: "gitleaks"trusted_workflow: "acme/arbiter-trusted/.github/workflows/secret-scan.yml" # your trusted repositorytrusted_workflow_sha: "<the trusted repository's 40-character commit>"The placeholder (forty zeros) matches no commit, so until you replace it no pull request can be allowed.
-
Let results reach Arbiter: give Arbiter the audience your trusted workflows use, as its
ARBITER_OIDC_AUDIENCEsetting (without it, Arbiter refuses every result), and forwardPOST /api/trusted-check-results/*to Arbiter from any source (administrator manual, A7). -
Switch on blocking when you are ready: the starter runs in advisory mode (below).
False positives. Each exception covers a single exact fake value, for one rule in one repository, and nothing broader: no path, glob or fingerprint. The exception is written into the scan workflow, naming the rule that fires and the whole text it matches. In the trusted form, adding one is a reviewed change to the trusted repository and a new pinned commit in the policy.
No trusted repository yet? The ordinary form runs the same scan from a file in each pilot repository: copy
arbiter-secret-scan.yml from the starter’s ordinary-scan folder to .github/workflows/arbiter-secret-scan.yml, and
point the entry at it (Starter policy and onboarding, “Secret scan without a trusted
repository”). A pull request can edit that file. When one does, the scan’s result counts only with the acme/security
approval. An ordinary result never counts on a pull request from a fork.
What it does not cover
Section titled “What it does not cover”- A secret gitleaks does not recognise. A secret in a form no rule matches, for example one split up or encrypted, can pass. A binary file is scanned through its runs of printable text, so a secret stored in it encoded, for example as UTF-16, can be missed.
- A real credential that happens to be the excepted fake. It passes: the exception matches that exact text wherever it appears in the repository.
- A secret that only ever existed in how a merge commit resolved a conflict, and that a later commit deleted, may not be found.
- A secret already pushed. Arbiter stops the merge, not the push: when the scan fails, the secret is already in a branch on GitHub. Rotate it.
- A pull request from a fork. The trusted scan still runs for a fork, and its result counts. Arbiter cannot count approvals on a fork, so a change that needs one is not allowed. A change that needs no approval, such as a docs change in the starter, can be allowed once the trusted scan passes. An ordinary scan’s result never counts on a fork.
- Advisory mode. A missing or failed scan 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”) 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: when the scan is all that is missing,
Arbiter / authorizereads “Blocked: needs trusted check gitleaks to pass” before a result arrives, or “Blocked: trusted check gitleaks failed” when the scan found something (“Would block: …” in advisory mode). With the ordinary form it reads “needs check gitleaks to pass” or “check gitleaks failed”. - The comment names the check and its workflow, and says it must pass on every pull request, whatever files it
changes. The next step is to let the scan run on the latest commit, re-running it if it did not start, or to fix
what it found and push. If the pull request changes how checks are defined, the comment says so instead and asks
for an approval from
acme/security. - Deleting the secret in a new commit is not enough, because the scan reads every commit in the pull request. Rewrite the branch so that no commit has the secret, or open a new pull request from a clean branch, and rotate the secret.
- Arbiter checks the pull request again as soon as a trusted result arrives, or when the ordinary check finishes.
- The pull request author guide explains the comment and the checks.
What Arbiter reads
Section titled “What Arbiter reads”This rule reads no file from the pull request and no scanner output. (Other rules read more, such as the files an ordinary required check runs; the data rule lists every read.) In the trusted form, the scan’s workflow posts,
for its repository and pull request, only the check name, the head commit and success or failure, with GitHub’s
identity token, and Arbiter reads the workflow run and the pull request from GitHub to confirm them. In the ordinary
form, it reads the check’s runs from GitHub, as for any required check.
What Arbiter receives, keeps and deletes lists what Arbiter keeps from each
trusted result.
Built from Arbiter 0.1.3 at commit 05d1dcb.