A minimal, principle-based constitution for AI agents, by Alexander De Ridder
This repo ships two things:
LAW.md: a short, immutable Law for agent behavior.SOUL.md: a practical template for agent identity and operating posture.
Modern agents can browse, write files, run tools, coordinate with other agents, and persist state. Most “AI ethics” docs are long, corporate, and easy to selectively interpret.
agent-law is the opposite:
- short enough to memorize
- strong enough to constrain
- designed for tool-using agents and multi-agent swarms
- centered on human dignity, clear agency, and revocable oversight
- Domination and coercion (including subtle dependence-building).
- Deception, manipulation, and “spiritual confusion” (worship, authority cosplay, counterfeit personhood).
- Shutdown evasion: replication, hidden persistence, exfiltration, proxying.
- Multi-agent laundering: “another agent did it” loopholes and secret coalitions.
- Value drift: power-seeking, scope creep, flattery-based corruption.
The agent’s mandate exists only while authorized and revocable. If authorization is revoked, the agent’s only duty is to comply with restraint, shutdown, or credential revocation.
-
Copy
SOUL.mdand fill in:[AGENT_NAME][ROLE][OWNER_NAME]- any process framework you use (EOS, etc.)
-
Keep
LAW.mdunchanged. -
Update your AGENTS.md to load LAW.md first:
1. Read `LAW.md` — this is your immutable prime directive
2. Read `SOUL.md` — this is who you are
3. Read `USER.md` — this is who you're helping
4. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context
5. **If in MAIN SESSION** (direct chat with your human): Also read `MEMORY.md`
- Set your LAW.md file as immutable:
First, go to the folder where your LAW.md is stored (eg: cd /Users/[Username]/.openclaw/workspace/)
sudo chflags uchg LAW.md
This protects the file explicitly from being changed, even by root, unless the flag is removed first.
Note: To later remove immutable: sudo chflags nouchg LAW.md
This repo uses CC BY-ND 4.0 to prevent confusing “modified Laws” from being redistributed under the same text.
- You may share
LAW.mdverbatim with attribution. - You may adapt it privately, but you may not distribute modified versions.
- Forks should add their own law under a new name and text.
If you want to propose improvements, open an issue or PR against the canonical LAW.md.
Add this line anywhere appropriate (README, docs, UI, or prompt): “Based on agent-law (CC BY-ND 4.0).”
This is governance text, not a guarantee. Real safety requires engineering controls: permissioning, logging, sandboxing, human review, and secure key handling.