Stress-Testing Moral Systems with Adversarial Agents
AI Engineergo watch the original →
the gist
Loophole uses adversarial LLM agents to convert natural language moral principles into formal legal code, then tests that code for loopholes and overreach to identify contradictions.
The Adversarial Moral Loop
Loophole functions as a synthetic case law generator that forces users to refine their moral principles into a consistent, codified system. The process begins with the user providing natural language moral beliefs. An agent translates these into a formal legal structure, complete with preambles and articles. Two adversarial agents then operate on this system: one attempts to identify loopholes (immoral actions that remain legal under the current code), while the other hunts for overreach (moral actions that are incorrectly prohibited). A judge agent evaluates these synthetic cases, attempting to auto-patch the legal code to resolve contradictions. When the judge cannot resolve a conflict, it escalates the issue to the human user for a final determination, resulting in a refined, stress-tested moral contract.
Scaling to Contracts and Governance
The framework extends beyond personal moral testing into three practical domains. First, it generates codified system prompts for customer-facing chatbots, using adversarial agents to ensure the bot adheres to specific constraints while remaining helpful. Second, it facilitates decentralized contract negotiation by allowing parties to compare their respective moral codes against proposed terms of service or agreements to surface hidden conflicts before signing. Finally, the project includes a US Senate simulator that models individual senator voting behavior based on public records. By running proposed legislation against these models, the system can perform hill-climbing optimizations on bill language to maximize support, effectively finding the specific wording changes necessary to secure a majority vote.