AI
Framework Translates Regulations into Executable Code for AI-Driven Compliance Checks
Researchers present Code-as-Auditor, a system that converts legal rules into structured code, enabling large language models to conduct more transparent and evidence-based regulatory assessments.
Researchers have introduced Code-as-Auditor, an approach that bridges the gap between natural language regulations and computational reasoning. Rather than relying solely on the interpretive capacity of language models, the framework converts legal requirements into formalized, machine-executable structures—making compliance evaluation more rigorous and auditable.
How It Works#
The system operates in two main phases. First, regulatory language is transformed into structured checklists and decision trees that encode rules and conditions as interpretable code. This conversion captures the logical structure of compliance requirements in a format that can be systematically executed.
During the actual evaluation, each checklist item is dynamically transformed into a set of factual and counterfactual questions—queries that probe both what has happened and what might happen under different scenarios. This questioning approach grounds the language model's reasoning in concrete, case-specific evidence and helps identify potential regulatory violations.
Why It Matters#
Current approaches to automated compliance often suffer from a critical weakness: the language model's reasoning is difficult to trace or verify. Outputs may be correct, but reviewers cannot easily see why. Code-as-Auditor addresses this by establishing a clear reasoning pipeline that moves from evidence gathering, through rule application, to final judgment. A built-in self-verification loop continually checks the logical consistency of the generated code and ensures outcomes remain traceable.
Testing on privacy and data protection cases showed that the approach produces more accurate and defensible compliance assessments compared to standard LLM-based methods. The explicit grounding in regulatory criteria creates an audit trail—critical for organizations handling sensitive compliance reviews where accountability and transparency matter most.

