Many pages in this wiki describe the same move. A rule that an AI agent is meant to follow starts out as text in its context: a line in CLAUDE.md or AGENTS.md, a Markdown rule document, a tool docstring, a system prompt. Each account then finds that the text is not reliably followed. The rules that have to hold every time are moved out of the context and into a mechanism the model does not get to decide whether to run: a hook, a permission rule, a CI check, a test, a script, or a policy engine in application code. This page describes that recurring shape, the reasons the pages give for it, which rules they move and which they leave in place, and the limits they record.

The shape, and where it appears

Twenty-one pages sit behind this view. Fifteen state the shape from their own source:

  1. Agentic Coding Hooks: Deterministic AI Guardrails: everything supplied through the context window “is a suggestion, not a guarantee”. Hooks are presented as the deterministic layer because the runtime, not the model, decides whether they run.
  2. AI Agent Guardrails: Rules That LLMs Cannot Bypass: business rules in docstrings or system prompts are context the model interprets and re-decides on every call. A framework-level hook that cancels the call is presented as the enforcement.
  3. Claude Code Hooks Complete Guide - Deterministic Enforcement Across the Tool Lifecycle: “A system prompt is a request. A hook is a guarantee.”
  4. Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents: “every time X, always do Y” belongs in a hook, and “never do this” is the wrong job for an instruction. Hooks and permissions are named as the deterministic enforcement methods.
  5. Writing a good CLAUDE.md: “Claude is not a linter”. Deterministic formatters and linters, run for example from a Stop hook, do that job instead of instructions in the file.
  6. Skill Issue: Harness Engineering for Coding Agents: written after a year of watching coding agents ignore instructions, it gives hooks the job of deterministic control flow. Its example hook runs a formatter and type checks when Claude stops and returns exit code 2 on failure, so the harness makes the agent fix the errors.
  7. AIエージェント向けコーディングルールをArchUnitで機械的に検証する運用: coding rules written as Markdown for an agent are compiled, where they can be expressed structurally, into ArchUnit tests run as a required CI gate.
  8. Deterministic quality gate: after pull requests were merged with tests not passing, tests are run by a SubagentStop hook and a GitHub Action instead of being a step in the agent’s own workflow.
  9. Agent Governance Toolkit: prompt-level safety is described as “a polite request to a stochastic system”. Policy is enforced in deterministic application code that intercepts every tool call, message and delegation.
  10. AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents: a domain-specific language whose rules are evaluated by an enforcement layer that hooks the agent’s decision loop. The paper contrasts it with NVIDIA’s NeMo, which applies natural-language constraints at the dialogue level, and with GuardAgent, which relies on an LLM to interpret the constraints; AgentSpec keeps enforcement external to the model.
  11. FIDES: a Microsoft architecture decision record rejects prompt-engineering defences against prompt injection as non-deterministic and bypassable, and proposes labels enforced by middleware that checks policy before a call executes.
  12. 소프트웨어 3.0 시대를 맞이하며: deterministic logic such as a branch-naming convention should be moved into scripts, so the model runs a script instead of interpreting the convention and spending tokens on it each time.
  13. Security Context File: a file of security rules loaded into every session is paired with SAST, credential scanning and infrastructure validation that must pass before deployment, “with no reliance on prompt instructions alone”.
  14. A First Look at Coding Agents’ Compliance with AI Contribution Rules in Open-Source Communities: after measuring how coding agents handle the AI-contribution rules that open-source communities write down, the authors recommend enforcing bans and human-approval rules outside the agent: a CI check that blocks the merge, required human review, or a bot that closes AI-authored pull requests.
  15. Custom Code Review rules for Codex: repository rules in AGENTS.md are positioned as complementing tests and linters, not replacing them. Deterministic and mechanical checks stay in those tools and in CI, and tests, branch protections and required approvals continue to provide hard enforcement.

Three pages compile the shape from several sources, so they restate evidence rather than add separate cases:

  1. Agent Hooks gathers the argument from several of the pages above. What it adds is Anthropic’s Claude Code documentation saying in one line that CLAUDE.md instructions are advisory while hooks are deterministic.
  2. CLAUDE.md draws on Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents, Writing a good CLAUDE.md and Claude Code’s memory documentation. What it adds from that documentation is that CLAUDE.md is loaded as context rather than as enforced configuration, and that an instruction which must run at a fixed point, such as before every commit, should be written as a hook instead.
  3. Neurosymbolic Validation names the pattern in AI Agent Guardrails: Rules That LLMs Cannot Bypass and is drawn from that one post.

The remaining three relate to the shape without stating it:

  1. Guides and sensors supplies a vocabulary for it, described in the section on which rules move.
  2. AI가 팀 규칙을 지키도록 하는 방법 is a variation, described in its own section below. It moves team rules out of the start of the session and into hooks, but what the hooks deliver is still text the agent may act on or ignore.
  3. Build zero-trust AI agents that judge intent, not just syntax records where deterministic controls stop, described in the section on enforcement outside the model.

The pages come from different kinds of source: practitioner blogs, an AWS post on DEV Community, Anthropic’s and OpenAI’s own guidance about their products, HumanLayer posts, two teams’ posts about their own practice (one from Toss Bank), one engineer’s post from two infrastructure projects, a Microsoft repository and a Microsoft architecture decision record, a Google Cloud post, an ICSE 2026 paper and an empirical study from Peking University. Several of them centre on Claude Code, and the hook conventions they describe are largely that tool’s.

