Skip to content

Repository policy

GroundZero works without configuration. A .groundzero.yml (or .groundzero.yaml) file in the root of a repository lets you tune the risk gate for that repository. If the file is missing, or cannot be parsed, GroundZero uses the defaults below, so a typo never leaves a repository ungated.

.groundzero.yml
version: 1
# Service criticality: 1 (core, customer-facing) to 4 (tooling and internal scripts).
tier: 2
# A score at or above this blocks the merge until someone approves (0 to 100).
block_threshold: 80
# A score below this is approved automatically (0 to 100).
auto_approve_threshold: 30
# Block on any finding of these severities, whatever the score.
block_on_severity:
- critical
# Risk tiers that always need a sign-off before merging.
requires_governance_gate:
- HIGH
- CRITICAL

The same keys can also be nested under a top-level risk_gate: key.

Key Default What it does
version 1 Policy format version.
tier 2 when absent Service criticality from 1 (most critical) to 4. It adds to a change’s blast-radius score (the most for tier 1, nothing for tier 4), and it is the tier a service gets in the tiers condition of agent_authored and bot_authored when the service declares none. It does not block anything by itself. Other values are ignored.
block_threshold 80 Risk score (0 to 100) at or above which the check is action_required.
auto_approve_threshold 30 Risk score below which the check is success.
block_on_severity none Levels that block the merge when any finding matches, whatever the score: the hazard levels critical, high and medium, or a rule’s own severity, error or warning. Each rule’s level is in the table on How the risk score is worked out.
requires_governance_gate HIGH, CRITICAL Risk tiers that need mandatory sign-off. Set it to [] to turn this rule off.
ignore_paths none Files the reliability rules do not scan (globs). See Ignoring files and rules.
ignore_rules none Rules whose findings are dropped. See Ignoring files and rules.

Thresholds are rounded and clamped to the range 0 to 100.

Generated, vendored or legacy code can be left out of the reliability rules, and a rule that does not fit your codebase can be switched off for the repository:

# Files the reliability rules do not scan, matched from the repository root
ignore_paths:
- "vendor/" # everything under vendor/
- "**/*.generated.ts" # a generated file in any directory
- "db/legacy/**"
# Rules whose findings are dropped everywhere (the rule id shown in the check run)
ignore_rules:
- gz-sync-io-in-event-loop
  • Patterns. * matches within one directory level, ** as a whole path segment matches any number of directories, ? matches one character, and a pattern ending in / means everything under that directory. Matching is case-sensitive and against the whole path from the repository root, so use **/ to match at any depth. Anything else is literal: there are no character classes, braces or ! negation (an entry starting with ! is ignored with a warning).
  • What it changes. Only the reliability rules (the code hazard part of the score). The files still count for the blast radius and the change summary. Test and script files are already skipped without any setting.
  • You can see it. The check run and the pull request comment say how many files were not scanned and how many findings were dropped.
  • A pull request cannot ignore its own findings. When a pull request changes .groundzero.yml, an entry applies only if the policy on its base branch lists it too, and none applies when the base branch has no policy file. An entry you add takes effect from the next pull request after it is merged; the check run lists the entries it did not apply. An entry a pull request removes stops applying at once. Pushes and tags use the file at their commit.
  • Not in agent_authored or bot_authored. Those blocks only tighten the gate, so an ignore list inside them is reported as ignored and has no effect.
  • Limits. Up to 100 paths of at most 256 characters and 50 rule ids. An entry that is not a string, or a rule id GroundZero does not know, has no effect and never fails an evaluation.

A repository with several deployable services can say which files belong to which service. GroundZero then reports each change against the services it touches.

services:
- name: checkout-api
paths:
- "services/checkout/**"
- name: web
paths:
- "apps/web/**"
Key What it does
name The service’s name in GroundZero.
paths Files that belong to it. A file may belong to several services; files that match none are reported as shared.

GroundZero checks these in order and uses the first that applies (how the score itself is worked out is on How the risk score is worked out):

  1. A finding matches block_on_severity: the check is action_required.
  2. The change’s risk tier is listed in requires_governance_gate: action_required.
  3. The score is at or above block_threshold: action_required.
  4. The score is below auto_approve_threshold: success.
  5. Otherwise: neutral.
