Most of what I've written for coding agents lately is prose, a playbook the agents read first, a set of skills and an AGENTS.md in each repo, and for a while I treated all of it the same way, as rules the agent follows. A review of one of those workflows made me sort them into two groups, the ones that are fine as instructions and the few that need something outside the model to back them, and this post is about where that line ended up and why. The workflow in question lives in a small demo workspace (a shared workspace repo with the playbook, skills and a guard script, plus two toy projects) that I built for a talk to my team about this way of working, and the thinking behind it is in the post about giving agents a foundation instead of a script.
What the review found
I asked an agent to review the whole flow, from spec to PR, with an eye on how reliable it is. Its verdict was that the design was sound but almost every guarantee in it was a sentence. The playbook said agents never skip git hooks with --no-verify, while none of the three repos had any git hooks or CI. My notes for the talk said the agent doesn't have permission to merge, "it simply can't", and nothing stopped it. A test-first rule had a "watch it fail" checkbox, and it was ticked for tests that had never been seen failing on their own assertion. And the spec's Status: Approved was text the agent wrote about its own spec, with no name and no time on it.
The review put the problem in terms of an audit. If someone asks what stops an agent from force-pushing to main, the docs' answer was the agent itself, which isn't much of an answer.
The conductor I didn't build
The same review proposed a /flow conductor command that keeps a state file per feature, runs each step in order and stops only at four human gates, which would have turned the "what to offer at each pause" rule into a check. I didn't build it, for reasons that are in the foundation post, but the short version is that the skills already stop and ask at each step, and a flow that scripts every step ages fast when the tools change every few weeks. The missing offers got fixed with a paragraph in the playbook that tells the agent what to propose at each pause. It's still an instruction, and that's fine, because if the agent forgets to offer a review step, you notice at the pause and ask for it, and nothing has happened that can't be redone.
Sorting by what happens if the agent ignores it
The test that worked for sorting is simple, we ask, for each rule, what happens if the agent ignores it once. Picking the wrong size for a change, skipping a reviewer, not offering the next step or writing a vague commit message all cost a bit of time or quality, and they get caught at the next pause or in review, so they stay as instructions. Force-pushing, skipping hooks or signing, merging a PR and pushing to main are different, because by the time anyone looks, history is rewritten or unreviewed code is on main. Those get denied outright. A few actions that are visible to other people but easy to undo, like filing an issue or posting review comments, sit in between and get an "ask" so a person confirms them.
That gave three layers:
-
Instructions - the playbook, the skills and
AGENTS.md. Sizing a change, the pauses between steps, which reviewers to run, where knowledge goes. -
An editor hook - one Node script that Claude Code runs before every shell command and Cursor runs before every
gitorghcommand. It denies the irreversible ones with a reason and asks before the visible ones. How it's wired up, and how it slowly turned into a shell parser, is a story of its own. - The remote - branch protection on main and a required human review. This is the layer the agent's local commands can't change, and it's also the one the demo doesn't have yet, since branch protection and a required review were never set up there.
The --no-verify deny looks odd next to repos with no hooks, but it's there so that once the repos get a pre-commit hook, skipping it is already off the table.
What the hook can't see
The hook reads command text, so it only knows what the command says, not what it does. Running the current version against a few probes from one of the project folders shows where that ends:
git push origin ma""in deny
git push origin HEAD:refs/heads/main deny
sh -c 'git push --force origin x' deny
b=main; git push origin $b ask
./push.sh allow
curl -X PUT .../pulls/1/merge allow
A variable gets an "ask", because the guard can't tell where the push goes, and a script or a curl call to GitHub's merge API isn't a git or gh command, so the guard has nothing to object to. Agents aren't trying to get around it, so in practice it stops the command an agent would normally type and tells it why, which is most of what we need from it day to day. But it means branch protection on the remote is what has to stop a push to main for good, and the talk notes changed to match, from "it simply can't" to saying the guard blocks those commands, best effort, as a strong default and not a sandbox.
Evidence no tool can check
One finding didn't fit any of the layers, since no hook can tell whether a test was seen failing. For the tests that had no record, each one got a one-line break of the production code, the failure message it produced and a note that the file was restored, written to the plan's log, so the claim is something a person can check later. The rule that should come out of it, and isn't in the flow yet, is that a failure like "not a function" from before the code existed doesn't count, because every test calling the missing function fails that way, whatever it asserts.
Approvals belong to the remote layer. An agent writing Approved into a spec isn't evidence that a person approved anything, so a person's approval should be a review on a PR or a commit the person makes with an Approved-by: trailer. In the demo that's still a recommendation, which is fine for a demo but would be the first thing to fix in a repo that handles anything real.
Where the line ended up
Most of an agent workflow can stay as plain instructions, and we lose very little by leaving it there, since that's where the judgment calls are and instructions are cheap to change when the tools change. The rules worth enforcing are the ones where ignoring them once leaves something you can't undo, which for this workflow meant force-pushing, skipping hooks or signing, merging and pushing to main. A hook in the editor is a good place for those because it catches the mistake early and gives the agent a reason it can act on, but it reads text, so the remote's branch protection and required review have to be there behind it. For the things no tool can check, like whether a test was seen failing or whether a person approved a spec, what worked was a record that someone else can verify later, kept somewhere the agent doesn't get to sign off on by itself.
Top comments (0)