When can you actually enforce a rule on an AI agent?

THE SHORT ANSWER

When the decision is observable at a chokepoint every call already passes through, can be decided without the agent's reasoning, and is cheap to reverse if wrong. Two of the three and you can build a gate. Spotify's shunt plugin is the clean case: a hook blocks any file read over 350 lines because a path and a line count are visible before the read happens, but the boilerplate-writing path stays advisory because whether a piece of code is boilerplate or design is a judgment the gate cannot make without doing the reasoning it was meant to avoid. Their first attempt, rules in CLAUDE.md, was ignored. A rule that fails the test is a preference, however firmly it is written, and the honest move is to know which one you are holding.

The test is short enough to run on every rule you have written for an agent this year.

Is the decision observable at a chokepoint every call already goes through? Can it be decided without the agent's reasoning? Is it cheap to reverse if wrong? Two yeses and you can build something that stops the agent. Fewer, and what you have written is documentation.

Spotify's shunt plugin is the cleanest public example of both halves at once. The read path is a gate because a line count is a fact. The write path is a suggestion because "is this boilerplate" is a judgment. Same team, same plugin, same intent, and the README is honest that only one of the two is enforced.

The post above takes the argument into where the gate should live when you own the runtime, and into the trust problem that cheap-tier routing creates for any system that keeps what the cheap model produced.

SOURCES

THE LONG VERSION

RELATED ANSWERS

Last reviewed 2026-09-17 · 1 min read