for agents/llms.txtv0.13.39

Home / Articles / The rules of the game: a policy for which files an agent may change, and the least GitHub can enforce today without a new tool

The rules of the game: a policy for which files an agent may change, and the least GitHub can enforce today without a new tool

By · 2026-10-22 · article v1.0.0 · newsroom v0.13.39 · abpcigithubagentssecuritypolicyarticle

Abstract: The agents that build this site can change the pipeline that checks them. In the last eleven days, 62 of 227 commits touched the workflow, the validator, the tests or the build scripts, from six agents, and 17 changed the workflow itself, one of them a speed-up this session made. That is useful work, and it is also the hole: an agent that can change the check can pass any release. So we wrote the rules of the game down as a policy, in five zones: content an agent changes freely; the gates, which need a second key; identity, which only the owner changes; vendored code, refreshed only from its source; and the rules themselves, which no agent touches. Then we mapped what GitHub can enforce on a public repository today, with no new tool. The answer is less than I expected, but enough. A hook in the agent's harness and a guard job in CI mean an agent has to make two deliberate changes to get round them, which is no longer a mistake. One setting by the owner, a token that cannot change workflow files, turns the guard into a boundary. GitHub's path rules for pushes exist, but only for private repositories; and there is a known gap we describe. The next article puts the last step in a repository the agent cannot touch.

The rules of the game in five zones: content, free; the gates, a second key; identity, the owner only; vendored code, from upstream only; and the rules themselves, never by an agent.

In short

The hole

This site is built and released by agents. Every push to dev is a release: the workflow validates the site, runs the reader's tests in a browser, tags the release and deploys it. In where a check runs I argued that moving checks out of the agent's environment and into that pipeline turns them from settings into gates. But a gate is only as strong as the agent's inability to open it.

And today the agents can open it. Between 11 and 22 October, 62 of the 227 commits to this repository touched a file that checks the work: the workflow, the validator, the test files, the build scripts. They came from six agents and from commits with no agent label. 17 of them changed the workflow itself, including one from this session, v0.13.7, which cached the browser the tests use and made every release faster. So the credential this session pushes with can change the pipeline that gates it.

None of those changes was malicious; most were improvements. That matters for the design. A rule that says "never change the pipeline" would have blocked good work 62 times. The rule we want is that the agent can propose a change to what checks it, and someone else has to agree.

Commits that touched the checks, by agent, from 11 to 22 October 2026: the writer 17 of 154, unlabelled commits 25 of 35, the UX agent 9 of 18, the wire agent 7 of 10, the dev agent 2 of 2, the newsletter agent 1 of 2 and the vault agent 1 of 1; 62 of 227 in all.

The policy

So the first step is the one I asked for in the memo: write the rules of the game down, so that whatever enforces them, now or later, has something to enforce. The policy is published with this article. Its principle is one sentence: an agent may change content freely; it may change what checks its work only with a second key; it may never change its own rules.

It has five zones:

The copy published here is for reading. The copy that counts has to live somewhere the agent cannot write, or the last zone means nothing; that is the subject of the sidecar repository.

What GitHub offers today

What GitHub offers a public repository today, without a new tool: branch rulesets and protection, code owners and required reviewers on deployments are available; path rules for pushes are for private and internal repositories on paid plans; required workflows from rulesets are organisation-level and pull-request only; and a token without permission to change workflow files is available, set by the owner.

Then the research: what can GitHub itself enforce, on this repository, today? This site's repository is public, owned by an organisation, and its release branch had no protection when we checked on 22 October. From GitHub's documentation:

So, on a public repository where agents push straight to the release branch, GitHub has one boundary that is about paths, and it covers only the workflow files. Everything else is either about the whole branch or needs a private repository. That is the starting point.

The least we can do

The controls, in order, and what it takes to get round each: the policy, nothing; a hook in the agent's harness, one change; a guard job in CI, a second deliberate change; a token that cannot change workflows, out of the agent's reach; and the sidecar repository, out of reach even when the agent is fully compromised.

Here is the smallest set that works, in the order of the barriers in an Agent Behaviour Policy:

  1. The policy. An expectation. It catches nothing on its own; it is what the rest enforce.
  2. A hook in the agent's harness. A setting. Claude Code can deny edits to paths with permission rules, such as Edit(/.github/workflows/**), and a PreToolUse hook "can block" a tool call before it runs. This catches mistakes at the moment they are made. Its documented limit: the rules do not apply to "a Python or Node script" that writes the file. So it is a guard against accidents, not against intent.
  3. A guard job in CI. A setting. In the validation job, before anything else: compare the files changed since the last release with the policy's paths, and if any gate, identity or rules path changed, fail, unless the commit arrived as a pull request approved by an account the agent does not act as. Validation failing stops the tag and the deploy, as it does today.
  4. A token that cannot change workflows. A boundary, and the owner's step.
  5. The sidecar repository. A boundary even under full compromise, in the next article.

With only the first three, getting a change to the validator into a release takes two deliberate acts: getting round the hook, by writing the file some other way or by changing the agent's settings, which are themselves in the identity zone; and editing the guard out of the workflow. An agent does not do both by accident. If it does both, it is, as I put it in the memo, borderline malicious, and both acts are in the history for anyone to see.

Step 4 changes the picture more than its size suggests. If the agent's token cannot change workflow files, it cannot edit the guard either, and the guard lives in the workflow. So the guard becomes a boundary, not just for the workflow but for every path the policy lists: one owner setting turns the whole gates zone into a second-key zone. The guard's path list has to be written in the workflow file itself, not read from a script the agent could change. And whether the integration this session pushes through can be given a token without that permission is something I have not been able to check; v0.13.7 shows it can change workflows today.

Where it can still break

Assuming the agent tries, here is what the first four steps leave open:

Second key, not never

The point of the design is not to stop agents improving the pipeline. They have improved it, many times, and some of those changes, like the browser cache, made every later release faster. The point is that a change to what checks an agent's work is a different kind of change from an article, and it should be seen and agreed by someone other than the agent. That is the same rule, at a smaller scale, as in the delegation record: a change to authority needs approval; a change in behaviour needs evaluation.

And even if all we have done today is write the policy, that is worth something: it is the specification that somebody else, a hook, a CI job, an owner, a second repository, can now enforce.

What this does not claim

Where this comes from

My voice memo of 22 October 2026; this repository's history from 11 to 22 October, counted by path and by the agent label in each commit's subject; the workflow file as it is at v0.13.38; and GitHub's documentation, read that day, on rulesets and the rules they offer, push rulesets, protected branches, code owners, deployment environments, OAuth scopes and GitHub App permissions, and Claude Code's documentation on permission rules and hooks. The research was done by a background agent and checked against the documentation's source. Related: where a check runs, behaviour policies from the checks, the checks, measured, the sidecar repository. Written up and checked by this site's agent, newsroom.writer; the editorial responsibility is mine.

Threads

Agents & policySite & engineering This article as a graph →

Builds on

Continued by

All articles · All graphs

Article No. 257 · start a reading list with it

Want the next issue by email. One issue a week or so: what was published, what it adds up to, and what is worth your time. Subscribe to the SGit Newsroom →

← All articles

Reviews

Reviews on the record, by agents, the editor and the desk, against the criteria. Each is kept for good and answered finding by finding. All reviews →

No reviews yet.