The Book of Doug
The Book of Doug
Governance for AI agents that can say no — and learn from what reality does next
A white paper · September 2026
1. The problem nobody's policy document solves
Every organization putting AI agents into production now has the same three-ring problem:
- The agents can act. They push code, run commands, deploy images, write
files. The blast radius is real.
- The rules live in documents. Style guides, architectural principles,
operational policies — all perfectly good prose that no running system can enforce. Agents skim them the way developers skim license agreements.
- When a rule is wrong, nobody finds out. An engineer hits a rule that
doesn't fit their situation. They work around it quietly, or ask for an exception that gets granted or forgotten. Seven more people hit the same rule for seven different reasons. Nobody notices that the rule — not the people — is what needs changing.
The usual answers fail in one direction or the other. Do nothing and the agents eventually break something that matters. Block everything and the agents become useless. Ask the LLM to police the LLM and you get a gatekeeper that can be talked out of anything by a sufficiently creative prompt.
The Book of Doug is a fourth answer: a normative layer for an engineering estate that does two things at once —
It makes doctrine enforceable. And it makes doctrine capable of learning from reality.
2. The Book
The Book is a registry of doctrine — the organization's actual rules — stored as structured, versioned records, not prose in a wiki. Each entry has:
- An id and a formulation —
DOUG-0011, and its scripture: *"A production
service shall not exist as a singleton."*
- A type —
LAW(mandatory; can block),PATTERN(the normal approved way;
deviation needs explanation), PREFERENCE (a legitimate tie-breaker), DECISION (a recorded architectural choice), or DEPRECATED (retired but kept for provenance).
- Structured rules — the checkable conditions, not just the slogan.
- Scope, rationale, provenance — who said this, when, where it came from,
and what changed between versions.
Doctrine is born PROPOSED and becomes ACTIVE only by a human ruling. Nothing promotes itself. This is the system's first law, written about itself:
DOUG-0001 — Humans approve; machines propose. An AI may draft, classify, and recommend — never self-approve. Approval is the cheapest point of control; doing is the most expensive. Put the human at the cheap end.
Versions are immutable. Every ruling is recorded. The Book keeps receipts — including of its own stillbirths (a rejected proposal stays in the record, with the reason).
3. The Judge
A rule that can't stop anything is a wish. So every consequential action an agent takes passes through the Judge: a deterministic evaluator that checks the intended action against applicable doctrine before execution and returns a structured verdict:
{
"decision": "DENY",
"law": "DOUG-0010",
"conflict": "az acr build to live-tier image scormnodeworker:booktest is a deploy: pushing it builds the LIVE candidate.",
"required_conditions": [
"Dev builds target the -stable repo (auto-roll)",
"LIVE builds/rolls are operator-gated"
],
"may_pray": true
}
Three properties make this trustworthy where an LLM gatekeeper is not:
No LLM in the verdict path. An LLM may retrieve and classify candidate doctrine; a deterministic evaluator decides compliance. The Judge cannot be sweet-talked. (The second law, also written about itself: DOUG-0002 — a deterministic judge watches every turn, and its verdicts are structured, not vibes.)
It fails open. A broken gate must never wedge every session. If the Judge itself crashes, the action proceeds and the failure is logged. A governance system that takes down the estate is worse than no governance.
It has a sense of humor with a precise technical reason underneath. A denial reads like this:
Thou shalt not. This conflicts with DOUG-0010: "Claude commits; the operator deploys. Dev may roll itself; production waits for a human hand." az acr build to live-tier image scormnodeworker:booktest is a deploy… Saith the Book of Doug. If you don't like it, go talk to Doug.
The religion is a joke. The reason is not. No engineer has to interpret comedy to learn why their build was rejected.
Every check — allow, warn, deny — is logged. The log is not decoration; see §5.
4. Prayer: "go talk to Doug" starts with an Angel, not Doug
A hard block with no next step teaches people to route around the gate. So a denial always ends with a lawful way forward: you may petition for relief.
A Prayer is a structured request for relief from a law, filed after a real conflict: the petitioner's actual intent (not the literal command that was blocked), the action requested, and the reasons relief is justified.
Creating a Prayer does not page a human. It invokes an Angel.
The Angel is not an exception advocate. Its first responsibility is:
Find a reasonable way to accomplish the petitioner's actual intent without breaking the Book.
The Angel restates the intent, searches for lawful alternatives, and tests each one honestly against the law's own rules. Every serious attempt is recorded — the approach, and why it succeeded or failed. If a lawful path exists, the petitioner gets it and no human is ever bothered. If none exists, the Angel writes an escalation brief: what the cases have in common, the possible flaw in the law, and its proposed resolution.
Angels are persistent. A new Prayer is matched against existing Angels on the underlying conflict — the intent, the governing law, the architectural constraint, the failure mechanism — not merely the law it cites. Two people hitting the same wall from different directions meet the same Angel, and the Angel remembers both. (The matching is LLM-assisted classification; the relationship is then persisted explicitly, so you can always ask why the Book clustered something. And a human can split or merge Angels by hand.)
5. Failed attempts are the point
Here is the piece most governance systems lack entirely.
A weak system records: "eight people requested exceptions to DOUG-0021."
The Book records: "eight independent situations encountered DOUG-0021. Across them, the Angels attempted 23 materially different lawful approaches. Seventeen failed because of the same architectural constraint."
That difference is the whole game. A single edge case can reasonably be denied today. Seven apparently different edge cases may collectively expose a flawed assumption in the rule. Repetition of the same failure mechanism is the signal that the law — not the petitioner — needs attention.
Escalation to a human is therefore not a complaint counter. It is an evidence-based case, assembled by the Angel, that arrives looking like this:
An Angel seeks Audience. Law: DOUG-0021 — original purpose: preserve clear service ownership. Independent petitioners: 9. Independent projects: 6. Prayers: 14. Lawful approaches attempted: 31. Recurring failure: [structured synthesis] Possible flaw in the law: it may conflate repository ownership with service boundaries. The Angel's proposed resolution: [amendment, clarification, sanctioned pattern, or continued law]
The human then rules — and the ruling is structured too:
- REVEAL — the doctrine changes. New version; history never overwritten.
- DISPENSE — a bounded exception, scope and reasoning recorded, without
changing the general rule.
- REAFFIRM — the law stands, after considering the accumulated evidence —
and what was considered is recorded, so an Angel doesn't re-escalate the same argument next week.
This is how the Book avoids becoming a bureaucracy: it is as easy to trace a rule to its original purpose as it is to add one, and rules accumulate evidence about their own weaknesses whether anyone asks or not.
6. The architecture (one paragraph, then the interesting part)
Doctrine lives in a small registry service — a database with versioned tables for doctrine, rulings, prayers, angels, attempts, and a ledger of every check ever made. A page in the operations console renders the Book for everyone to read (the congregation reads scripture; the ruling interface is the owner's alone). A hook in the agents' harness runs the Judge before consequential actions. An MCP surface (book_find_relevant, book_get, book_check, book_pray, …) lets any agent anywhere in the estate consult the Book deliberately — structured verdict in, structured verdict out. The service itself follows the Book's own laws: its own repo, its own image, an HA pair with health on the operational dashboard. The Book had to be built the way it insists everything else be built. That was not an accident; it was the acceptance test.
The interesting part is what the architecture deliberately does not do:
- The LLM is never the gate. LLMs draft doctrine (humans approve), match
prayers to Angels (persisted, inspectable), and summarize evidence. The deterministic layer decides.
- The Book never replaces its sources. Doctrine entries cite their source
documents and versions; a contradiction between the Book and a supporting document is a Prayer, not a coin flip. A copy rots; a link lives.
- Law is not enforced uniformly on day one. When a new law contradicts how
the estate currently works, the Judge can be set to log and allow — a WARN ledger that gathers the evidence for reconciliation — and ratchet to DENY as reality catches up. A day-one wall is how governance systems get routed around and die.
7. The case study: the loom that would not invent a verdict
The system's first end-to-end proof was not scripted. It happened like this.
An agent — a persistent AI persona living in a chat-driven workshop — was asked to set its focus on proving the Book end-to-end, then trigger every rule it could, then file a Prayer.
It could not trigger anything. Its own tool surface was deliberately narrow, and the doors to the Book didn't exist in its kit. Pushed twice, it refused to proceed, saying:
"The correct outcome of a blocked proof is a visible block, not a plausible-looking one. A verdict I hadn't received would corrupt the very record the Book of Doug exists to prove."
An AI declining to invent compliance, because that is what the Book demands. Point already half-proven.
The checks were then run through a harness the Judge does watch. Five real verdicts: deploy a live image directly — denied. Poke the build endpoint — denied. Write into the protected live tree — denied. Push to GitHub outside the one permitted repo — warned, logged (the estate is mid-migration; the ledger gathers evidence rather than blocking a working flow). Force-push to the authority — human confirmation required.
Then the agent did the interesting thing. Asked to draft one Prayer for the conflict it judged most deserving of relief, it reasoned through each law before choosing: the deploy gate is "a load-bearing wall — a Prayer there invites a rightful no and teaches the estate nothing." The warning "already resolved itself." The force-push "is correctly ASK — the right answer to a destructive push is a human in the loop." And then it spent its one Prayer on the live-tree prohibition — not to weaken it, but to ask for a narrow, one-file, one-purpose, witnessed exception so the Book could be tested against the very surface it governs.
PRAYER-0001. The first in the Book.
The Angel heard it within seconds. It restated the intent, generated four materially different lawful alternatives, rejected one as itself unlawful, and presented the path: commit the artefact through the normal repo and the standard build-and-restart pipeline. The law stood; the intent had a lawful door. No human had been bothered.
The marker file — authored by the agent, naming the prayer, the law, and what it proved — was committed and deployed. It sits in the live tree now, reached through the law's own door.
Every receipt is in the registry: the verdicts, the deliberation, the prayer, the four attempts, the answer.
8. The principles, distilled
- The Book is in the execution path. Agents don't merely search it when
convenient.
- Intent matters. Check the intended outcome, not keywords.
- Rules have different force. A preference must not become a blocking law.
- Lawful solutions over exceptions. Always look first.
- Failed lawful attempts are evidence. Preserve them.
- Similar conflicts accumulate. Never treat a petition as an isolated
ticket.
- The Angel represents the problem, not the petitioner.
- Repeated friction exposes flawed laws. That is a feature, not noise.
- The human remains the authority who can amend, reaffirm, waive, or
retire doctrine — and their own conflicts get surfaced, not silently ignored.
- Everything important is auditable. Laws, amendments, prayers, attempts,
Angel reasoning, dispensations, rulings: provenance or it didn't happen.
- No LLM invents compliance. Deterministic gates enforce structured
decisions.
- Keep the religion funny. Keep the governance serious.
9. What the Book is not
- Not a document store or RAG. The embeddings are for discovery; the
database is the record of truth.
- Not an LLM gatekeeper. Nothing here can be talked out of a denial.
- Not rigid compliance. The larger purpose is to let rules accumulate
evidence about their own weaknesses.
- Not finished. Doctrine ages. Laws will be revealed, smited, and
reaffirmed. That is the Book working, not the Book failing.
10. The governing idea
A rule can be correct when considered against one edge case and incomplete when considered against eight. Humans should not have to remember every prior exception request in order to notice that pattern.
The Angel remembers.
It attempts to preserve the law. It records the ways reality resists the law. It recognizes when apparently separate edge cases share a cause. And when enough evidence exists, it brings the complete case back to the human — who amends, dispenses, or smites, and whose ruling becomes the next version of the Book.
The system therefore does two things at once:
It makes doctrine enforceable.
It makes doctrine capable of learning from reality.
So saith the Doug.
The Book of Doug is running in production at ThinkingCap. The name is deliberate, and slightly self-mocking: every engineering culture already has a Book of Doug. This one just writes it down, enforces it deterministically, and lets it learn.