The Adversarial Moral Framework

Loophole is an open-source project that treats moral reasoning as a translation problem. Users input their moral principles in plain language, which an agent then codifies into a formal legal system. The system then enters a loop using two adversarial agents: one tasked with finding loopholes (actions that are immoral but legal under the current code) and another tasked with finding overreach (actions that are moral but illegal). A third 'judge' agent evaluates these findings, attempting to 'auto-patch' the legal code to resolve contradictions or escalating them to the user for manual judgment. This process allows users to move beyond abstract values and define the nuanced boundaries of their beliefs.

Scaling to Governance and Contracts

Beyond personal moral stress-testing, the framework has practical applications in three key areas:

  • Constitutional Chatbots: Instead of relying on standard system prompts, companies can use this framework to codify a chatbot's 'moral' constitution. Adversarial agents then attempt to force the bot to violate these rules, allowing developers to build robust, verifiable system prompts.
  • Decentralized Contracts: The system can compare a user's codified moral/privacy preferences against a company's Terms of Service to surface specific, synthetic scenarios where the two conflict. This provides users with actionable intelligence before signing contracts.
  • Legislative Simulation: By generating 'moral' personas for US Senators based on public voting records, the system can simulate how they might vote on proposed legislation. The framework can then 'hill climb' the language of a bill—iteratively modifying it to maximize support while maintaining the bill's core intent—until it reaches a majority or supermajority threshold. This approach has been tested using datasets of representative personas to measure constituent agreement on policy.