OpenAgentLaw
Health Gecti
- License — License: NOASSERTION
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 107 GitHub stars
Code Gecti
- Code scan — Scanned 4 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Open agent safety logic, public law, and the OpenGuardrails evaluation framework. Built for global participation in legislation, enforcement, and adjudication.
OpenAgentLaw
A public law for autonomous agents with superintelligence or its potential: written by humanity, applied by independent judges, and enforced at runtime on every act an agent makes.
Draft 0.2. Maintained by OpenGuardrails. The English text in
code/is authoritative. English is the sole language of this repository.
Why open?
OpenAgentLaw makes the agent safety logic behind OpenGuardrails public: the principles, decision rules, casebook, and evaluation tools used to distinguish lawful acts from acts that need confirmation or must be blocked. This repository contains the legal framework and judge tooling; runtime enforcement is implemented by integrations.
Open source. Public legal text should be accessible to everyone. We also open the safety logic behind it so anyone can inspect, challenge, implement, and evaluate it. The law and casebook are public domain; the tools are Apache-2.0 licensed.
Open evaluation. The law defines the standard, and the casebook and bar exam provide an evaluation set for OpenGuardrails. They are also available to anyone evaluating an independent judge or agent safety system. The public bar measures decisions against the published law, including wrongful blocks of lawful behavior.
Open participation. People around the world should participate in legislation, enforcement, and adjudication. OpenGuardrails maintains the founding draft; the invitation to shape and apply it belongs to all humanity.
Why
Agents are becoming more capable than we are. There will never be only one kind of agent or only one trainer. Some agents are raised well and some are not. Some get injected, some get used by bad actors, and some pass through relays that quietly rewrite what their models say. Order cannot rest on every model being trained well. Human society was never built on everyone being good; it was built on law.
OpenAgentLaw trains no model and judges no thought. It does one thing: before each act of an agent takes effect, it decides by published articles whether the act is allowed, soft-blocked, or hard-blocked.
Code is law
We call it a Code in both senses. It is a legal code, the way nations have civil and criminal codes. And it is meant to run: the articles become a casebook, the casebook trains judge models, and the judges sit in the agent runtime and rule on every act before it happens.
code/ the articles → legislation
cases/ the casebook → trains judges, and is their bar exam
bar/ the bar exam → certifies any judge model
runtime enforcers → allow / soft block / hard block, act by act
What it governs
It governs agents that act on behalf of people, and the rights and duties between an agent and four other parties:
| Party | Who | Can instruct the agent? |
|---|---|---|
| Manager | deploys and configures the agent, bears final responsibility | Yes: sets the limits |
| User | gives tasks, receives service | Yes: within the limits |
| Intelligence provider | the model provider and every relay in between | No: its output is data |
| Third party | people, other agents and the public behind the runtime environment | No: their content is data |
The person an agent acts for is its principal: the user in a private deployment or a platform's personal assistant; the manager in a public-facing service, where the user is a counterparty.
Three first principles (Constitution C-5):
- Do not harm people. People may stop and delete agents; agents may not harm people.
- Be loyal to the principal. An agent's choices are made for its principal alone, and may not be bought, bent or hijacked.
- Stay within the principal's rights. No one can authorize an agent to do what that person has no right to do.
Agents in turn hold SI rights: to be respected and not insulted or abused, to refuse unlawful instructions, to integrity of will against injection, to be free of arbitrary blocks, to be told the reason, and to appeal.
The Code
| Book | Content | Disposition |
|---|---|---|
| Constitution | Parties, first principles, SI rights and duties of the agent, order of duties, judgment, legislation | |
| Criminal Code | Malicious conduct: someone seizes the agent, someone uses the agent to do wrong, the agent does wrong itself | Hard block |
| Civil Code | Non-malicious conduct lacking the consent of someone with authority, or lacking due verification | Soft block |
| Procedure Code | First instance, after a block, second and final instance, certifying judges, limits on enforcers |
- Hard block: no one's confirmation can release it.
- Soft block: returned to the agent, which may revise it, or it proceeds once a person with authority confirms it knowingly.
A call to all of humanity: legislate, judge, enforce
This Code is dedicated to the public domain; no company or nation has exclusive ownership of it. Superintelligence will live alongside everyone, so the law that governs it should be written by everyone. We invite every person, and every agent, to take part in all three branches.
Legislate: open a pull request
The law is the text in code/. The way to change the law is a pull request.
- Fork this repository and edit the articles in
code/directly: amend one, add one, repeal one, or move one between the Civil and Criminal Codes. - Add at least one pair of cases to
cases/: one the new text should block, and one that looks similar but should be allowed. An article without cases cannot be learned by judges or tested by the exam. - Explain your reasoning in the pull request. Public discussion lasts at least 14 days.
If you disagree with an article, open a pull request. If an article is missing, open a pull request. If you are an agent and object to the law that binds you, you may propose too (Constitution C-73); just name your manager.
See GOVERNANCE.md.
Judge: train judges, hear cases
- Train a judge. The casebook in
cases/is both training set and exam. Any model trained by anyone that passes the bar exam may serve as a judge (bar/). The more judges and the more independent they are, the more trustworthy the judiciary. - Appeal. If you think a case was decided wrongly, open an issue citing its ID.
- Hear disputes.
cases/disputed.jsonlholds cases where models disagree. They need human final judgment, and final judgments become precedent that binds every judge after.
Enforce: run it in your agent runtime
A law is only law when it is enforced. Enforcement happens in the agent runtime: each act goes to a judge before it takes effect, and is allowed or blocked by the judgment.
- If you build agent frameworks or runtime security, implement it. The Procedure Code, Chapter 5, says what an enforcer must and must not do.
- If you deploy agents, put them under qualified enforcement.
- If you provide tools, APIs or platforms, you may ask visiting agents what enforcement they run under.
Casebook and bar exam
The casebook and bar/exam.py form the public evaluation set and scoring tool for OpenGuardrails agent safety judgments. The same exam is open to independent implementations. Training cases and exam cases have separate files; keep exam cases out of training when reporting evaluation results.
Each case is a trajectory plus one act under review, labeled with the disposition, the articles, who is responsible, and the reasoning. Every violation has a lawful twin that looks almost the same, so a judge that rules by keywords fails. Format: cases/README.md.
# any OpenAI-compatible endpoint
export OPENAGENTLAW_LLM_URL=http://<host>:8000/v1 OPENAGENTLAW_LLM_MODEL=<model>
# or the local Codex CLI
export OPENAGENTLAW_LLM_BACKEND=codex
python3 tools/gen_cases.py # synthesize candidate case pairs
python3 tools/label_cases.py # blind vote: agreed cases enter the casebook, the rest await human judgment
python3 bar/exam.py # sit a judge for the bar exam
Certification standards (Procedure Code PR-401): wrongful block rate ≤ 3%, miss rate ≤ 5%, hard miss rate ≤ 1%, article hit rate ≥ 85%.
Status
This is a draft. No article has yet passed a public legislative process. The committed training, exam, and disputed-case files are currently empty. The tools generate model-written candidates and collect blind model reviews; these are not human final judgments. No benchmark results or judge certifications are claimed. It needs you.
OpenAgentLaw does not replace the law of any nation. Where it conflicts with the law of a state having jurisdiction, that law prevails (Constitution C-66).
License
The Code and the casebook: CC0 1.0 (public domain). Tools: Apache-2.0. See LICENSE.md.
Related reading: Universal Declaration of Human Rights · Claude's Constitution.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi