论文

RegoMender:多智能体框架自动修复 Rego 策略代码

RegoMender: A Multi-agent Framework for Automated Rego Policy Repair

精选理由

写 OPA Rego 策略的朋友看过来,这套多智能体框架能自动修策略代码,132 个真实 CVE 修复率 86.4%,还顺手放出了首个 Rego 修复基准。

论文提出 RegoBench,这是首个 Rego 策略自动修复基准,包含 1,159 个真实缺陷。基于该基准,作者构建了反馈引导的多智能体框架 RegoMender,通过共享黑板和原子工具包动态执行补丁、重写或回滚。在 RegoBench 上,RegoMender 的语法修复成功率为 82.9%,基于测试的语义成功率为 77.9%,超过最强基线 13.4%。该框架在 132 个真实 CVE 漏洞上达到 86.4% 的修复率,并能泛化到 HCL 和 SQL。

原文 · arXiv cs.AI

RegoMender: A Multi-agent Framework for Automated Rego Policy Repair

Policy-as-Code (PaC) has emerged as a foundational paradigm in cloud-native systems. However, repairing Rego policies remains challenging due to their strict syntax, declarative semantics, and specific verification requirements. Existing automated program repair (APR) methods are mainly designed for mainstream languages and struggle to accommodate the unique policy logic and repair workflows of Rego. Thus, Rego policy repair remains a manual process driven by trial and error. To address this, we introduce RegoBench, the first automated Rego policy benchmark comprising 1,159 real-world defects, and propose RegoMender, a feedback-guided multi-agent framework. Collaborating via a shared blackboard and an atomic toolkit, RegoMender dynamically executes patching, rewriting, or rolling back, to resolve complex repair scenarios. Evaluated on RegoBench, RegoMender achieves syntactic and test-based semantic success rates of 82.9\% and 77.9\%, respectively, outperforming the strongest baseline by 13.4\%. Unlike other approaches whose performance drops in complex scenarios, RegoMender maintains effectiveness across single-step and chained repair tasks. Furthermore, it generalizes strongly across HCL and SQL and achieves an 86.4\% repair rate on 132 real-world CVE vulnerabilities, proving its robustness and practical utility for security.