require_independent_approver: true # default: off

With this on, the person who wrote a change cannot authorize it while another member could. An author who tries is refused with a clear message, and the refusal is recorded in the audit log. It does not apply to a change the person did not write, and it never locks out a workspace where nobody else can approve (that approval is recorded as self-approved). Who counts as “another approver” is described in Roles and permissions.

A member who holds the approval override (owners and admins by default) can still approve their own change. That approval is allowed and recorded as an override, in the audit log and in the GitHub check, so the rule binds everyone else and the exception is always visible.

  • A pull request cannot turn it off for itself. GroundZero also reads the policy on the pull request’s base branch, so removing the line in the very change being approved does not release it. Adding the line takes effect on that pull request straight away.
  • It has to be the boolean true. Anything else is read as off, and a warning is logged.
  • It is a guardrail on who may press approve in GroundZero. For a hard control on who can merge, use branch protection and CODEOWNERS.

A stricter gate for changes an AI agent wrote

Section titled “A stricter gate for changes an AI agent wrote”

How GroundZero tells who wrote a change, and what it can and cannot see, is described in Changes written by AI agents.

agent_authored adds review for changes that an AI agent (Claude Code, GitHub Copilot, and the other agents GroundZero recognises) wrote or helped write. It is off unless you add it, and it applies the same four keys as the rest of the policy:

agent_authored:
tiers: [1, 2] # optional: only when the change touches a service of one of these tiers
services: [payments, auth] # optional: only when the change touches one of these services
block_threshold: 60 # block an agent-authored change at this score or above
auto_approve_threshold: 15 # auto-approve one only below this; 0 means a person always reviews it
block_on_severity: [high] # severities that block it, in addition to the repository's
requires_governance_gate: [MEDIUM, HIGH, CRITICAL] # tiers that need sign-off, in addition to the repository's

tiers and services say where the stricter gate applies. Leave them out and it applies to every agent-authored change.

  • tiers (1 is the most critical to 4). The tier of a change is the most critical tier among the services it touches. A service’s tier is its tier in services: when you declare one, otherwise the repository tier, otherwise 2. Files that belong to no service (shared) count as the repository tier.
  • services lists service names; the gate applies when the change touches one of them.
  • With both, a change has to match both.
  • A condition GroundZero cannot read (tiers: [9], an empty list) is ignored with a warning, and the block then applies everywhere. That errs toward more review, never less.

A change outside the condition keeps the repository policy, and the change page in the console says why. The policy dialog in the console (Settings, Repositories) shows these gates next to your file: the repository’s own, and what an agent or a bot change would face. It is read-only; you still change the policy by editing the file.

bot_authored takes the same keys and conditions and applies to changes written by a bot such as Dependabot or Renovate when no agent contributed. A change that an agent and a bot both wrote uses agent_authored only; the two blocks never stack.

bot_authored:
tiers: [1]
auto_approve_threshold: 0 # a bot's change to a Tier 1 service always gets a person
  • It can only tighten. Thresholds take the lower of the two values; severities and tiers are added to the repository’s. A value that would loosen the gate has no effect, so adding the block never lets more through.
  • It changes the verdict, not the score. The risk score is the same for the same diff whoever wrote it; only the check conclusion and the change status differ.
  • Which changes it applies to. A change is agent-authored when at least one commit has an agent signal (a commit trailer such as Co-Authored-By: Claude, an agent account, or a pull request marker). Changes written by people and by bots such as Dependabot use the repository policy unchanged.
  • If authorship cannot be determined (GitHub could not be read) the repository policy applies and the check summary says that the agent policy was not applied. Re-running a check does not lose it: GroundZero reads the pull request again, so the re-run is attributed like the first run.
  • If the marker arrives later. Adding the marker to the pull request description (or removing it) after the pull request was opened re-attributes it: the console row updates, and if that moves the change between human, agent and bot, the change is evaluated again so the check follows the policy that now applies. Edits that touch no marker do nothing.
  • What you see. The GitHub check and the pull request comment show the thresholds that were used, and the console shows the change as gated by the agent policy. The approve and merge entries in the audit log name the agent.