The mechanic: every governance rule must compile to a deterministic artifact (lint script, CI gate, cron check, or schema constraint). If it cannot compile, it is prose, not policy. Prose is theater.
This repository is the open-source seed of the methodology we use at Shinrong Technology to govern our AI-driven company. We have spent three years refining it. We are open-sourcing the mechanic — not the company-specific rules — because we believe the methodology should become the default for any organization deploying AI at scale.
Read the full argument: MANIFESTO.md.
constitution-toolkit/
├── RULES.md # Example constitution: 8 redlines + 2 product rules
├── scripts/compile-rules.mjs # The compiler — parses RULES.md, emits artifacts
├── .github/workflows/
│ └── rule-enforcement.yml # Demo PR gate that runs the compiler and validates
├── examples/ # Three case studies (real incidents, real compiled rules)
│ ├── example-01-audit-trail-rl7.md
│ ├── example-02-forbidden-words-adr-037.md
│ └── example-03-cycle-gate-15i.md
├── MANIFESTO.md # The article: "Why your AI governance is theater"
├── CONTRIBUTING.md
├── LICENSE # MIT
└── README.md # This file
The toolkit is text-first and forkable. There is no GUI, no hosted service, no plugin protocol. The compiler is one file. The schema is one Markdown file. The demo workflow is one YAML file.
# 1. Fork or clone
gh repo fork SINGRONG-Technology/constitution-toolkit --clone
cd constitution-toolkit
# 2. Compile the example rules
node scripts/compile-rules.mjs
# 3. Inspect the generated artifacts
ls .compiled/
cat .compiled/rules-manifest.json
# 4. Run the demo gate locally
bash .compiled/check.sh
# 5. Replace the example rules with yours
# Edit RULES.md; keep the schema; replace the bodies.
# 6. Wire the workflow into your CI
cp .github/workflows/rule-enforcement.yml ../your-repo/.github/workflows/Total time to a working compiled constitution for your organization: about four hours, most of which is writing your own rules. The mechanic itself does not need configuration.
Before any rule enters your constitution, run it through these:
- Detection — Can a script detect a violation without a human in the loop?
- Speed — Does the detection script run in under one second on every pull request?
- Exemption — Is there a token-bounded, expiring waiver mechanism?
- Enforcement — Does a violation block merge by default?
Four yeses, the rule compiles. Any no, the rule stays in PROSE.md clearly labeled as not yet enforceable until someone refactors it.
Most AI governance is theater. The 30-to-60-page PDF policy filed in a wiki, signed by an executive, read by no engineers, drifted from production for 18 months — this is the dominant pattern, and it is failing as the AI systems being governed grow more autonomous.
We have run this experiment at our company. Eight redlines, twenty-three working rules, three years of dogfooding. When our auto-backup hook committed work to the wrong branch last week, our forcing functions caught it. Our governance survived contact with our own mistakes.
That is the bar. Anything less is theater.
MIT.
You may fork this, embed it, sell services around it, and never tell us. We ask only that you do not call your fork "constitution-toolkit" without modification, to avoid confusing the supply chain.
If you cite the methodology in published work, please use:
Shinrong Technology, "Constitution-as-Code: Compiling AI Governance,"
https://github.com/SINGRONG-Technology/constitution-toolkit, 2026.
We do not require citation for commercial use.
Shinrong Technology Co., Ltd. (SR-TEC) Contact: ops@srtec.com