Money is never a raw float.
Everyone on your team knows this. Ask any of them in an interview and they’ll explain it cleanly: floats lose pennies, rounding compounds, and the day a billing total comes out three cents short is the day someone’s audit goes sideways. Use a decimal type. Use a money value object. Never a bare float. It’s in the wiki. It’s in the onboarding doc. Nobody disagrees.
The agent just shipped a pull request that stores an invoice amount as a float. Forty lines, readable, tests green, the diff unremarkable. It merged.
The rule wasn’t wrong. The team wasn’t careless. The standard was written down, agreed on, and genuinely believed by every human who works on the codebase. It failed for a single reason: it lived in a place the generator never visits, at the one altitude where obeying it is a choice. The wiki asks. It does not stop.
This is the tenth article’s exercise, finished. Topic 10 asked you to sort every standard your org relies on into two columns, enforced and agreed-upon, and to recognize the right column as your real exposure under AI. By now you have that right column. This piece answers the only question it raises: for each agreement sitting in it, what would it take to make the thing mechanical, and where should that machine live?
Topic 19 closed with an explicit promise: the general method for turning any rule into a check is a topic of its own, and I’ll come back to it. This is that topic. Architecture enforcement was one rule becoming one kind of gate. Here is the whole ladder, for every rule, and the single question that tells you which rung each one belongs on.
You Don’t Have a Standards Problem. You Have an Altitude Problem.
Here is the move the rest of this piece runs on. A cultural agreement and a hard guardrail are not two different things. They are the same rule at two different altitudes.
The agreement is the rule written where a human has to choose to obey it. The guardrail is that identical rule, pushed down the lifecycle to a stage where something mechanical hits it and refuses. “Money is never a raw float” is a cultural agreement when it lives in the wiki. It becomes a guardrail the moment it lives in a Money type the compiler won’t let you bypass. Same rule. Same words. Different address.
So conversion adds no new policy. This matters, because the instinct, when a standard keeps getting violated, is to say it louder: a clearer wiki page, a sterner reminder in standup, a more detailed CLAUDE.md. Every one of those keeps the rule at the altitude where it already failed. You are not writing a new rule. You already have the rule, fully formed. You are changing where it lives.
And the only thing that changes obedience is altitude, because of two facts that point the same direction. AI respects exactly the constraints it encounters at execution: a compiler error, a failing build, a blocked tool call. It does not respect the constraints it never encounters, which is everything in your wiki. And humans reliably respect the constraints that stop them, not the ones that ask them. Both fail at the altitude of the document. Both comply at the altitude where something executes: the compiler, the build, the blocked tool call.
Manufacturing settled this argument forty years ago. Shigeo Shingo’s mistake-proofing hierarchy ranks source inspection, which prevents the defect before work proceeds, above informative inspection, above judgment after the fact. A compiler error is source inspection. A review comment hoping someone notices is judgment. Earlier in the lifecycle is categorically stronger, not as an opinion, as a forty-year-old result.
That gives you a ladder of stages, ordered by how early the rule fires, where earlier is both more binding and cheaper to obey. The conversion procedure for any single agreement is one question, asked top-down: what is the earliest rung this rule can live on? A rule that can be a type should never be a review comment. A rule that can fail the build should never be a wiki paragraph. You push each rule as far down toward execution as it will go, and you accept review only for what genuinely can’t be expressed any lower. (The ordering is by binding strength and lifecycle together: the top three rungs fire in strict sequence, compile before commit before merge, and the lower three are pipeline siblings guarding different artifacts.)
The Ladder
Rung 1, the type system: make the illegal state unrepresentable. This is the top rung, and it’s where the money rule lands. You don’t write a check that catches a raw float. You make a raw float impossible to write. Parse, don’t validate, in Alexis King’s 2019 phrasing: take untrusted input once at the boundary, turn it into a constrained type, and let everything downstream rely on the type’s guarantee. Make illegal states unrepresentable, in Yaron Minsky’s: a Money value object with a private constructor, so the bare float has nowhere to live. Works in any expressive type system. The conversion turns the rule into a type, so the violation isn’t caught, it can’t be written, because an agent cannot generate code in a shape the compiler forbids. The strongest guardrail is the one where there’s nothing to enforce, because the bad state has no representation and no check to run, ignore, or maintain. The failure mode is over-modeling, where every trivial field becomes a bespoke type and the codebase calcifies. Reserve it for the states that actually hurt when illegal.
Rung 2, pre-commit: block it before the commit exists. For the fast, local, file-level rules. No secrets in commits. Run the formatter. No debug statements left in. A pre-commit hook (the pre-commit framework, Gitleaks for secrets) aborts the commit on violation, handing the author feedback in seconds. Agents commit fast and often, so catching a class of error at the keystroke boundary stops it from ever entering history, where it’s expensive to scrub. But be honest about this rung: a pre-commit hook is bypassable. git commit --no-verify is the modern shrug, and the hook only runs on machines that installed it. A pre-commit hook on its own is a faster cultural agreement, not a guardrail. Which is the whole reason rung 3 exists.
Rung 3, CI: the gate that can’t be bypassed. The money rule never reached this rung. It died at compile time, which is exactly what pushing low buys you. But most rules can’t be types, and they land here: anything that must hold before code merges, no matter who or what wrote it. Linter rules promoted to build-failing errors, tests, coverage and mutation thresholds, the secret scan from rung 2 re-run server-side so the --no-verify bypass is caught, and architecture fitness functions, the rung Topic 19 lived on: ArchUnit, dependency-cruiser, import-linter. The rule fails the build, so the merge cannot happen. This is where “agreed upon” becomes structurally “enforced,” because CI is the one stage no developer and no agent can skip. It’s also model-independent: you don’t control which agent ran, which model your contractor used, or what next quarter’s upgrade swaps in, and CI doesn’t care. It checks what landed, not who typed it.
This is also where the manual verification you’re doing by hand on every AI pull request stops being a person’s evening and disappears into the pipeline. That manual checking has a name and a price, and I’ll come back to it. The failure mode is the noisy gate, the one a developer eventually learns to route around: a check that flags legitimate work gets ignored, then disabled, then --no-verify‘d. Scope tight. A precise gate that’s right every time is a control; one that cries wolf is training data for ignoring it. And the rung rests on something earlier in this series: a CI gate is only a guardrail if CI is trustworthy. A flaky pipeline turns every gate back into a suggestion.
Rung 4, policy-as-code: enforce the rules that aren’t about code. Here the cadence slows, because this is fresh ground for most readers. These are the rules that live in a runbook rather than a codebase: no public storage buckets, every resource tagged, prod deploys require two approvals, no :latest image tags. The most “documented but optional” standards you have, and the ones AI-generated infrastructure-as-code sails straight past. The instrument is a policy engine: Open Policy Agent, with its Rego language, and Conftest for config and IaC files, graduated from the CNCF in January 2021. The model is simple. Policy evaluation runs like a unit test, and if the policy fails, the pipeline fails. So “we agreed prod must look like X” becomes a blocking check on every change to infra. This rung matters more every quarter, because agents now generate Terraform, Kubernetes manifests, and CI configs themselves, the exact artifacts where a quiet misconfiguration becomes a breach. The failure mode is policy sprawl nobody owns, the same ownership discipline every rung needs.
Rung 5, the AI harness: enforcement inside the generator. This is the rung that makes this a 2026 piece and not a 2019 one. It converts the newest and most seductive cultural agreement of all: “we told the AI not to,” the rule that lives in CLAUDE.md, .cursorrules, copilot-instructions.md. Here is the uncomfortable thing about those files. A rules file is advisory. It’s the define-enforce gap reincarnated for agents, and you can measure exactly how advisory. A NeurIPS 2025 workshop result tested the best case, governance rules placed literally in the prompt, and found 73% enforcement accuracy, meaning 27% of violations slipped through with the policy sitting right there in the context window. That’s one workshop result, so hold the figure lightly, but the direction is the point: a rules file is a wiki page the AI happens to read. It is not enforcement.
The instrument is a harness hook. Claude Code is the worked example: a PreToolUse hook runs before a tool call and can deterministically block it, exit code 2 or a JSON permissionDecision: "deny", independent of whatever the model reasoned its way into. The docs draw the exact line this series draws. CLAUDE.md is non-binding guidance the model can choose to ignore; a hook is deterministic control that cannot be overridden by the model’s reasoning. Cursor and its peers expose analogous hooks; the pattern is the point, not the product. The conversion takes the rule you wrote in the rules file and puts it in a hook that blocks the action: “don’t run destructive commands,” “don’t touch these protected paths,” “don’t commit without running tests” stop being requests and become walls the agent hits. Faros AI’s 2026 report frames the payoff: push the guardrails into the harness and the agent tests and validates its own output before a human ever sees it. Enforcement moves upstream of review entirely. The failure mode is treating the hook as a replacement for rungs 1 through 4. The harness hook protects this agent run; the CI gate protects the repo from every author, forever. They compose, they don’t substitute.
Rung 6, review as an enforced gate: the honest backstop. The money rule rode all the way to the top of the ladder, into a type. Some rules can’t descend at all. Whether an abstraction is sound, whether a boundary sits in the right place, whether the change is the right change at all. A gate catches the rules you can express; it does not catch judgment. The move here is not to pretend judgment reduces to a check. It’s to make review itself a guardrail instead of a cultural agreement. Faros’s prescription is exact: “Define a review policy. Then enforce it as a gate.... Every PR must pass a gate, human, agent, or both, before it merges. Make that gate explicit, enforce it at the tooling level, and audit it regularly.” The reason ad-hoc review collapses is in Faros’s own telemetry, the review-collapse numbers Topic 19 drew on: pull requests merged with no review at all, human or agentic, up 31.3%, and average pull request size up 51.3%. “We review important things” is a cultural agreement that buckles under that volume. A branch-protection rule that blocks the merge until the required review exists is a guardrail.
The line that keeps this rung from being a cop-out: it enforces the existence of a decision point, not the content of the judgment. The guardrail is “a qualified human, or a trusted agent, must look and sign off before this merges,” held mechanically by branch protection. The judgment stays human. You’ve still pushed the rule as low as it goes, because the lowest available rung for judgment is enforcing that judgment happens. Slice by risk: high-stakes and security-sensitive paths warrant human eyes, lower-risk paths may be fine with a trusted agent reviewer. What’s not acceptable under any policy is no gate. The failure mode is making review the dumping ground for rules that should have been pushed lower. Faros again: “Build quality gates into the development environment, not the review queue.” Review is rung 6 because it’s the last resort, not the first.
The Brakes That Let You Go Faster
Walk back up the ladder and you can hear the objection forming. This is a lot of machinery. The whole point of AI was speed, and you’ve just described six places to slow it down.
That gets the physics backwards. DORA’s 2026 report on the ROI of AI-assisted development makes the structural point a CTO needs. As model inference cost collapses toward zero, the real cost of AI adoption has moved. It now sits in what DORA calls governance cost: managing the verification tax, the manual checking somebody does by hand on every AI pull request to confirm it didn’t quietly break something. That tax is the thing actually slowing you down, paid in reviewer-hours, plus the incidents from the violations that merged while no one was looking.
DORA’s prescription is precisely the move in this piece: shifting from manual checkpoints to automated nonoptional security and quality gates. Their framing for what those gates are: in an agentic world, they “act as the brakes that allow the engineering engine to go faster safely.” Worth saying plainly that “brakes that let the engine go faster” is DORA’s metaphor, not a measured finding. But the metaphor holds, and it’s the one that defeats the bureaucracy reflex. A car without brakes isn’t faster. It’s undriveable above walking pace. The gate isn’t the tax on AI velocity. The gate is what makes the tax vanish into the pipeline so you can take your foot off the worry.
Making It Stick
A ladder of gates can rot into a graveyard of disabled checks. Four patterns are the difference.
Ratchet on new code. The loudest objection to all of this is “we have two million lines of legacy that would all fail the gate on day one.” You don’t retrofit. You ratchet. SonarQube’s Clean as You Code, generalized: enforce the standard on new and changed code only, the New Code Period, so the rule binds from this commit forward and the legacy debt drains as files are touched. This matters more under AI, not less, because AI inflates new-code volume, which is exactly where the ratchet bites.
Scope tight. Each gate guards the one rule a violation would actually hurt. Precision over coverage. A gate that’s right every time becomes invisible infrastructure; a gate that flags legitimate refactors becomes the thing everyone learns to route around. When developers bypass a gate, it’s almost always a noisy one. That’s a design failure of the gate, not an argument against gates.
Defense in depth. Mirror every bypassable rung with a non-bypassable one. The pre-commit secret scan is backed by the CI secret scan, so a
--no-verifyis still caught before merge. The same rule at two altitudes.The doc becomes intent, not enforcement. You don’t delete the wiki. You demote it. It explains why the rule exists, for the humans. The rung holds it, for everyone and everything. Same structural decision Topic 19 made for ADRs, now generalized.
And the project itself is smaller than it looks. This is not one tooling initiative you have to staff. It’s a per-rule decision. Take the right column, rank it by what a violation would cost, and convert the top few to their earliest rung. A type. A pre-commit hook. One CI check. One harness hook. The heavy option is the one you’re running right now: manual verification that doesn’t scale, and incidents that do.
The Diagnostic: From Right Column to Rungs
The portable test this piece leaves you with is one line, and it works on any rule forever: what’s the earliest rung this rule can live on?
If you’re close to the code, here’s the constructive version. Take the review comment you’re tired of typing. The rule you keep repeating in pull request after pull request, the one that makes you sigh before you even start the reply. Name the earliest rung that would mean you never type it again. If it’s a shape, it’s a type. If it’s a file-level check, it’s pre-commit, mirrored in CI. If it’s about your infra, it’s policy-as-code. Then build that one gate this week. Not the whole right column. The one comment you’re sick of writing.
If you lead the org, ask a sharper version. Of our top five standards, the ones a violation would genuinely hurt, how many are enforced by a machine versus agreed-upon by people? And who owns each gate, by name? The standards with no name next to them are the ones living at the altitude where obeying them is optional.
Go back to the money rule from the opening. It was never wrong, and the team was never careless. It was filed at the one altitude where compliance is a choice, and a machine that doesn’t make choices walked right past it. You don’t need to say it louder. You need to move it down: to the type that won’t compile, the hook that won’t fire, the build that won’t pass, until obeying it stops being a decision anyone, human or model, gets to make.
You now have the how. The score that tells you where you stand, and the discipline to keep the gates from rotting, are the next two pieces. For now, pick the one standard you’re tired of repeating, and answer the only question that matters: what’s the earliest rung it could live on, and what’s stopping you from putting it there this week
?