Why the pages treat instructions as suggestions

The pages agree that an instruction in context is not binding. They give different reasons for it:

Where the rule moves to

Across the pages, the destination varies with where in the workflow the rule has to hold:

The destinations also differ in who owns the rule. Agentic Coding Hooks: Deterministic AI Guardrails treats a hook’s placement as its scope: user settings for a personal safety net, the project’s settings for a team standard, and managed policy settings for an organisational guardrail. Build zero-trust AI agents that judge intent, not just syntax argues that enforcing checks in the platform moves their ownership to a platform or security administrator, separate from the agent developer.

Which rules move, and which stay

None of the pages moves every rule. Several of them draw the line explicitly, and they draw it in different places:

Guides and sensors gives a vocabulary that fits these lines. It sorts harness controls into guides, which steer before the agent acts, and sensors, which observe afterwards, and sorts each into computational (deterministic: tests, linters, type checkers) or inferential (AI review, LLM-as-a-judge). Conventions in AGENTS.md are its example of an inferential guide, and a hook running ArchUnit tests is its example of a computational sensor. Its account holds that both kinds are needed: feedback alone yields an agent that keeps repeating the same mistakes, and feedforward alone yields one that encodes rules but never finds out whether they worked. Security Context File uses the same terms: the file is an inferential guide, and the deterministic checks and deployment gates must still catch what the agent fails to follow.

Several pages also keep a role for instructions alongside enforcement. Agentic Coding Hooks: Deterministic AI Guardrails says better instructions help and that domain expertise in context remains high-impact. Claude Code Hooks Complete Guide - Deterministic Enforcement Across the Tool Lifecycle has CLAUDE.md, permissions and hooks cover the same requirement together.

What the pages record as its limits

The pages record these limits on the move itself:

Outside the model is not always deterministic

The pages mostly treat two properties as one: the rule is evaluated outside the model’s own decision, and the evaluation is deterministic. A few pages record mechanisms that have the first property without the second:

  • Agent Hooks records that Claude Code’s prompt and agent hook types are triggered deterministically but use the model’s judgment to decide their output. Agentic Coding Hooks: Deterministic AI Guardrails reports that Cursor added prompt-based hooks in which a fast model evaluates a natural-language condition, and calls an LLM prompt hook non-deterministic by nature, which it says a guardrail cannot afford.
  • AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents lists LLM self-examination among its predefined enforcements, alongside user inspection, a predefined action and stopping.
  • Build zero-trust AI agents that judge intent, not just syntax adds an LLM-based natural-language policy engine at the gateway, which evaluates each proposed tool call against plain-text business rules before it runs. It presents this as defence in depth alongside the deterministic controls from an earlier post in its series, not as a replacement for them. Its claims are the vendor’s own descriptions, demonstrated on a single example transaction.

In these cases the rule returns to natural language, but it is read by a separate check that can stop the call rather than by the agent whose action it governs.

A variation: hooks that deliver rules instead of enforcing them

AI가 팀 규칙을 지키도록 하는 방법 starts from the same observation: rules in a root instruction file stop being followed as a session lengthens. It reaches for the same mechanism, Agent Hooks, but uses it differently. Its plugin, pfmls-stylepack, hooks the point right after a file is written and the point where the agent tries to finish. At each point it injects a few matching convention rules as text next to the code they apply to. It does not block anything, and the end-of-loop text calls itself a reminder to review rather than a hard failure. The page frames its problem as one of when and how many rules to surface. What moves here is where the rule enters the context, not who decides whether it holds.

The page runs into two of the limits above. Its hooks select rules with filename patterns and regular expressions because a model-based relevance check added about ten seconds per request. It also reports a loosely triggered rule that fired in 21 sessions without leading to a single code change, and argues that wrong feedback teaches the agent to disregard the rules.

How strong the evidence is

Most of the evidence is one team’s or one author’s account. AI Agent Guardrails: Rules That LLMs Cannot Bypass reports its result on a purpose-built example of two invalid cases and one valid one, and describes it as a worked illustration rather than independent evidence. Deterministic quality gate is one engineer’s report from two projects. AIエージェント向けコーディングルールをArchUnitで機械的に検証する運用 reports no measured before-and-after, and the figures in AI가 팀 규칙을 지키도록 하는 방법 come from that team’s own logging. Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents is Anthropic’s guidance about its own product, and the 98% versus 58.3% figure in Custom Code Review rules for Codex is OpenAI’s internal evaluation of rules that guide a review, not of rules moved out of the prompt. FIDES is an architecture decision record with the status proposed, and Guides and sensors is one author’s mental model.

Two pages report measurements, and each covers only part of the pattern. A First Look at Coding Agents’ Compliance with AI Contribution Rules in Open-Source Communities measures the premise: how often four agent–model pairs follow AI-contribution rules left in a repository’s files, on simple issues. It does not measure the CI checks, reviews or bots it recommends. AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents measures runtime enforcement: it reports intercepting risky code executions in over 90% of cases, reducing hazardous tasks for an embodied agent to 0% while safe-task completion fell from 58.62% to 54.26%, and 100% compliance in the tested driving scenarios. Those results concern safety constraints on code, embodied and driving agents rather than a team’s coding rules.

What makes this a pattern is how often the same shape recurs across separately authored sources (Agent Hooks, CLAUDE.md and Neurosymbolic Validation are the exceptions, since each is compiled from others), not measured evidence that moving the rules works in general.