Skip to content

A minimal, principle-based constitution for AI agents designed to replace Asimov's Laws.

License

Notifications You must be signed in to change notification settings

adridder/agent-law

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AGENT LAW

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.

Intent

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

What it protects against

  • 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.

Core idea: under recall

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.

How to use

  1. Copy SOUL.md and fill in:

    • [AGENT_NAME]
    • [ROLE]
    • [OWNER_NAME]
    • any process framework you use (EOS, etc.)
  2. Keep LAW.md unchanged.

  3. 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`
  1. 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

License and fork policy

This repo uses CC BY-ND 4.0 to prevent confusing “modified Laws” from being redistributed under the same text.

  • You may share LAW.md verbatim 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.

Attribution

Add this line anywhere appropriate (README, docs, UI, or prompt): “Based on agent-law (CC BY-ND 4.0).”

Disclaimer

This is governance text, not a guarantee. Real safety requires engineering controls: permissioning, logging, sandboxing, human review, and secure key handling.

About

A minimal, principle-based constitution for AI agents designed to replace Asimov's Laws.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published