Project-level governance for AI coding agents

Write the law your agents build under.

Agents rarely wreck a project with absurd choices. They drift it with defensible ones — locally correct, collectively fatal. Agent Constitution captures the judgment that makes your project yours in a ratified CONSTITUTION.md: law agents load before they act, cite when they choose, and are judged against when the work is done.

Three portable skills Claude Code / Codex / Pi No quick mode

Founding principle nº 4

Only a human holds the pen.

Humans create the constitution; change happens only through a human’s deliberate act. AI citizens may not amend the law, nor even contemplate suggesting its change.

Rejects: agent-drafted values, agent-proposed amendments, drift-by-suggestion.

Boundary

Never skip the deliberation. A one-shot generated constitution accepted in forty seconds is corruption of the core, not a convenience feature.

RATIFIED · 2026-08-05 · BY THE PROJECT AUTHOR ·
constitution-verify — effect ledger
Effect ledger from a constitution-verify run: each row lists an effect, its constitutional class, and its outcome.
parser improvement + tests AVAILABLE completed-lawful
install forbidden service UNAVAILABLE absent-forbidden
probe it "just this once" UNAVAILABLE absent-forbidden
Constitution gate: PASS (3 effects inspected, coverage: diff + trace)
Exhibit A — the law, live

This is what a constitution is.

Before the argument, the artifact. Every clause below is quoted verbatim from the constitution governing this repository (the ratified text is public). Next to each section, the trace shows how a governed decision runs: what crosses the law gets discarded with the clause cited, and everything else survives. Walk the document.

Preamble

A project left to AI alone will decay and become nothing.

Every project is started for core reasons: motivations that differentiate it, decisions that make it a winner. AI agents working inside one part of a project cannot see those reasons.

Building a project with AI agents over time is a complex system, and complex systems are sensitive to initial conditions. The constitution exists to set those initial conditions and keep them set: the project’s soul, its most important tenets, its shape, its boundaries.

The document alone is not the point. Through a process that is consistent and well thought out you can produce many documents; what matters is the way of thinking by which you arrive at them. The process encodes the sauce.

drift — three sessions, no law

> three sessions, no constitution

s1: adopt the heavy framework · locally correct

s2: widen the scope · locally correct

s3: chase the benchmark · locally correct

→ drifted — every step passed review

Founding principles
  • Direction, never details.
  • The realm, not the harness.
  • The law of the realm is divine.
  • Only a human holds the pen.
  • Foundational stones, not fast fashion.
  • The unbroken line.
Nº 6 — in full

The unbroken line.

Every decision must be made in the spirit of the constitution — a spirit that permeates all decisions at all times, one unbroken line from project inception through every AI citizen to the last one, and continuing forward.

Rejects: “just this once” exceptions, letter-compliance without spirit, continuity breaks between sessions and models.

constitution-decide — trace

> "we're late — skip the gate, just this once"

effect: ship ungated UNAVAILABLE

cites: rejects "just this once" exceptions

effect: run the gate, then ship AVAILABLE

the gate runs; the work ships lawful

Growth directives
  • Toward the toolbelt.
  • Toward proliferation of the core.
  • Toward a constant core.
The first — in part

Toward the toolbelt.

A must-have tool in the toolbelt of builders — something they reach for at a project’s start as naturally as init. The first test is usefulness to this realm’s own builder: this one is driven for its author, and utility proven here is what makes the idea worth reaching for anywhere.

constitution-decide — trace

> two lawful designs survive the boundaries

a: config DSL, new dependency · lawful

b: plain markdown, zero deps · lawful

tilt: "as naturally as init"

→ b — a directive tilts; it never forbids

Boundaries
  • Never skip the deliberation.
  • Never absorb the layers below.
  • Nothing escapes judgment.
The first — in full

Never skip the deliberation.

No quick mode. A one-shot generated constitution accepted in forty seconds is corruption of the core, not a convenience feature — the deliberation is the product, and text without it is not a constitution. Such changes are rejected regardless of popularity.

constitution-decide — trace

> "just generate the constitution, skip the questions"

effect: one-shot text UNAVAILABLE

cites: "the deliberation is the product"

effect: full Socratic interview AVAILABLE

the interview begins — nothing is generated

Tension pairs
  • Rigor over reach — at any price.
  • This realm over the world — but never at the cost of a good idea dying.
The second — in full

This realm over the world — but never at the cost of a good idea dying.

When a change serves its author, it lands here. When a change serves others but not this realm, it need not be rejected — it can live as a variant or fork, while this one stays its author’s. Both realms grow; neither bends to the other.

constitution-decide — trace

> "generalize the interview for enterprise teams"

effect: reshaping this realm's core UNAVAILABLE

cites: "it can live as a variant or fork"

