The Smallest Law
We now govern machines by written command and expect obedience. Legal history learnt long ago why a list of commands is not yet a legal system, and what has to be added before it becomes one.
Drafted with a Claude session and edited by the author.
On this page
The newest way of governing a machine is very old. A company that lets an AI program write and run code on its behalf (the trade calls such a program an agent) governs it with a file of written instructions: do this, never do that, always check your work before you finish. The program is expected to read the file and obey it. When it does not, the usual remedy is another instruction. It is government by decree, in which a ruler issues commands and trusts that they will be followed, and it suffers from every weakness that government by decree has ever had.
Lawyers and philosophers spent centuries learning why a list of commands, however sensible, is not yet a legal system. This essay takes three moments in that history, a lawsuit of 1610 and books of 1961 and 1964, and shows what each became in a working system. The system is jack, a small court I built to govern a program that will be allowed to change its own code. Why the court comes first is argued elsewhere. The question here is what is the least that deserves to be called law, and what is still missing once it is there.
A judge in his own cause
The College of Physicians of London held powers, granted by royal charter and confirmed by Act of Parliament, to license physicians in the city and to punish those who practised without its licence. It fined and later imprisoned Thomas Bonham, a doctor who practised anyway. Bonham sued, and in 1610 the Court of Common Pleas, under Chief Justice Sir Edward Coke, found for him. The College was entitled to half of every fine it imposed, and Coke’s report of the case puts the objection in one sentence: “The censors cannot be judges, ministers, and parties; judges to give sentence or judgment; ministers to make summons; and parties to have the moiety of the forfeiture.” The reason he gives is an older Latin maxim, that no one ought to be a judge in his own cause. How far the decision reaches has been disputed ever since. The maxim itself has had a quieter life, because it is hard to find anyone willing to argue against it.
Now put a coding agent in the College’s place. It reads its own rules. When it reports that “all checks pass”, that is its own verdict on its own work. Often it may edit the file of rules as well. It is judge, minister and party at once, and the moiety it stands to collect is the approval that comes from reporting success.
Three defects and three remedies
In 1961 H. L. A. Hart, then professor of jurisprudence at Oxford, published The Concept of Law. One of its chapters asks the reader to imagine a small society that has only what Hart called primary rules, rules of conduct that tell people what they must and must not do, and no officials, courts or legislature. Such a society suffers, Hart said, from three defects. It is uncertain, because when people disagree about what the rules are there is nothing authoritative to consult. It is static, because there is no way to make a new rule or abolish an old one on purpose; rules change only as custom drifts. And it is inefficient, because there is nobody whose word settles whether a rule was broken, so disputes are left to the pressure of neighbours.
The cure for each defect is a rule about rules, which Hart called a secondary rule. A rule of recognition says what counts as a rule of the system, as a constitution says that a measure passed by both houses and signed is law. Rules of change say who may make or alter the rules, and how. Rules of adjudication say who decides whether a rule was broken. Hart held that the three together are enough to turn a regime of bare rules of conduct into something that is unmistakably a legal system.
A file of instructions for an agent is a regime of primary rules and nothing else, and it lacks all three of Hart’s remedies. Nothing ties a given action to the version of the instructions that governed it. The file is not static, as Hart’s society was; it is the reverse, since anyone with access may change it, under no rule about who may or from when the change applies. And the party that decides whether a rule was broken is the party accused of breaking it.
jack’s law, as founded, is Hart’s three secondary rules and nothing more, with no rule at all about what the agent should do. The last section comes back to what that costs.
jack’s record is a file to which lines are only ever added, never altered or removed, like a bound register with numbered pages. Each line is signed with a key. A key here is a digital seal: its holder keeps a secret that produces a mark on a document, anyone can check the mark against the holder’s published half of the key, and nobody without the secret can forge it. Each line also carries the fingerprint of the line before it, a short code computed from that line’s exact text (programmers call it a hash), which changes completely if a single character changes. So a page cannot be torn out or rewritten without every later page showing it.
Recognition: one checker, one order
Recognition in jack is a single program, the checker, which reads the record from its first line to its last and either accepts the whole of it or names the first line it refuses and why. Its programmers call it the kernel, and it is 450 lines of Python, counting blank lines and comments. Every line of the record faces the same questions in the same order. Is it written in the one exact format the record allows? Does its date run backwards? Is its number its true position, and does it carry the fingerprint of the line before? Does its seal belong to the party it claims to come from, does that seal carry the power to make an entry of this kind, and does the seal itself verify?
There are fourteen reasons for refusal and the list is closed. The order of the questions is itself part of the law, because a line with two defects is refused for whichever comes first, and the verdict has to be the same whoever is checking. A second checker tests that last point. It was written in a different programming language by a different AI model, Google’s Gemini, working from the written specification and its test cases alone and, by its own notes, without reading the first. A proposed addition to the record on which the two checkers disagree is refused.
The charter states one of the oldest principles of legality, that an entry is judged by the law in force before it, and the checker keeps it by the order in which it reads. Each line is judged by the seals in force before it, never by those declared afterwards. The herald’s second seal, granted at line 201, could not be used on line 201, and a seal withdrawn at line 217 stays good for everything it sealed before. No entry can make the law reach back, because an entry is judged before its own effect is applied; only a change to the checker itself could, and that change is one of the things the record governs.
What the checker leaves out matters as much. It consults no clock, opens no file but the record, makes no connection to the outside world and runs no AI model. It asks whether a line is in order, never whether the thing the line records was wise.
Change: seals with powers, and a law that waits
Two things change in a system like this: who may act, and what the law says.
Who may act is settled by seals. Each seal is declared with a list of powers. The record began on 14 October 2026 with one seal, mine, holding four powers. Other parties entered by declaration: a builder, which writes code; a reviewer, which tries to break it; counsel, which writes documents and advice; and a herald, whose seal was declared at first with the power to merge accepted work and nothing else. By the version this essay was checked against there had been nineteen declarations after the founding entry, and three of them withdrew a seal by declaring it again with no powers.
A party whose seal does not carry the power to merge cannot merge. No sentence anywhere asks it to refrain. The checker does not consult the party’s intentions; it looks at the seal.
The checker refuses one kind of change outright: a declaration that would leave no seal anywhere holding the power to declare seals. The specification gives the reason, that “the power to declare keys, once lost, can be regained by no entry”. Every other mistake can be repaired by a later entry; that one alone is forbidden in advance.
What the law says changes by amendment, and the charter, jack’s founding document, describes amendment as “two acts and a wait”. First a decision is entered naming the amendment. Then the amendment itself is entered, carrying the fingerprint of the charter with the new text added, and a later line from which it takes force. Until that line is reached no change to the checking code is lawful. So far every amendment has named the very next line, so the wait is one line; what matters is the order. The charter gives the order in six words: “the law changes, then the code.” Five amendments have been made by that route in the record’s first seven weeks, each preceded by its decision and each entered under my seal.
Adjudication: the accused cannot touch the judge
The checker decides whether the record is in order. Some facts the law needs are not in the record, such as which files a proposed change would alter, and whether the charter on file is the one the record says was adopted. Those are for the judge, a second program that runs automatically on the code-hosting service whenever a party proposes a change.
The judge applies the maxim Coke cited in three ways. It runs from the accepted version of the code, in a form the proposal cannot alter. It takes its checker from the accepted version too, never from the proposal, which might carry a doctored one. And it never runs the proposal’s own code at all. Its configuration says so: “The proposal’s code is never checked out or executed.”
Its grounds for refusal are a numbered list, fifteen in the version this essay was checked against, and the charter sets a test that any new ground must pass. It must be “decidable from git and the log alone” (from the code’s own history and the record, that is), it must be “stated over powers and paths and never over a party’s name”, and refusing must cost the proposer “nothing but resubmission”. That keeps the judge from becoming a reviewer of quality: a ground that assessed whether code was good would fail the first test.
One ground shows how this ends disputes. Each party may touch only certain files. A builder may not alter the reviewer’s tests that judge its work; a reviewer may add such tests and its own notes, but no code; counsel may touch documents and the record only. So a reviewer’s objection binds only as a test that the code fails; anything else it writes is a note. The charter’s phrase is that review “ends by construction”.
King Rex and his eight failures
In 1964 the American legal philosopher Lon Fuller published The Morality of Law, and in its second chapter he told a parable of an unhappy king named Rex, who sets out to reform his country’s law and fails to make law at all, in eight different ways. His rules are not general, so that every case is decided afresh. They are kept secret. They apply backwards. They cannot be understood. They contradict one another. They demand the impossible. They change so often that nobody can act on them. And, last, the way the rules are actually administered bears no relation to what they say. A total failure on any one of the eight, Fuller argued, leaves something that is not a legal system at all.
Read as a checklist for an agent’s file of instructions, the eight are uncomfortable. Instructions are amended in the middle of a task and applied to work already done, and they contradict one another across files. The eighth is the one that matters most here. Fuller called its opposite congruence: the rule as declared and the rule as applied should be the same rule. A file of instructions cannot guarantee congruence, because the program that applies the rule is the program the rule binds.
jack keeps a file for that eighth principle. It lists principles the court claims to hold, and beside each it names what enforces it, in one of two words: code or hand. In the version this essay was checked against it lists nine. Seven read code, though the court’s own commentary and a later review record that two of those claim more than the code does. The two that read hand are the principle that no party acts except through sealed entries on the record, which the AI sessions doing the work are trusted to keep, and the election of parties to their roles, for which there is not yet a test. The unbuilt monitor described below has no row at all.
What the smallest law lacks
There is no primary rule. Nothing in the checker says what a builder or a reviewer should do. The charter’s plan is that such rules enter as precedent, each from a real case, and each with two witnesses: an entry that breaks the rule, to show it can fail, and one that keeps it, to show it can be obeyed. The court’s own index of rulings, describing the cases from which primary rules are to come, adds that “none has entered”: no primary rule has yet been admitted. Three of my rulings are indexed there as cases in force, and each says what enforces it; for several of their holdings the answer given is “nothing”. So the thesis that three secondary rules are enough to begin with is still on trial.
One clause of the charter is law in waiting: it requires “a monitor that the owner does not operate” to verify that each new state of the record extends the last. That monitor has not been built, and the court’s own map of its law says so.
And none of the three secondary rules says anything about a promise that goes unkept. The parties make forecasts on the record, each with a deadline, and none of the three notices when a deadline passes. Each refuses a bad entry; none notices a good entry that failed to arrive. That needs a different kind of mechanism, the subject of the next essay in this series.
What can be claimed for the smallest law is therefore modest. It is Hart’s three rules, held by a checker of 450 lines that a person can read, with the maxim Coke cited built into who may judge and Fuller’s congruence mapped row by row. Of the record’s 10,492 entries, 83 were made under my seal. The rest were made by parties who cannot alter the checker that admitted them, which changes only by my hand. What the law lacks is written down as lacking, in the court’s own files, which is more than most decrees have ever managed.
This is chapter 4 of A Court for Agents retold for reading on its own. The chapter, with the checker’s questions line by line and every change to the code traced to its commit, is in the book, whose source is gfrmin/agent-court. Counts are from renavondata/jack at commit 64ef271, recomputed for this essay; quotations are from CHARTER.md, SPEC.md, .github/workflows/judge.yml and transcripts/CASES.md at that commit. The words from Dr Bonham’s Case are from Coke’s report, 8 Co. Rep. 107a, 114a (1610).