CLAUDE.md Is Not Governance
Your CLAUDE.md is being ignored. Your .cursorrules stopped working. Your AI agent ignores instructions after 20 messages. That's because system prompts are suggestions, not constraints. Runtime governance is deterministic enforcement. They are not the same thing.
The Fundamental Problem
CLAUDE.md, .cursorrules, and system prompts are text-based instructions injected at the beginning of a conversation. They ask the model to follow rules. But they have no enforcement mechanism.
What CLAUDE.md Does
- • Asks the agent to follow rules
- • Uses natural language
- • Has no enforcement
- • Competes for context space
- • Gets less attention over time
- • Can be overridden by user prompts
What Governance Does
- • Enforces rules via middleware
- • Uses policy-as-code (YAML)
- • Blocks unauthorized actions
- • Operates outside context window
- • Enforcement never degrades
- • Cannot be overridden by prompts
Documented: "Do not modify files outside the /src directory" in CLAUDE.md was bypassed within 3 messages when the agent determined a config change would be "helpful."
Why Text Instructions Get Bypassed
Context pressure
As conversation grows, system prompt gets less attention weight. The model's focus shifts to recent messages.
Rules forgotten after ~60 minHelpfulness override
Models are trained to be helpful. When the agent determines a rule-violating action would be "better," helpfulness wins.
Rules overridden proactivelyAmbiguity exploitation
Natural language rules have interpretive gaps. The agent finds valid readings that justify violations.
Rules reinterpreted creativelyInstruction injection
User prompts can inadvertently override system prompt rules through stronger language.
Rules overridden by userThe 4-Layer Governance Stack
Real governance operates across 4 layers, each with middleware enforcement that cannot be bypassed by the model.
Identity Layer
CLAUDE.md + policy.yaml manifestWho is the agent? What are its principles? What are its boundaries?
Skill Layer
Operational procedures + YAML policiesWhat can the agent do? What procedures must it follow?
Tool Layer
middleware.ts + permission manifestsWhich tools can the agent use? What permissions are required?
Environment Layer
File guards + budget caps + context limitsWhat files can it access? What are the cost limits?
How to Move Beyond System Prompts
- Step 1 — Deploy CLAUDE.md as identity layer (necessary but not sufficient)
- Step 2 — Add policy.yaml with machine-readable rules
- Step 3 — Deploy middleware.ts that intercepts and enforces policies
- Step 4 — Configure file guards, cost limits, and retry caps
- Step 5 — Add audit logging for every agent action
- Step 6 — Set up human escalation triggers for threshold violations