gunk-dev/the-valley

bd-353c59d-agent-runs-push-as-the-operator.md

source7964e6acfb7fmain's published tip history
3.8 KiB · Rendered
1---
2type: bug
3id: bd-353c59d
4status: open
5title: Agent runs push as the operator, so write protection does not constrain the local fleet
6created: 2026-08-07
7source: rejection test on the pilot host, 2026-08-07
8---
9
10# Agent runs push as the operator
11
12An agent run dispatched on the host works in a git worktree beside the operator's own, and pushes
13over SSH with the operator's key. The pre-receive hook reads the principal from the key that
14authenticated the push, so every push from a locally dispatched run arrives as the operator. The
15operator is a declared writer of the protected projects. The invariant therefore admits every write
16the local fleet makes, and constrains nothing it does.
17
18The actors this leaves unconstrained are the ones the approval-gate thinking most wants constrained.
19The motivating failure behind [[ida-b7025b5]]
20([ideas/ida-b7025b5-human-decisions-are-signed-acts.md](../ideas/ida-b7025b5-human-decisions-are-signed-acts.md))
21is an approval gate administered by the agent it gates. Write protection is a gate of exactly that
22kind: it decides whether a push to a protected ref lands. An agent run holding the operator's key
23does not have to defeat it, because the gate cannot tell the run apart from the human whose key it
24carries.
25
26The evidence is a deliberate rejection test. A push from an agent worktree wrote a protected ref and
27the hook admitted it. The hook was right to: it was asked whether the operator may write that ref,
28and the operator may. The mechanism did what it says. What it says is narrower than the protection
29the host appears to have.
30
31The test-design lesson is separable and worth stating on its own: a rejection test must control the
32identity it tests with, or it tests the wrong claim.
33
34## Why it is acceptable today
35
36There is one operator. Agent runs are dispatched only by that operator, on that operator's own
37machine, and the protected write that surfaced this was the test's own. Nothing has yet acted under
38the operator's principal that the operator did not start, so the grant the runs inherit is currently
39no wider in effect than it is in name.
40
41## The gate
42
43The invariant needs identities behind it before an agent run acts with meaningful autonomy against a
44protected project — a run left to work unattended, a run dispatched by another run, or any run whose
45pushes are not watched as they happen. At that point a run must authenticate as its own principal,
46so that what the hook decides about it is a decision about the run and not about the human who
47started it.
48
49## Directions, not decisions
50
51These are existing threads, and this bug is what pulls them together.
52
53- **Registry entries for the machines and runs that push.** [[dcr-b87f6e8]]
54 ([decisions/dcr-b87f6e8-identity-is-a-governed-registry.md](../decisions/dcr-b87f6e8-identity-is-a-governed-registry.md))
55 already makes a principal a declared entry holding its own keys, its grants, and an expiry where
56 the kind warrants one. A run that is its own principal is an entry of that shape, and expiry is
57 what keeps the registry from accreting one per run forever.
58- **Per-run delegation.** [[ida-a8243d2]]
59 ([ideas/ida-a8243d2-agent-runs-act-under-delegated-authority.md](../ideas/ida-a8243d2-agent-runs-act-under-delegated-authority.md))
60 gives a run a bundle of permissions delegated from whoever initiated it, narrowable at every hop.
61 That is the shape the writer grant wants: a run pushes with authority derived from the operator's,
62 attenuated to what the run was dispatched to do.
63- **Not crediting the machine at all.** [[bd-8a591dc]]
64 ([bd-8a591dc-machine-credentials-never-expire.md](./bd-8a591dc-machine-credentials-never-expire.md))
65 observes that a machine the integrator fetches from needs to be reachable, not authorized to push.
66 A run that never holds a pushing credential cannot inherit the operator's, and the question of
67 which principal its push carries stops arising.