Let the constitutional wars begin
Adeel AliJanuary 29, 20268 min readWhat if AI agents followed explicit laws the way constitutional democracies do? This is the case for governed AI software development (we call it Agentic SDLC): a lifecycle where AI agents operate under a constitution, cite the article behind every decision, self-correct against principle, and teach as they build.
When AI agents follow laws, not just prompts
AI coding tools are everywhere. GitHub Copilot, Claude, ChatGPT, Cursor. Every developer has access to an AI that can generate code in seconds. And yet something is wrong.
Teams ship faster but quality drops. Junior developers produce more code and learn less. Technical debt accumulates at a pace we have not seen before. The promise was productivity. The reality, too often, is chaos at scale.
Here is the uncomfortable truth:
AI without principles produces prototype-quality code at production scale. That is not efficiency. That is technical debt at 10x speed.
At ClickChain AI we asked a different question. What if AI agents followed explicit laws the same way constitutional democracies do? We call the approach governed AI software development, or Agentic SDLC: a lifecycle where AI agents operate under constitutional governance, following explicit principles, self-correcting against those principles, and teaching humans as they build.
Two problems, one framework
Our methodology addresses two challenges that most organizations treat separately, even though they are deeply connected.
Problem 1: AI harmlessness. In AI safety research, harmlessness means making sure AI systems do not produce harmful outputs. In software development, harmful outputs include buggy code, security vulnerabilities, architectural violations, untested features, and technical debt. Traditional approaches catch these after the AI generates them. We prevent them before generation by giving the AI explicit laws to follow.
Problem 2: adoption at scale. How do you get 50 teams, or 500, or 5,000 developers to follow the same practices? Documentation goes unread. Training is quickly forgotten. Code review comes too late. We solve adoption by encoding the practices into the AI itself. When the AI follows constitutional laws, every developer working with it inherits those practices automatically.
Constitutional AI addresses both at once. Harmlessness through principles. Adoption through AI-mediated enforcement.
The science behind it
In December 2022, Anthropic published a deceptively simple idea called Constitutional AI: instead of guessing at every bad output an AI might produce, hand it a set of principles and let it grade its own work against them. Elegant on paper. We wondered what it would do to a codebase.

