AI Wisdom
🪷Forge Tale IV

The Law That Wrote Itself

A Panchatantra fable about Policy as Code

📖
Story · +20 XP
8 min read · 6 sutras
🎭 The Cast
  • DharmaThe lawgiver — writes rules that apply to every builder equally
  • NirmataThe builder — wants to build quickly, sometimes forgets safety rules
  • RakshaThe guardian — enforces rules automatically, without fatigue or favouritism
  • SamikshaThe auditor — checks compliance across all buildings, past and present
6 sutras~8 minWith reflectionMaps to RAG concepts
Begin the tale
Sutra Pratham
1
Scene 1 of 6

The Kingdom With Good Intentions

The kingdom had good laws. No building was to be built without fire exits. No well was to be dug without a safety barrier. No granary was to be built without a lock. The laws were written on stone tablets in the courthouse. Every builder had, in theory, read them. In practice, builders were busy. They built quickly. They forgot. And the guardian Raksha was only one person — she could not inspect every building before the first stone was laid. The laws existed. The buildings often did not follow them. The gap between law and practice was wide and growing.

⚜ The Moral ⚜
A law enforced by humans scales with the number of humans. A law enforced by machines scales with the machines.
Sutra Dwitiya
2
Scene 2 of 6

Dharma Writes a Different Kind of Law

Dharma the lawgiver proposed an experiment. Instead of writing laws on stone for humans to read and remember, he would write laws in a language the forge itself could read. When Nirmata submitted a blueprint, the forge would check it against Dharma's rules before laying a single stone. A blueprint without fire exits would be rejected. A granary without a lock would fail before the foundation was dug. The law would not wait for an inspector. It would run at the moment the blueprint was submitted. Dharma called these machine-readable laws policies.

⚜ The Moral ⚜
Move the check from after construction to before submission.
Sutra Tritiya
3
Scene 3 of 6

The Levels of Enforcement

Dharma learned that not all rules deserved the same response. Some rules, if violated, should stop construction entirely — a building in a flood zone with no raised foundation was a danger to life. Other rules should warn but allow — a building without a flagpole was suboptimal but not dangerous. He named these levels: Deny, Audit, and Modify. Deny: reject the blueprint outright. Audit: allow the building but log the violation for the inspector. Modify: automatically add the missing flagpole and continue. Nirmata learned which rules were hard limits and which were guidelines. He adjusted his blueprints accordingly.

⚜ The Moral ⚜
An enforcement level mismatched to its rule causes either anarchy or paralysis.
Sutra Chaturtha
4
Scene 4 of 6

The Bundled Initiative

Dharma had, over years, written hundreds of individual policies. Each policy was one rule. But a new province needed to comply with three royal decrees, fourteen fire codes, and six water safety rules. Handing them a stack of a hundred policies was unwieldy. Dharma created initiatives: named bundles of related policies. "Royal Safety Initiative: contains all fire, water, and structural rules." The new province's overseer applied the initiative with one command and was immediately compliant with all twenty-three rules. The province knew exactly which rules applied to them, because the initiative had a name and a document.

⚜ The Moral ⚜
A named bundle of consistent rules is easier to adopt than a pile of individual rules.
Sutra Pancham
5
Scene 5 of 6

The Inspector Who Could Rest

Samiksha the auditor had spent her career walking building sites, checking compliance manually. After Dharma's machine-readable policies took effect, she found her job changed. She no longer checked whether buildings followed the fire rules — the forge did that before the first stone. She now spent her time on the harder questions: Were the rules themselves correct? Had the threat model changed? Were there new kinds of buildings the rules had not anticipated? She became a policy author, not a compliance checker. The machines handled the checking. She handled the thinking.

⚜ The Moral ⚜
Automating compliance does not eliminate the need for human judgment — it elevates it.
Sutra Antim
6
Final scene

The Law That Could Not Be Bribed

There was one more virtue in Dharma's machine-readable laws that no stone tablet had: impartiality. No builder could argue with the forge. No merchant could pay the forge to overlook a missing fire exit. No visiting dignitary could ask the forge to make an exception. The law ran the same for every blueprint, every time. Nirmata complained at first: "It is inflexible." Dharma replied: "It is equal. Flexibility is what courts are for. The forge handles the known rules. The court handles the exceptions." The kingdom built faster, with fewer disasters, and the exceptions that reached the court were real exceptions — not routine rule-bending dressed as exceptions.

⚜ The Moral ⚜
Impartiality is not a limitation of machine-enforced law. It is its greatest virtue.
💡

🪔 Deepak — the lamp of meaning · what this fable means in code

Policy as Code treats compliance rules as executable code that runs against infrastructure before or after deployment. Azure Policy defines rules in JSON that the Azure control plane enforces — deny, audit, or auto-remediate. OPA (Open Policy Agent) with Rego lets you write custom policies for Kubernetes admission, Terraform plans, and API requests. Checkov and Sentinel run policies in CI pipelines, catching violations before infrastructure is created. Initiatives bundle related policies. The effect: compliance is enforced by machines, consistently, at scale — the auditor is freed to write better rules, not manually check existing ones.