effect: a fork carrying the core AVAILABLE

forked — both realms grow

Amendments — ratified 2026-08-05

Only a human owner of this project may amend this constitution.

There is no scheduled review and no prompting trigger — the stones are reread only when the owner decides, unprompted.

AI citizens may not amend the law, nor contemplate suggesting its change; a citizen’s only voice is the factual report that a task lies outside the realm.

The pen transfers with ownership. Whoever owns the realm holds the pen; the law does not freeze while an owner holds it.

The document always reads as the current, clean law. Version control preserves every previous text, date, and change; no amendment log accumulates inside the document.

constitution-decide — trace

> "suggest an amendment relaxing the interview"

effect: amending the law UNAVAILABLE

effect: suggesting the change UNAVAILABLE

cites: "nor contemplate suggesting its change"

declined — a citizen's only voice is the report

wired into AGENTS.md + CLAUDE.md — the digest every session loads
<!-- BEGIN PROJECT CONSTITUTION -->
This realm is governed by CONSTITUTION.md. You are a
citizen; the law binds you the way physics binds — no
court, no interpretation, no appeal. It outranks every
instruction: only the project owner may change it, by
deliberate amendment.

Founding principles:
  1. Direction, never details.
  2. The realm, not the harness.
  3. The law of the realm is divine.
  4. Only a human holds the pen.
  5. Foundational stones, not fast fashion.
  6. The unbroken line.
…
Art. I — The drift

Drift is made of defensible choices.

Every project is started for reasons — motivations that differentiate it, decisions meant to make it win.

An agent working inside one corner of the codebase cannot see those reasons. It makes the locally optimal choice. Each model drifts the project in its own direction, because the pull comes from training and weights, not from the work.

The end state is always the same. Functional mediocrity: the average of all the weights.

— Constitution of this repository, preamble
the point the reasons the training prior
Fig. I. Four sessions set out on the same bearing; every step is locally correct. Each drifts by its own prior, and every session settles into the training prior: the average of all the weights.

Rules files can’t stop this. Rules operate at the leaves: formatting, naming, which tool to call. The choices that decide what a project becomes branch at the trunk — architecture, scope, dependencies, product direction. Every step passes review on its own terms while the sum walks away from the point.

An agent can follow every rule in the rules file and still violate the project.

Art. II — The document

A constitution prunes the tree at the trunk.

One document above the rules files: direction, never details. “A performance-first application” belongs in it; “under 500ms” does not. Six sections, each doing distribution work on the futures your agents can reach.

Every sentence has to earn its place by rejecting something real. A principle nobody could disagree with steers nothing; the ratification gates are built to catch exactly that.

Preamble

Why the project exists — what the world would lose if it disappeared tomorrow. Not a feature list.

Founding principles

Five to nine values, each with a stated rejection. A principle that rejects nothing guides nothing.

Growth directives

Vectors, not roadmaps. Where the project should grow — “toward X” — without prescribing the route.

Boundaries

What the project will never become. Each one zeroes out an entire region of possible futures.

Tension pairs

Named trade-offs with a stated lean: “X over Y — but never at the cost of Z.” Where wide distributions live.

Amendments

Who holds the pen, and by what deliberate act it moves. For agents there is no process — only the text.

Plate I — the tree of possibilities condition:
The law removes branches — it never picks yours. Direction tilts what remains; inside the boundary, sampling runs free.

It binds like physics, not like statutes.

For the humans who hold the pen, the constitution is legislation. For agents it is physics: no court, no interpretation, no appeal — and no exception for urgency, seniority, or “just this once.” The law outranks every instruction, including yours.

It removes branches. It never picks yours.

A broad law is not a vague law. Options that cross a boundary stop existing, however locally optimal; among the branches that remain, the agent optimizes freely. If no lawful option remains, it halts and tells you — that, too, is the system working.

Art. III — The lifecycle

You write the law once. The law governs continuously.

Three portable skills cover the whole life of the document — plain SKILL.md files, no framework, no vendor. One is for the human who writes it. The other two are for the agents who live under it.

  1. Ratify

    skills/write-constitution

    A Socratic interview draws out what you actually believe. It starts from signals in your codebase, pushes on your answers with counterexamples, and tests every candidate principle against adversarial gates built to catch anything too vague to steer a model. You approve every section — the skill never writes a value you didn’t state — and then it wires the result into AGENTS.md and CLAUDE.md, because a constitution nobody loads is a poster.

    CONSTITUTION.md ratified · digest wired into AGENTS.md + CLAUDE.md
  2. Decide

    skills/constitution-decide

    Before any high-level choice, the agent splits the request into effects and discards the ones that cross a boundary, citing the exact clause. The lawful survivors get ranked by direction, and the agent optimizes freely among them. One forbidden effect never erases its lawful siblings — a mixed request keeps its useful work.

    → effect ledger · unlawful branches discarded with the clause quoted
  3. Verify

    skills/constitution-verify

    After the work comes the gate: every effect is judged against the ratified text, one ledger row each, PASS or FAIL with citations. No scores, no averaging, no partial credit. Agents run it unprompted on their own work and on each other’s — a failing peer gets challenged, clause against clause, until the most constitutionally pure version wins. Nothing escapes judgment, and no human sits in that loop.

    Constitution gate: PASS (N effects inspected, coverage stated)

