Back to all essays
The Cut You'll Make Twice
AI & Automation • • 6 min read

The Cut You'll Make Twice

A written rule is not a control until the system has a place to enforce it and a failure record that proves what happened.

NC

Nino Chavez

Product Architect at commerce.com

The rule was written down. The build still accepted the mistake it was meant to prevent.

There is a file in this blog’s repo called tags.ts. It tells every agent writing a post not to add a tag without updating the approved list. It also says build validation will reject unapproved tags.

The schema that would do that rejecting is one line in another file:

tags: z.array(z.string()).optional(),

That accepts any array of any strings. No validation compares a post’s tags with the approved list.

So I counted. Two hundred seventy-seven files carry tags. The approved list has eighteen entries. Forty-nine distinct tags are actually in use — thirty-two of them off-list, across sixty-four uses. The build has been green the entire time.

The rule did not fail noisily. It did not fail at all. It was a request written in the place where enforcement was supposed to be.

A warning is not a control

This is the easy mistake to make with coding agents. We put the desired behavior in AGENTS.md, CLAUDE.md, a system prompt, or a paragraph pasted into a session. The agent reads it and often follows it. That is useful. It is not the same as a control.

A control needs three things:

  • a defined action it can allow or stop;
  • a place in the system where it can act;
  • a record that shows what happened when the condition was met.

The tag file had none of those. It named the desired state, but the schema accepted the undesired state, the build never checked it, and no failure could point to the missing comparison.

That gives a simple audit question: if this rule is broken, what exact line is supposed to stop the work, and what evidence will I see?

If the answer is “the agent was told not to,” the rule may still be worth keeping. It is a warning label, not enforcement.

The missing address

The same distinction appeared in a storefront where a model composes page layouts.

A catalog declares every named place where the model may write: twenty-eight zones across ten surfaces. The cart has three zones. Line items, order totals, promo entry, and the checkout button are not among them.

No policy says the model may not change the cart total. Nobody had to write that sentence. The model receives a schema of writable places, and no address in that schema reaches the total.

That is a different kind of boundary from a hook that interrupts a command. A hook sees an attempted action and can deny it. A missing zone removes the action from the model’s available shape. The model cannot write to a place the system never named.

That can be a good design. It can make an unsafe change impossible. But it creates a harder question: how do you know what you forgot to make possible?

In the storefront resolver, an unknown zone throws loudly. But when the engine produced content for a zone marked non-composable, the condition was simply false. Execution fell through to a static fallback. The page rendered. The merchant saw a normal page.

The resolver was loud about the harmless failure and silent about the meaningful one. The retrieval log recorded the things that succeeded. It had no field for a discarded write, its reason, or the surface the model had tried to reach.

The missing address left no event behind.

Make the boundary inspectable

The answer is not to turn every structural boundary into a noisy error. A model should not crash because a cart total is intentionally outside its composition surface.

The answer is to give the boundary an observable outcome.

For the storefront, that could be a discard record containing the surface, attempted zone, reason, and fallback. For the tag list, it could be an enum derived from the approved keys, with the build failing on the first off-list value.

The two systems need different behavior, but the same proof:

rule -> enforcement point -> observable result

Without the middle term, the rule is advice. Without the last term, the control can fail silently. A clean page and a green build do not prove that the boundary worked. They only prove that the system found a path to an output.

The control I left on paper

There is a second version of this mistake in my own workflow.

The operator card I load into sessions points to a script that checks short-form captions against the longer posts they came from. The check exists because a summary can quietly change who made a claim or turn a hypothesis into a fact.

But the script lives on a branch. The syndication/ directory on the main branch has no copy of it. The instruction says a mechanical check exists, while the publication path does not run it.

That is the same failure as tags.ts, one level up. The first case had a rule without a mechanism. This one had a mechanism without an installed path. Both looked like enforcement from inside the instructions file.

An uninstalled control is indistinguishable from an installed one until the day it should have stopped something.

The cut you make twice

The useful lesson is smaller than “build more guardrails.”

When a task is likely to recur, make the boundary real before the second attempt. Put the allowed action in a schema, hook, validator, or other enforcement point. Then decide what the system should record when it refuses, falls back, or has no place to act.

For a one-off task, a warning may be enough. Measure twice. Read the output. Keep a human in the loop.

For the second attempt, the question changes:

  • What exactly am I trying to prevent?
  • Where can the system enforce that boundary?
  • What should remain possible?
  • What record will show me that the boundary worked?

If you cannot answer the last question, you have not finished building the control. You have written the label and started trusting the green result.

The tag validator is still missing. The storefront still has no record of the content it silently discarded. The post’s point is not that either system is unsafe by definition. It is that a boundary you cannot observe is a boundary you can accidentally put in the wrong place.

Share:

More in AI & Automation