Skip to content
shiporbreak

No streak yet

Sign in

November 10, 2026 路 #55

AI agentsMediumOpen write-up

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: write on branches and pull_requests: write to open PRs, without bypass rights.
  • Use a ruleset on main that 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.

Sponsor this spot

Put your tool on the puzzle
One labeled card, in front of engineers who show up every day from YouTube, TikTok, and Instagram.