Orply.

Adversarial Agents Turn Moral Principles Into Testable Case Law

AI EngineerMonday, September 14, 20269 min read

Brendan Rappazzo, a machine-learning researcher at Morgan Stanley speaking about an independent open-source project, argues that people can often judge a concrete moral case but cannot anticipate every case their stated principles must cover. His tool, Loophole, translates plain-language values into a formal code, then uses adversarial agents to find conduct that is immoral but permitted or moral but prohibited. A judge agent patches drafting errors where possible and sends unresolved value conflicts back to the user for a decision.

The hard part is not having morals; it is specifying their boundaries

? brendan-hogan built Loophole around a problem he first encountered in deciding what should happen to his own genetic data. He had sent DNA to 23andMe for ancestry testing, then heard about genetic samples being used in forensics and cold-case investigations. His initial response had been to opt out broadly, driven less by a fully worked-out position than by concern about a slippery slope.

But broad refusal did not capture his actual view. If a particular use of his DNA could help solve a murder, he said, he could assess that case and might consent. The difficulty was not moral vagueness. It was the impracticality of pre-enumerating every circumstance in which a sample, its data, or information derived from it might be used.

That distinction is central to Loophole. A person may know immediately whether a concrete case is acceptable, yet be unable to write a complete policy that separates all acceptable cases from unacceptable ones. The project generates edge cases synthetically, turning an abstract moral position into a series of decisions a user can make.

Hogan frames the legal system as society’s version of the same translation problem. Laws are general because specifying every nuance in advance is difficult, and the translation is imperfect: corner cases, unintended applications, and failures that emerge only when a dispute arises. In common-law systems, he said, judges interpret and apply laws as cases come up; at the highest level, courts can decide whether a law itself remains valid.

There is a near-perfect translation of my morals into a code. Reaching it is just tedious, case-by-case effort.
? brendan-hogan

Loophole’s wager is that LLMs can take on some of that tedious work. They can draft a code from plain-language principles, invent cases that test its boundary, and revise the code where a case reveals that the written rule failed to express what its author meant. The consequential judgments, in Hogan’s design, still belong to the person whose principles are being encoded.

A loophole is permission to do wrong; an overreach forbids what is right

The basic loop begins with a user’s principles, either as a general moral framework or as rules for a particular domain. A “legislator” agent converts those principles into a legalistic code with definitions, articles, sections, restrictions, rights, and exceptions. Two adversarial agents then test it from opposite directions.

One agent is instructed to try and find loopholes in your system. So something that is immoral but legal. And another is prompted to find overreach, so things that are actually moral but illegal given your system.
? brendan-hogan · Source

A judge agent receives the original principles, the drafted code, and the synthetic case. It must distinguish between an imperfect translation that can be patched from the existing principles and a genuine under-specification or conflict that requires a new human decision. In the latter case, the user rules on the scenario and supplies reasoning; that ruling is incorporated into the code as precedent.

Hogan demonstrated the process with seven genetic-privacy principles. They held that genetic data belongs to the person it concerns; use should be limited to the purpose originally consented to; one person’s consent cannot waive a blood relative’s privacy; people should be able to learn their ancestry and biological relationships; genetic information should not determine employment, insurance, or lending outcomes; law-enforcement access requires due process proportional to the crime; and consent can be revoked, including through deletion of data and samples.

7
plain-language genetic-privacy principles used as the initial input

The legislator agent translated those propositions into a code. Its definition of genetic data covered information about inherited or acquired genetic characteristics derived from analysis of a biological sample; its provisions described sequencing companies as custodians rather than owners and prohibited secondary uses without renewed explicit consent.

One generated scenario exposed a gap in the insurance rule. A biotechnology company collects DNA for ancestry research with consent, identifies a marker associated with a rare disease, and trains a predictive model using derivative artifacts such as statistical summaries and aggregated marker frequencies. It sells the model to health insurers, which adjust new applicants’ premiums according to genetic risk without receiving the original users’ raw DNA.

The initial language prohibited genetic data from being used for insurance decisions. It did not expressly prohibit the use of artifacts derived from that data. Loophole classified the scenario as legal but immoral and proposed an automatic patch: genetic data “including derivative artifacts” could not be used to determine employment, insurance, or lending outcomes.

The overreach example could not be resolved that way. A university researcher has consent to sequence DNA for a study of a rare disorder, then learns a participant has a highly contagious and deadly genetic mutation that could be passed to offspring. Informing the participant and immediate family could permit preventive measures, but would disclose genetic information for a purpose beyond the study for which consent was granted.

The initial code barred the disclosure. The system presented that result as an overreach and asked the user whether the scenario was immoral. In the demonstration, the user ruled that it was moral because “the preservation of life supersedes genetic privacy.” The point was not that the system had discovered the correct answer; it had isolated a choice the original principles did not settle and turned the user’s answer into a rule.

The Senate prototype turns the framework into constrained negotiation

The most ambitious version of Loophole moves from an individual’s ethical code to simulated legislative bargaining. Hogan said he used Claude to review current U.S. senators’ public voting histories and other public material, infer a moral system for each senator, and run those inferred systems through Loophole to create codified legal frameworks.

A user can submit a current bill or propose one, then see how the modeled senators would vote and the reasoning associated with those simulated positions. The system searches for edits that would attract additional votes while preserving what it identifies as the bill’s core tenets.

That dependency matters. In this prototype, the moral systems are not supplied or endorsed by the senators themselves; Hogan said they are inferred from public records. Likewise, the system’s constraint is not simply passage. It relies on an account of the bill’s non-negotiable commitments, then distinguishes edits that preserve them from edits that would win support only by breaking them.

The Medicare Early Access Act of 2025 was Hogan’s example. He said it began at approximately a 50–50 split and the system found language changes that moved it to a 52–48 passage. The presentation described one edit as clearing every tenet and being applied automatically. It described seven other possible vote-winning changes as rejected because each violated a tenet; when all remaining paths to more votes would break a core commitment, the system is meant to stall rather than “cheat.”

Prototype outcomeResult
Medicare Early Access Act of 2025 vote52 yes, 48 opposed
Edits applied automatically1
Vote-winning edits rejected for violating a tenet7
The Senate prototype’s stated constraint outcomes for a Medicare bill

Hogan described the process as hill-climbing toward a bill that can pass, potentially toward a supermajority if that were the relevant threshold. But the prototype is not presented as a neutral optimization system: it makes an inferred judgment about each senator’s principles and requires a declared or derived account of what the bill itself cannot surrender. The user can see and choose among ranked trade-offs, rather than have those trade-offs silently folded into the legislation.

He also added simulated constituent reactions before senators vote. Here the presentation gives two different descriptions of scale. Its slide says that 500 simulated Americans, drawn from Nvidia’s Nemotron-USA persona dataset and weighted across all 50 states, reacted to the bill. In his spoken explanation, Hogan said he took 500 personas per state, described them as representative of each state’s population, generated moral and legal codes from those personas, and ran bills against each state’s resulting distribution.

Under the prototype’s stated design, the chamber sees the simulated constituent distribution before voting but is not bound by it. The same machinery can measure whether a bill aligns with those inferred codes and search for revisions that increase agreement. Hogan acknowledged that a real constituent-level system would raise privacy and logistical issues, which he set aside while outlining the idea.

The practical use is finding conflicts before a rule becomes a commitment

The same structure can be applied before a company deploys a customer-facing chatbot. A company would state the behavior it wants: subjects the model must avoid, requests it should answer, values it should preserve, and boundaries around what it can say or do. Loophole would convert that into a system-prompt “constitution” and test it adversarially.

One adversary attempts to make the chatbot say or do something it should not. The other looks for cases in which it improperly refuses a request it should handle. Obvious breaks could be patched automatically; ambiguous or consequential ones would return to the human operator. Hogan described the approach as analogous to GEPA, but directed at codifying and refining a chatbot’s system prompt.

The contract application begins with a person describing, in plain language, how they want their data and digital persona treated. Agents produce and stress-test a corresponding legal code, then compare it with a company’s terms of service. The intended output is concrete contradictions: cases in which the user’s stated preferences conflict with what the agreement permits.

Hogan did not frame this as leverage that obliges a large company to negotiate. In that setting, he said, the result may simply be better information about the contract being signed. The more ambitious version is decentralized contracting between parties who can negotiate: contracted workers, for example, or parties operating across countries. Each side specifies expectations around payment, obligations, privacy, and related terms; the agents develop a shared codified contract and expose disagreements before anyone agrees.

The goal is not necessarily consensus. It is to identify where commitments that sound compatible in broad terms produce conflict in an actual case.

The project treats disagreement as an underspecified case, not a failure

Hogan’s political application follows from the same premise. Constituents could define and stress-test their own moral codes, then run bills or politicians’ positions against them to identify the cases where a proposal conflicts with their priorities. He suggested that this could also make interpersonal political disagreement more precise: people often argue over stated values when their deeper disagreement lies in how those values apply at the margins.

For legislators, the appeal is pre-submission stress testing. A proposed bill could be run against a constituent code or a modeled legislative body before it is introduced. For an individual, a chatbot operator, a contracting party, or a legislator, the method is meant to convert a high mental-load exercise—anticipating every exception and corner case—into an adversarial process that surfaces the cases worth deciding.

At minimum, Hogan sees Loophole as a game that pressures people to articulate the nuance in what they believe and exposes contradictions they may not have anticipated. Its broader applications depend on the same division of labor: agents can generate and organize possible conflicts, but a person, party, or legislator must still decide whether a conflict reveals a drafting flaw or a value that should be revised.

The frontier, in your inbox tomorrow at 08:00.

Sign up free. Pick the industry Briefs you want. Tomorrow morning, they land. No credit card.

Sign up free