Skip to main content
QUICK REVIEW

[Paper Review] Prose2Policy (P2P): A Practical LLM Pipeline for Translating Natural-Language Access Policies into Executable Rego

Vatsal Gupta, Darshan Sreenivasamurthy|arXiv (Cornell University)|Mar 16, 2026
Natural Language Processing TechniquesComputer Science0 citations
TL;DR

Prose2Policy is an end-to-end LLM-based toolchain that translates natural-language access control policies into executable Rego code, including extraction, schema validation, linting, compilation, and automated tests. It emphasizes deployment reliability and auditability.

ABSTRACT

Prose2Policy (P2P) is a LLM-based practical tool that translates natural-language access control policies (NLACPs) into executable Rego code (the policy language of Open Policy Agent, OPA). It provides a modular, end-to-end pipeline that performs policy detection, component extraction, schema validation, linting, compilation, automatic test generation and execution. Prose2Policy is designed to bridge the gap between human-readable access requirements and machine-enforceable policy-as-code (PaC) while emphasizing deployment reliability and auditability. We evaluated Prose2Policy on the ACRE dataset and demonstrated a 95.3\% compile rate for accepted policies, with automated testing achieving a 82.2\% positive-test pass rate and a 98.9\% negative-test pass rate. These results indicate that Prose2Policy produces syntactically robust and behaviorally consistent Rego policies suitable for Zero Trust and compliance-driven environments.

Motivation & Objective

  • Bridge the gap between human-readable access requirements and machine-enforceable policy code (PaC).
  • Provide an end-to-end, modular pipeline from NLACP to Rego with validation, linting, and testing.
  • Enable auditability and deployment reliability through structured prompts and intermediate artifacts.
  • Support researchers with a reproducible flow to study prompting strategies and guardrails.

Proposed method

  • Structured prompting pipeline to identify intent, extract DSARCP components (Decision, Subject, Action, Resource, Condition, Purpose), and synthesize Rego.
  • Four-module architecture: pre-processing, component extraction, schema validation, and Rego generation/refinement/testing.
  • Rego as the target policy language with deny-by-default semantics and audit annotations.
  • Integration of a Rego linter (Regal) and OPA compilation/testing for validation and unit test generation.
  • Batch and single-policy interfaces with optional LLM or rule-based test generation modes.
Figure 1. Prose2Policy Architecture
Figure 1. Prose2Policy Architecture

Experimental results

Research questions

  • RQ1Can NLACPs be reliably detected and decomposed into executable policy elements suitable for Rego?
  • RQ2How accurately can LLMs extract policy components (DSARCP) from NLACPs and convert them into Rego code?
  • RQ3Does the integrated linting, compilation, and unit testing pipeline yield syntactically correct and behaviorally correct policies?
  • RQ4What is the impact of RAGent-like baselines on the quality of generated policies compared to Prose2Policy’s approach?
  • RQ5How does Prose2Policy perform on standard datasets (e.g., ACRE) in terms of compile rate and test pass rates?

Key findings

  • Achieved 95.3% compile rate: 371/389 accepted NLACPs produced valid Rego policies.
  • Attained 82.2% positive-test pass rate (305/371) with LLM-driven test generation.
  • Achieved 98.9% negative-test pass rate (367/371) with LLM-driven tests.
  • Rule-based test generation yielded 62.1% positive-test pass rate and 97.1% negative-test pass rate.
  • 18 policies failed to produce valid Rego due to syntax issues introduced during automated generation.
  • Demonstrated a robust, deny-by-default policy enforcement with high negative-test success.
Figure 2. Inputs and outputs of each component
Figure 2. Inputs and outputs of each component

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.