arXiv:2603.15799cs.AI2026-03被引 1

将自然语言权限规则自动转为可执行代码,提升安全策略部署效率

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

  • 分步处理自然语言策略,生成符合规范的Rego代码
  • 在ACRE数据集上编译成功率95.3%,测试通过率达82.2%以上
  • 适合零信任与合规场景,支持自动化审计与验证

Prose2Policy(P2P)是一个基于大模型的实用工具,可将自然语言访问控制策略(NLACP)自动转化为可执行的Rego代码(Open Policy Agent, OPA的策略语言)。该工具提供模块化端到端流程,涵盖策略检测、组件提取、模式验证、代码检查、编译、自动测试生成与执行。P2P旨在弥合人类可读权限需求与机器可执行的策略即代码(PaC)之间的差距,强调部署可靠性与可审计性。我们在ACRE数据集上评估了该方法,结果显示,对于被接受的策略,95.3%可成功编译;自动测试中,正向测试通过率为82.2%,负向测试通过率为98.9%。结果表明,P2P生成的Rego策略在语法上稳健、行为上一致,适用于零信任和合规驱动环境。

原文摘要 · Abstract (English)

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.

策略生成LLM应用安全合规Rego

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。