docs(adr): state held-by on every layer and tighten the register

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-11-21 22:10:14 +00:00
1 parent e36872c255
commit 3ddbc751b5
2 files changed
+45 -57

No files matched your search

+23 -27
View File
@@ -5,19 +5,18 @@ Status: accepted
## Context
This repository publishes Ansible roles that change the hosts they run on, built and tested by
CI that holds secrets. Contributors, many working with AI agents, push to it. The guardrails
defend first against mistakes and over-eager agents; against malice they take cheap measures
and write down what they leave undefended.
CI that holds secrets. Contributors, many working with AI agents, push to it. Its rules and
controls defend first against mistakes and over-eager agents; against malice they take cheap
measures and write down what they leave undefended.
## Decision
**Actors and how far each is defended.** Held by is control (a named check), review (a person
other than the one acting sees the change first) or aspirational (checked by nothing).
**Actors and how far each is defended.**
| Actor | Defence |
|---|---|
| A contributor with write access who makes a mistake | Controls |
| A contributor's agent that overreaches (turns a check green, weakens a gate, adds a secret reference) | Controls |
| A contributor's agent that overreaches (turns a check green, weakens a control, adds a secret reference) | Controls |
| An outsider's fork or AGit pull request | A human closes it without approving its runs and points to issues; never approved or merged |
| Instructions injected through issue, pull request or repository text an agent reads | Cheap measures; the rest is accepted |
| A malicious contributor, or a stolen contributor token | Cheap measures; the rest is accepted |
@@ -35,29 +34,28 @@ repository is access to every secret this repository's workflows can reach. Leas
limits a token's API scope and merge rights, not that reach: every write-capable token
(humans, the agent account, Renovate, the release bot) can push a branch whose workflow reads
them, before any review. Secrets live at repository level once a second repository joins the
organisation. When a writer is removed, or any write-capable token leaks, the maintainer
rotates every repository secret ([rotation list](../contributing/maintaining.md)).
organisation (aspirational). When a writer is removed, or any write-capable token leaks, the
maintainer rotates every repository secret ([rotation list](../contributing/maintaining.md)).
**Least-privilege targets.** Each bot or agent token does only its own job, and none owns the
organisation. Each agent account has exactly one accountable person, named in its profile,
and sits in a team with Actions read, so it cannot approve fork runs. The push allowlist
applies to `release/*` only.
**Least-privilege targets** (aspirational: settings no check reads). Each bot or agent token
does only its own job, and none owns the organisation. Each agent account has exactly one
accountable person, named in its profile, and sits in a team with Actions read, so it cannot
approve fork runs. The push allowlist applies to `release/*` only.
**Layers against a pull request that removes its own gate.**
**Layers against a pull request that removes its own control.** Held by is control (naming
the check), review (a person other than the one acting sees the change first) or aspirational.
- Code owners: gate files, `docs/adr/`, every `AGENTS.md` and `.claude/` need the
maintainer's approval (`CODEOWNERS`); held by control once branch protection requires it.
- Secrets: each secret is referenced by exactly one workflow; held by code-owner review
([rule](../../.gitea/workflows/AGENTS.md)).
- Judge scripts: a script that decides whether a pull request's own diff is allowed runs from
`main`'s copy, called from a workflow only the maintainer can change; a script that checks
content or the built artefact runs from the pull request's copy, and code-owner review
covers edits to it.
`main`'s copy, called from a workflow only the maintainer can change (CODEOWNERS); a script
that checks content or the built artifact runs from the pull request's copy. Both held by
code-owner review.
- Agent instructions: committed skills and agents (`.claude/`) are owned like `AGENTS.md`,
because a skill can grant itself tools, run shell commands and register hooks without a
trust prompt.
- Local runs: review the hook, script and agent-file changes of a branch you did not write
before running it; held by review ([rule](../contributing/reviewing.md)).
trust prompt; held by code-owner review.
- Local runs: review the hook and script changes of a branch you did not write before running
it; held by review ([rule](../contributing/reviewing.md)).
**Every accepted risk is written down** with why it is accepted, its trigger and its planned
reduction, in the [Accepted risks](../../SECURITY.md#accepted-risks) register. Later
@@ -66,13 +64,11 @@ decisions add entries there, not here.
## Reason
Branch protection controls what merges, never what runs: anyone who can push a branch runs
their own workflow with the secrets. So trust is drawn at write access, and the controls
aim at the likelier failure, a well-meant change that weakens a gate.
their own workflow with the secrets. So trust is drawn at write access, and the controls aim
at the likelier failure, a well-meant change that weakens a control.
## Not done
- **Signed commits:** a signature proves which key signed, not who wrote the change.
- **CLA or DCO:** GPL-3.0-or-later and REUSE already settle licensing, and only trusted
contributors' changes merge.
- **Signing release artifacts:** the tag message's checksum covers what review can; the
remaining gap is an accepted risk.
- **CLA or DCO:** GPL-3.0-or-later and REUSE already settle licensing.
- **Signing release artifacts:** see the register entry on release assets and tags.