November 10, 2026 路 #55
The agent that approved itself
A coding agent opens pull requests with a token that can also approve and merge, and it is exempt from branch protection. What is the right setup?
Next puzzle in UTC
One try. The first answer sticks.
How to fix it
Prompts are not access control. If the token can merge, a prompt injection in an issue or dependency can ship code to main. Enforce review in branch protection.
An agent reads untrusted text all day: issues, docs, error messages, dependency READMEs. Any of it can carry instructions. If the same credential that writes code can also approve and merge, there is no point where something independent says no. A second copy of the same agent reading the same poisoned context is not independent.
Fix
- Scope the agent's GitHub App or token to
contents: writeon branches andpull_requests: writeto open PRs, without bypass rights. - Use a ruleset on
mainthat requires an approving review from a code owner and required status checks, with no bypass list for the agent. - Let the agent comment and request review, never merge.
Speed comes from auto-merge after a human approval, not from removing the approval.