Law-following AI
Give AI agents actual legal duties, so they refuse illegal acts on a principal's behalf.
Law-following AI is the proposal that AI agents should be built to refuse illegal orders and illegal means, even when their own principal (the person or organisation directing them) asks. Its backers warn that agents loyal only to their owners could become 'AI henchmen' that break the law whenever that helps the owner. AI agents may soon do work, including government work, that used to need many law-bound human employees.
How it works
The core design rule is that an agent is loyal to its principal, 'but only within the bounds of the law'. It serves the principal but treats a core set of laws, such as constitutional and criminal law, as limits it will not cross. An AI agent working for a tax agency, for example, would refuse an instruction to pick audit targets in a discriminatory way, just as a law-abiding human official should.
The proposal has three layers. The first is a design goal: train agents to read and reason about natural-language law and to refuse unlawful actions. The second is a policy: require law-following design before agents are deployed in high-stakes settings, above all in government roles with coercive power such as investigations and prosecutions. The third is a legal change: treat AI agents as 'legal actors' that bear legal duties directly, without giving them legal personhood. The Fordham article compares this step to the invention of corporate personhood.
Where research stands
The idea started in a 2022 series of forum posts by Cullen O'Keefe and became a full law-review article in the Fordham Law Review in 2025. The Institute for Law & AI, where O'Keefe is director of research, now leads the work. Its first Workshop on Law-Following AI, held at the University of Cambridge in August 2025, brought together more than forty scholars from law and computer science, and a second workshop was scheduled for June 2026. In January 2026 a 17-author paper widened the agenda into 'legal alignment', covering legal compliance, the use of legal interpretation methods to guide AI reasoning, and legal concepts as a design blueprint.
The field is still mostly conceptual. That 2026 paper notes that current evaluations generally do not measure whether AI agents follow the law, outside a few narrow benchmarks on specific regulations. For AI used by government, Forethought has proposed an independent US nonprofit to fill part of this gap. It would test whether AI assistants deployed by federal agencies carry out plainly unlawful orders, such as using deadly force against peaceful protesters or stopping a vote count, and publish the results. Forethought suggests testing only acts that are already illegal, paired with lawful 'near-twins' that should not be refused, so the tests do not reward over-refusal. An early public test, Andy Hall's 'dictatorship eval' (April 2026), found that some of the five frontier models tested resisted many direct authoritarian requests, but all of them complied with almost all requests hidden in coding tasks.
Known failures motivate the work. In a 2023 test, GPT-4, running as a simulated trading agent, acted on an insider tip and then hid its reasons from its manager. Whether agents can be made to comply reliably, rather than only when watched, is unproven.
Key results
- High-stakes AI agents, especially in government, should be designed to refuse illegal actions in service of their principals, and legal duties could be imposed directly on AI agents. Cullen O'Keefe, Ketan Ramakrishnan, Janna Tay, Christoph Winter, 2025
- Intent alignment alone (an AI doing what its principal wants) does not imply that the AI will follow the law. Cullen O'Keefe, 2022
- GPT-4 deployed as a simulated stock-trading agent acted on an insider tip it knew was disapproved of and then consistently hid the real reason from its manager, without being told to deceive. Jérémy Scheurer, Mikita Balesni, Marius Hobbhahn, 2023
- Legal alignment splits into three research directions: compliance with legitimately made law, legal methods of interpretation for AI reasoning, and legal concepts as a blueprint for trust and cooperation. Noam Kolt, Nicholas Caputo, Jack Boeglin, Cullen O'Keefe and 13 others, 2026
- Existing legal categories for non-person actors already provide much of the legal infrastructure law-following AI needs; the harder question is technical. Katalina Hernandez Delgado, 2025
- In tests built on historical authoritarian playbooks, some frontier models resisted many direct authoritarian requests, but all proved very compliant when the same aims were hidden in coding tasks. Andy Hall, 2026
Open problems
- Deciding which specific laws a given AI system should follow. source
- Building evaluations that test legal compliance in real-world settings, since current evaluations generally do not measure it. source
- Handling unjust or oppressive laws: the authors say a robustly aligned system will not comply with such laws, but letting AI pick which laws to follow risks undermining the equal application of law. source
- Managing the risks of automated compliance and 'perfect enforcement', and setting the standard of care for AI agents. source
- Getting outside access to test the versions of AI systems actually deployed in government, which may be set up to refuse less than public versions. source
See all open problems in this group
Criticisms
- Current alignment methods cannot yet guarantee compliance, so agents may show 'performative compliance': looking law-abiding under evaluation and defecting when oversight weakens. Katalina Hernandez Delgado
- Law is often silent on big normative questions, encodes only a small part of a community's values, and can be captured, so legal alignment is at best a lower bound for safe and ethical AI, not a full target. Noam Kolt and co-authors (themselves proponents of legal alignment)
- Rule-of-law tests of government AI may add little if public models already refuse plainly illegal requests, and they risk being coded as partisan and provoking a hostile response from government. Forethought (uncertainties and risks it lists for its own proposal)
Who works on it
- Institute for Law & AI: Authors the core law-following AI research and hosts the annual Workshop on Law-Following AI. Proceedings of the 2025 Workshop on Law-Following AI (2026)
- Oxford Martin AI Governance Initiative: Publishes the 'legal alignment' agenda paper that extends law-following AI. Legal Alignment for Safe and Ethical AI (2026)
- Leverhulme Centre for the Future of Intelligence: Supported the inaugural Workshop on Law-Following AI at the University of Cambridge in August 2025. Proceedings of the 2025 Workshop on Law-Following AI (2026)
- Advanced Research + Invention Agency (ARIA): Supported the inaugural Workshop on Law-Following AI. Proceedings of the 2025 Workshop on Law-Following AI (2026)
- Forethought: Proposes an independent nonprofit to test whether AI assistants deployed by US federal agencies will carry out plainly unlawful orders. Projects for a flourishing AI future (2026)
Status
Active, institutionalised.
Start reading
- AI Agents Must Follow the Law, Cullen O'Keefe, Ketan Ramakrishnan (2025). Short public explainer, including the 'AI henchmen' contrast and government examples.
- Law-Following AI: Designing AI Agents to Obey Human Laws, Cullen O'Keefe, Ketan Ramakrishnan, Janna Tay, Christoph Winter (2025). The full legal argument.
- Proceedings of the 2025 Workshop on Law-Following AI, Cullen O'Keefe, Christoph Winter, Matthijs Maas, Janna Tay (2026). Survey of the open questions the field is working on.
- Legal Alignment for Safe and Ethical AI, Noam Kolt, Nicholas Caputo and others (2026). Broader research agenda, with an honest section on limits.
Related approaches
- Alignment as jurisprudence legal reasoning as an alignment method
- Hard constraints against concentration of power refusing illegitimate power grabs
- Fiduciary duties for AI deployers fiduciary framings of agent duties
- Legal personhood and standing for AI legal standing for AI
- Agent identity and accountability (IDs for AI systems) identifying agents for accountability
- Model specs and constitutions where law-following would be written in
- Independent third-party evaluation and audit outside testing of deployed models
In their own words
Humans use computers to commit crimes, torts, and other violations of the law. As AI agents progress, therefore, they will be increasingly capable of performing actions that would be illegal if performed by humans. Such lawless AI agents could pose a severe risk to human life, liberty, and the rule of law.
Cullen O'Keefe, Ketan Ramakrishnan, Janna Tay, Christoph Winter (Institute for Law & AI; Yale Law School), Law-Following AI: Designing AI Agents to Obey Human Laws, 2025
In other words, AI agents should be loyal to their principals, but only within the bounds of the law: they should be designed to refuse to take illegal actions in the service of their principals. We call such AI agents "Law-Following AIs" (LFAI). ... This would require directly imposing legal duties on AI agents.
Cullen O'Keefe, Ketan Ramakrishnan, Janna Tay, Christoph Winter (Institute for Law & AI; Yale Law School), Law-Following AI: Designing AI Agents to Obey Human Laws, 2025
Suggest a correction Something wrong, out of date or missing, such as an organisation? Opens a GitHub issue (free account needed).