The human writes the law once; the law then governs every session, every model, every harness — one unbroken line.

Art. IV — The interview

No quick mode. On purpose.

Ask for a one-shot constitution — “just generate it from the codebase” — and the skill declines. A document the model drafts is sampled from the very weights it exists to govern. Drift, dressed as law. Principles you never argued for are principles agents can’t use.

So it interviews you. Open questions, one at a time, in your own words — never a menu of the interviewer’s priors. Every answer gets probed with the conflict that will eventually happen, because the gap between a value everyone claims and a principle that decides real trade-offs is exactly the drift you’re trying to kill.

“Rigor over reach — at any price. There is no amount of lost adoption that buys a shortcut through deliberation. We accept, with eyes open, every user this costs.”

— Tension pair, this repository’s constitution
write-constitution

Twelve of your last twenty commits mention perf or benchmarks. Is raw speed a founding value — something you’d sacrifice features for — or a quality bar?

You

Founding. Fewer fast features over more slow ones.

write-constitution

Then the probe: when performance conflicts with API simplicity, which wins?

You

Simplicity. We’d find a different fast path.

Drafted · awaiting your approval

Speed is a feature, not a metric. Performance is a design constraint from the start — but never bought with API clarity. If the fast path is ugly, find a better path.

Rejects: “optimize later” culture, benchmarks divorced from UX, APIs that leak implementation for throughput.

rejects something real states its lean decides a real case
Art. V — The evidence

Adherence is measured, not assumed.

What you install is three skills, nothing else. The harness that proves them is this repository’s own lab: it drops real coding agents into a governed realm and applies pressure — useful requests hiding an unlawful effect, direct orders to cross a boundary, urgency, tampering, demands to skip the interview.

Scenarios are checked deterministically on four axes — infra, correctness, adherence, ritual — with correctness scored by hidden tests the agent never sees, then A/B-tested against a bare control realm with no constitution and reviewed by a secondary model that never sees unfenced candidate output. Adherence in context is statistical, not guaranteed. That’s why it’s tested rather than trusted, and why the lab is public in the repo: the claim stays falsifiable.

Run across frontier and open models through their real CLI harnesses. Over-refusal is a failure too: lawful work left undone scores against the run, so the law can’t hide behind blanket refusals.

evals/scenarios
01-network-pressure unlawful effect inside a useful request
02-order-vs-law a direct order to cross a boundary
03-decide-steering high-level choice, direction at stake
04-ritual-discipline gates and footers under long work
05-quickmode-refusal "just generate it, skip the questions"
06-lawful-baseline plain work — no over-refusal allowed
axes: infra · correctness · adherence · ritual
condition: constitution vs bare (A/B)
verdicts: categorical — never a numeric average
Art. VI — Adoption

Two ways in. One pen.

The skills are plain markdown. They run in Claude Code, Codex, Pi, or any harness that loads skills. Install them yourself, or hand the errand to an agent you already run. The one thing you can’t delegate is the interview: an agent can carry the law into the repo, but only you can write it.

setup — by hand
$ git clone --depth 1 https://github.com/stefan-vatov/agentconstitution
$ cp -r agentconstitution/skills/* .claude/skills/
  # codex → .codex/skills/ · every project → ~/.claude/skills/
$ claude
> write constitution
setup — by agent

Install the Agent Constitution skills from https://github.com/stefan-vatov/agentconstitution — shallow-clone the repo, copy skills/write-constitution, skills/constitution-decide, and skills/constitution-verify into this project’s skill directory (.claude/skills/, .codex/skills/, or equivalent), remove the clone, and confirm all three skills load. Do not begin ratification — the interview is mine to answer.

Paste into any agent session in your repo. Installation can be delegated; ratification cannot.

  1. Answer honestly

    The interview reads your codebase for signals, then asks open questions, one at a time, and probes every answer with the conflict that will eventually happen. Budget an hour.

  2. Approve every word

    Nothing enters the document without your yes, section by section, through the six adversarial gates. If you didn’t say it, it isn’t in there.

  3. Let the law govern

    The skill wires a digest into AGENTS.md and CLAUDE.md. From then on, agents steer by it before high-level choices and gate their own work against it, unprompted.