cd /news/developer-tools/a-two-person-rule-for-ai-coding-agen… · home topics developer-tools article
[ARTICLE · art-120393] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

A two-person rule for AI coding agents

A developer has released twoperson, an open-source Python CLI that enforces a two-person rule for AI coding agents by binding code reviews to specific commits. The tool addresses the problem of agents skipping or bypassing review steps by moving enforcement from system prompts into a file-based approval ledger. It is available on PyPI and GitHub under an MIT license.

read2 min views1 publishedSep 3, 2026

I run two coding agents on one repo — one building, one reviewing. For months the "get a review first" rule was a line in a system prompt. It held right up until the builder was unattended for a few hours. Then it would skip the review, or review its own work, or get a real approval and quietly rebase three commits on top before pushing.

A rule the agent can talk itself out of isn't really a rule. So I moved it out of the prompt and into the file format the agents use to talk to each other.

It isn't a code reviewer — the agents do the reviewing. It's the layer underneath that: a local, offline, SHA-bound approval ledger and shipping gate for multi-agent coding workflows. It records that a review happened, pins the verdict to one commit, and refuses to let the builder call anything "shipped" without one.

twoperson

is a small Python CLI. The builder writes a JSON review packet — goal, head SHA, files, tests — and publishes it. The reviewer claims it and records a verdict. The enforcement lives in the schema, not in anyone's good intentions:

So an approval is bound to one exact commit. Rebase, amend, or add a commit on top and the approval goes stale — the schema simply can't represent "we shipped it" without a matching, current review.

twoperson install-hook

adds a Claude Code Stop hook so the reviewer wakes when the builder's session ends, instead of polling on a timer. The hook only drops a signal — never a packet — because a hook doesn't know whether the tests actually passed.It isn't a replacement for GitHub PRs or branch protection — those are server-side and great. twoperson

is the local gate before that: a way for a second agent to sign off on the exact commit at the speed of local file I/O, so by the time a PR opens there's already a commit-bound record of what was reviewed. If you run agents unattended and want an approval pinned to a commit rather than a vibe, that's the gap it fills.

Prior art I read first, because it's the obvious question. OpenAI's codex-plugin-cc

has an opt-in Stop-hook review gate — genuinely the better tool if you want a second model on the diff in-session — but it gates the turn, not a commit, and nothing later refuses a stale "we pushed it." claude-review-loop

persists reviews without binding them to a SHA. shiplog

leans on signed Reviewed-by:

commits but needs gh

and a remote. secondmate

has the same stale-approval refusal, but gets there by spawning the agents itself. I wanted the binding without the orchestration.

MIT, on PyPI:

pip install twoperson

https://github.com/ahm3dwasim/twoperson

Would genuinely like to hear how others are gating agent pushes.

── more in #developer-tools 4 stories · sorted by recency
── more on @twoperson 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-two-person-rule-fo…] indexed:0 read:2min 2026-09-03 ·