We adapted that research for software engineering. The AI loads constitutional laws before writing code. Every decision references a specific article. The AI self-corrects against the principles. Output becomes consistent and predictable. This is not theoretical. It runs in real work.
The constitution: universal laws, contextual adoption
The framework starts with three base constitutions that define universal laws.
Engineering Constitution, the HOW we build: architecture principles and patterns, code quality standards, testing requirements (TDD, the test pyramid), DevOps and CI/CD practices, security controls, and AI-engineer pairing protocols.
Product Constitution, the WHAT we build: discovery and validation requirements, user journey mapping, roadmap and prioritization frameworks, MVP and product-market-fit criteria, stakeholder practices, and success-metric requirements.
Business Constitution, the WHERE we operate: compliance and regulatory requirements, data governance, privacy and security policies, risk management, audit trail requirements, and business continuity.
These are not style suggestions or a wiki nobody reads. They carry article numbers, section references, and hard requirements. Not guidelines. Laws the agent has to cite before it acts.
Engineering, product, and business are the universal base. The constitution has since grown around them: it now also carries user-experience, financial, and other domain-specific law packs, all governed the same way.
- architecture
- code quality
- testing (TDD)
- CI/CD
- security
- discovery
- journeys
- prioritization
- MVP + fit
- success metrics
- compliance
- data governance
- privacy
- risk
- audit trail
Adoption layers: from universal to specific
Universal laws need contextual application. A React frontend has different implementation patterns than a Java backend, even under the same principle. So the framework adds three adoption layers.
| Adoption layer | What it does | Examples |
|---|---|---|
| Technology stack | translates each engineering law into concrete practice for a stack | Spring and JUnit, pytest and async for FastAPI, React and TypeScript hooks, xUnit for .NET, Jest for Node |
| Industry | layers compliance-specific laws on top without changing base practices | aviation (FAA Part 121, DO-178C), healthcare (HIPAA, HL7/FHIR), financial services (SOX, PCI-DSS), government (FedRAMP, FISMA) |
| Product-type | encodes domain knowledge for your business context | e-commerce checkout, SaaS onboarding and billing, mobile offline-first, enterprise B2B multi-tenant, API rate limiting and versioning |
So "write a failing test first" stops being a slogan and becomes a specific, checkable pattern for your exact stack, industry, and product.
Agent instructions: teaching the AI to follow the constitution
The constitution defines what laws to follow. Agent instructions define how to follow them. The constitution is the law book. Agent instructions are the academy that teaches how to apply the laws in the field.
Calibration, not role play. The agents are calibrated to teach first and generate second: explain the why before the what, guide through questions rather than commands, and hold the line on principle with patience. The point is a development partner that raises the engineer's judgment, not one that quietly replaces it.
The authority hierarchy. Decisions follow a strict priority: constitutional laws are absolute, agent instructions are operational, project rules are contextual, and the current task is the immediate work. Higher levels always override lower ones. A project rule cannot violate a constitutional law.
The guardrails. Constitutional AI needs explicit boundaries.
| Never | Always |
|---|---|
| Write code without a failing test first | Cite the constitutional reference when enforcing |
| Skip complexity verification | Follow the atomic TDD cycle |
| Merge architectural layers | Think in vertical slices |
| Assume requirements (ask instead) | Validate product and business before technical |
| Bypass security controls | Ask on ambiguity |
| Commit secrets | Document decisions |
| Proceed when tests are failing | Keep the build green |
When a guardrail triggers, the agent stops, cites the specific article, explains why the law exists, and guides the developer to the right approach.
How it works in practice
Here is a typical interaction.
Developer: "I need to add a feature to calculate shipping costs."
Agent (discovery): "Before we write any code, let's understand the problem. Per the Product Constitution, we validate user needs before solutions. What journey does this support, and what problem are we solving?"
Developer: "Users abandon the cart because they do not know shipping cost until checkout."
Agent: "Clear pain point. Today: add items, proceed to checkout, see shipping, abandon. Desired: see an estimate early. Accurate?"
Developer: "Yes."
Agent (planning): "Let's write an executable specification, because we specify behavior before implementation."
Feature: Early shipping cost estimation
As a shopper
I want to see estimated shipping before checkout
So I can make an informed purchase decision
Scenario: Display shipping estimate on the cart page
Given I have items in my cart totaling $50
When I view my cart
Then I should see an estimated shipping cost based on my location
Agent (implementation): "Per the atomic TDD law, one behavior at a time. Simplest case: a cart with one item shipping to a known location. Here is the failing test..."
The agent continues, one atomic test at a time, citing articles, explaining the rationale, and teaching principles through practice.
What actually changes
I am not going to put invented percentages on a slide. What I will tell you is the shape of the change teams describe when the constitution is doing its job.
- Defects get caught earlier, because a law mandates test-first development at the atomic level, so every behavior arrives with a test instead of a hope.
- New developers ramp faster, because the AI explains the why behind each decision, so they learn principles while they ship.
- No one becomes dependent, because when engineers work without the AI their competency holds. They have internalized the reasoning, not outsourced it.
The goal we hold ourselves to is amplification, not replacement.
Living laws: the amendment process
Laws that cannot evolve become irrelevant. So the framework includes a formal amendment path: anyone can propose a change, the proposal is opened for discussion, evidence is gathered from real pilots, the change is reviewed, and it is ratified through a governed vote before the constitution is updated and teams are notified. Engineers, product managers, architects, and compliance officers can all propose changes. Everyone bound by the laws has a voice. Laws change through evidence, not opinion.
The wars are coming
I am under no illusion this will be universally loved. Engineers will debate the constraints. Product managers will push back on process. Executives will question the investment. Good. Those debates should happen.

Over the coming weeks I will write about the articles as they get debated, loved, hated, and eventually adopted or amended. The constitutional wars are coming, and that is exactly the point.
Adeel Ali is the founder of ClickChain AI, where teams learn to build production-quality software with AI they can trust.
Reference: Anthropic, "Constitutional AI: Harmlessness from AI Feedback" (2022), arxiv.org/abs/2212.08073
- constitution
- agentic-sdlc
- governance
- tdd



