Engineering

From 50 ad-hoc rules to one governed rule layer

Memory Stack engineering team Memory Stack

Orgs that have been running AI tools for more than a few months typically have rules in five different places simultaneously.

Some rules are embedded in prompts — baked into the system message, invisible to anyone who doesn't read the system message, impossible to update without a code change. Some rules are in shared documents that agents are sometimes included in context and sometimes aren't. Some rules exist only as institutional knowledge: "everyone knows we don't do X" — until a new agent is spun up and nobody told it. Some rules were logged somewhere once, in a format that has since been superseded.

The rule layer isn't something teams plan. It accumulates. And accumulated rules without a governance model become a liability at exactly the moment you scale.


The governance failure at scale

When your rule set is distributed across prompts, docs, and institutional knowledge, several things break simultaneously.

Auditability evaporates. "Why did the AI do that?" is an unanswerable question when the rules governing the behavior are embedded in a prompt nobody can quickly read, corroborated by a doc nobody can trace back to a session, and partially overridden by institutional knowledge nobody wrote down.

Rules conflict silently. Prompt rule says X. Doc rule says not-X. Nobody noticed because the doc isn't always loaded. The agent encounters a case where both rules apply and resolves the conflict however its context window happened to be structured at that moment — not how the org intended.

Updates break things unpredictably. Changing a rule embedded in a prompt requires a deploy. Changing a rule in a shared doc requires everyone who loads that doc to get the new version. Rules that live in people's heads update only when someone tells the right people. There's no broadcast; there's no versioning; there's no way to see what changed.


What a rule layer actually looks like

In Memory Stack, rules are memories with a specific structure: natural language, tagged for the agents and contexts that should load them, versioned, attributed to the person who wrote them, and logged when they govern a session.

A rule isn't a prompt directive embedded in a system message. It's a first-class artifact — something that can be searched, reviewed, updated, and retired independently of the agents that load it.

The rule layer is the collection of all active rules across the org. A compliance team can see every rule that governs AI behavior in their domain. An ops lead can see every rule tagged for their team's agents. An engineer can see every rule loaded in last Thursday's session for agent X.

This is the governed version of what most teams have as an ungoverned accumulation.


Attribution and the turnover case

Rules embedded in prompts are typically unattributed. Someone wrote that system message, but the prompt doesn't say who or when. When the person who wrote it leaves, the rule lives on without context — and the reasoning behind it, the conditions that might make it worth changing, and the person who understood it are all gone.

Rules in Memory Stack are attributed at creation and at each update. Every version carries the name of who wrote it and when. The rule's history is the history of every decision made about it.

When someone leaves, the rules they wrote don't evaporate — and they don't become orphaned policies without context. The attribution chain is intact. A successor can read the rule, see its history, and understand why it exists. They can update it with their name and reasoning attached. The institutional knowledge is in the rule itself, not in the person who wrote it.


The audit question

"Why did the AI behave that way?" — answerable in two steps with a governed rule layer.

Step one: look at the session's rule citation log. Every rule that was loaded for that session is recorded with the rule ID, memory ID, user who created it, and timestamp.

Step two: read the rule. Its text, its history, and the reasoning attached to it are all there.

This is the compliance case. This is the legal case. This is the "we need to show a regulator what governed this decision" case. A prompt embedded in a system message doesn't produce this trail. A rule layer with session-level citations does.


Migration: from ad-hoc to governed

Moving from 50 ad-hoc rules scattered across prompts, docs, and institutional knowledge to a governed rule layer is a consolidation exercise, not a technical migration.

The practical path: audit your current rule surfaces (system prompts, shared docs, informal team agreements), extract the rules, log them into Memory Stack with attribution and rationale, and tag them for the agents that should load them. Retire the prompt-embedded versions over time as the memory layer matures.

The audit typically surfaces two things: rules that were never explicitly agreed to (they were just in the prompt and nobody questioned them) and rules that conflict with each other (discovered for the first time because they're now in the same governed layer where conflicts surface automatically).

Both are useful discoveries. The first requires a decision about whether the rule is actually the org's intent. The second requires a resolution. Neither was visible when the rules were distributed.


The honest version

A rule layer is only as good as the coverage and quality of the rules in it. An incomplete migration — some rules in the layer, some still embedded in prompts — creates a two-system problem that's harder to reason about than either alone.

And rules need maintenance. A rule that was correct in Q1 may be incorrect in Q3. The Stale Shelf mechanism surfaces rules that haven't been reviewed in a configurable period — prompting review rather than letting stale rules silently govern behavior.

The governance infrastructure is the starting point, not the destination. What you do with it depends on how well you maintain it.


Fifty ad-hoc rules are a starting state, not a final state. The governed rule layer is what they become when the org is ready to treat AI behavior as something that should be auditable, attributable, and maintainable.

Give your AI tools persistent memory

Memory Stack gives every AI tool you use — Claude, Cursor, ChatGPT — access to the same shared context. No download, no key paste, no config file.

Start for free →