Skip to content

The repo policy

A policy is a JSON file that server/admin.ts set-policy stores and attaches to a repo. The server parses it with the schema in shared/policy.ts before anything reads it, and refuses a file that does not match. The Agents repo’s own policy, ops/policies/agents.json, is a complete example.

A policy may add checks and tighten these. It may not loosen them.

  • maxChangedLines may not exceed 1,200.
  • verdict.code may not be weaker than unit-test-verified, verdict.docs than type-check-only, and verdict.ui than live-ui-verified.

The static gates, the seen-failing check, review, the verdict, the suite and the owner’s merge are not settings, so no policy can drop them.

  • sandbox is box or any. With box, coding agents for the repo run only in a box.
  • maxRunMinutes caps the minutes a run spends working. Waiting on a person does not count.
  • maxSpendUsd caps a run’s spend. It lowers a pipeline’s own cap and never raises it.
  • protectedPaths lists the globs whose changes stop at the owner’s gate. It needs at least one entry.
  • maxChangedLines is the size limit of one change. Lines in lockfiles and plans do not count.
  • lockfiles lists the globs of lockfiles.
  • sourceDirs lists the globs where a new source file needs an entry in the parts document.
  • allowedFiles lists the globs of files that may be in a language other than TypeScript.
  • appendOnly lists files that every change adds to at the same spot. When two changes conflict in one, the runner joins both sides’ lines. It defaults to none.
  • plans lists the globs of plan files, which the size gate skips. It defaults to none.
  • docs names dataModel, the document a migration must change, parts, the document that lists the source files, buildLog, and migrations, the folder of migrations. buildLog is a file every change adds to, or { "folder": "<path>" } for a folder where each change adds a file of its own.
  • checks sets pattern, the glob of check files, related, the files the checks rely on, boxMarker, the line that marks a check a box can run, argv, the command that runs one with {file} for its path, and timeoutSec.
  • box sets overlay, the files the box takes from main, and commands, what the box runs on the change. Each command has a name in lowercase letters, digits and dashes, an argv list, and a timeoutSec. It is never a shell string.
  • suite sets commands, in the same form, which the check host runs on the change merged into main, and evidence, the path in the checkout where agentsctl writes evidence.json.
  • ui is null for a repo with no UI rule. Otherwise it sets paths, the globs of UI files, engines, from chromium, firefox and webkit, widths, from desktop and phone, and kits, files that drive every engine and width and the function a check calls to use them.
  • lint.css sets files, tokens, the stylesheet whose :root defines the design tokens, and neutral, the tokens that are neutral. Every other token counts as an accent.
  • lint.prose sets banned, the banned words, properNouns, the capitalized words a heading may keep, and exempt, the globs the prose gate skips.
  • dependencies.manifests lists the files that declare dependencies.
  • review sets reviewers, how many reviewers on distinct models, rounds, how many rounds before the owner decides, and rubric, the document whose bold rule names a finding must cite.
  • verdict sets the weakest passing verdict for code, docs and ui changes.
  • liveness sets minutes, how long an agent may go without a tool call or a finished turn, and replacements, how many fresh sessions replace it in one stage before a person decides.
  • caps sets repoDailyUsd, outsiderDailyUsd, runsPerHour and concurrent.
  • playbooks lists the playbooks the router may pick, from change, bug, docs and dependency. It needs at least one.
  • principles lists { name, text } pairs that every coding agent on the repo reads with its instructions.
  • verification names skill and features, the verification skill and the feature map a verifier uses, or is null.

A verdict comes from an agent that did not write the change. From strongest to weakest:

  1. live-ui-verified means the verifier drove the changed view and saw it work.
  2. unit-test-verified means the change’s checks ran and passed.
  3. type-check-only means only the typecheck applies.
  4. verifier-blocked means the proof could not run. The runner records it as a failed gate and asks the owner to accept it, send the change back or stop.
  5. verifier-failed means an item of the plan does not hold.

The first three pass. A change’s floor is the policy’s verdict.ui when it touches a UI path, verdict.docs when it changes only Markdown, and verdict.code otherwise.