arXiv(opens in a new tab)cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.41800

Reparo: Synthesizing and Validating Access Control Policies

Ayesha Binte Mostofa, Gehao Zhang, Sam Stern, Juan Zhai, Pubali Datta

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

AYESHA BINTE MOSTOFA, University of Massachusetts Amherst, USA

GEHAO ZHANG, University of Massachusetts Amherst, USA

SAM STERN, University of Massachusetts Amherst, USA

JUAN ZHAI, University of Massachusetts Amherst, USA

PUBALI DATTA, University of Massachusetts Amherst, USA

Writing correct access control policies for modern software applications is difficult because it requires expertise in the authorization language and a thorough understanding of the application's authorization requirements. Existing synthesis and mining approaches assume explicit authorization inputs and a trusted reference policy. However, authorization logic is often distributed across code, comments, and documentation rather than captured in a single artifact, and developer-defined policies in real-world application repositories are often incomplete, outdated, or incorrect. We present REPARO, an LLM-aided pipeline for access control policy synthesis, repair, and validation. REPARO synthesizes policies through collecting repository evidence for authorization intent, using that evidence to guide an LLM to generate an initial policy. REPARO then uses official policy-language validation tools to identify and automatically repair errors. For semantic validation, a different LLM derives a behavioral oracle from the same repository evidence. The oracle consists of concrete authorization requests with expected allow or deny decisions, which REPARO executes against the generated policy and compares with the expected decisions. We manually assess the oracle on a statistically sized sample of 390 test cases. We evaluate REPARO on 228 real-world GitHub repositories that use Cedar, OpenFGA, or Rego. In these repositories, 40.6–55.7% of the repository policies fail their language's validation tool. In contrast, REPARO produces 99.0–100% valid policies after repair. Their agreement with the oracle is 98.2–99.6% for OpenFGA, 82.0–86.5% for Cedar, and 76.3–80.2% for Rego. Manual review confirms 91.5–96.9% of the sampled test cases as correct. Synthesizing and validating the policy for one repository takes about five minutes and costs 0.55–0.55–1.57. These results show that repository evidence can support both access policy synthesis and independent validation for applications, even when no reliable reference policy exists.

CCS Concepts: • Security and privacy → Access control; • Software and its engineering → Software verification and validation.

Additional Key Words and Phrases: Access control, authorization policies, policy synthesis and repair, large language models, test oracle generation

1 Introduction

Modern cloud platforms provide specialized policy languages for defining fine-grained access-control rules [16, 45, 48]. Writing correct policies requires expertise in the language's syntax and authorization model, as well as an accurate understanding of often complex and incompletely documented authorization requirements. Consequently, manual policy writing is tedious and error-prone [50, 70], and even small mistakes can have serious consequences [54]. Overly permissive policies may expose sensitive resources; for example, in 2023, Microsoft researchers accidentally exposed 38 TB of sensitive data by attaching an overly permissive token to a download link, granting full control over an internal storage account instead of a single dataset [44]. Overly restrictive policies, conversely, may deny legitimate users, disrupt functionality, and waste users' time; in safety-critical domains such as health care, erroneous denials can have serious consequences [6].

Policy mining and reverse-engineering techniques attempts to solve this problem through inferring authorization rules from structured data, such as user–permission assignments [69], access

Authors' Contact Information: Ayesha Binte Mostofa, amostofa@umass.edu, University of Massachusetts Amherst, Amherst, Massachusetts, USA; Gehao Zhang, gehaozhang@umass.edu, University of Massachusetts Amherst, Amherst, Massachusetts, USA; Sam Stern, jstern@umass.edu, University of Massachusetts Amherst, Amherst, Massachusetts, USA; Juan Zhai, juanzhai@umass.edu, University of Massachusetts Amherst, Amherst, Massachusetts, USA; Pubali Datta, pdatta@umass.edu, University of Massachusetts Amherst, Amherst, Massachusetts, USA.

logs [15], and relationship graphs [9, 10], or from the application itself by analyzing authorization checks in code [21] or observing runtime behavior [30]. However, real-world repositories rarely provide such structured input: authorization information is spread across source code, comments, documentation, and policy files. Large language models (LLMs) make it feasible to integrate such scattered evidence, but their output may contain incorrect rules and must be validated. Existing LLM-based approaches leave three gaps. First, LLM-based policy synthesis translates an explicit specification, such as natural-language requirements or allowed and denied requests, into a policy [13, 22, 27, 29, 34, 47, 58, 59, 61, 62]. Writing a complete specification reintroduces the manual effort that automation seeks to remove. Second, LLM-based mining still requires structured authorization data, such as attributes, granted permissions, or access logs [4, 8]. Third, existing approaches validate against a trusted reference: an input specification [61], a ground-truth policy [4, 8], or a human-reviewed policy [62]. Real repositories rarely offer such a reference. The developer-written policy available in the repository, which we call the repository policy, cannot serve as one, because policy errors are common [6, 50, 70].

We therefore ask two questions. Can an executable policy that captures an application's authorization intent be synthesized from its repository alone? And can that policy be validated without a trusted reference? The repository policy, which often contains errors, is used neither as input to synthesis nor as ground truth for validation. Our key insight is that the repository evidence used to synthesize a policy can, independently, also serve as the reference for validating it. Achieving this raises three challenges.

Challenge 1: Locating and reconciling scattered authorization logic. Authorization intent is rarely captured in a single artifact. It is scattered across source code, comments, and documentation, most of which concerns other behavior. Comments make up more than 20% of non-blank code lines in popular open-source repositories [23], documentation appears in 98% of sampled GitHub repositories [49], and authorization checks are sparse within millions of lines of code [21]. The challenge is to find the relevant fragments and reconcile incomplete or inconsistent information during policy synthesis.

Challenge 2: Producing valid executable policies across languages. Policy languages differ in both syntax and authorization semantics: Cedar uses entity schemas to express role, relation, and attribute-based rules [16], OpenFGA derives access from relations between objects defined in an authorization model [1], and Rego computes decisions through rules over structured input [37]. Thus, the same authorization requirement can take structurally different forms across languages. A synthesized policy must not only capture the intended authorization behavior but also pass the language's native validator [11, 40, 43]. The challenge is to synthesize executable policies and automatically correct the errors to enable large-scale policy synthesis.

Challenge 3: Building a trustworthy oracle from the same evidence. A syntactically valid policy may still make incorrect decisions, so its behavior must be checked against an oracle, i.e., test cases pairing access requests with expected decisions. Such an oracle is rarely available in real repositories, and manually constructing one from scattered authorization evidence reintroduces the effort that automation seeks to eliminate. We therefore generate the oracle automatically using an LLM. However, LLM-generated test cases may be incorrect, ambiguous, unsupported by the evidence, or leave parts of the policy unexercised. Moreover, because the oracle and policy use the same evidence, their errors may be correlated, so agreement alone does not establish correctness. The oracle's correctness and coverage must be measured.

To address these challenges, we present REPARO, an LLM-aided pipeline that synthesizes, repairs, and validates access-control policies from repository evidence. REPARO decouples synthesis from validation: one set of LLMs synthesizes the policy, and a different set derives the oracle used to validate it. For Challenge 1, REPARO retrieves relevant content from source code, comments, and documentation, and never reveals the repository policy to the synthesis models. For Challenge 2, it guides generation with the target language's grammar and examples, and iteratively repairs invalid policies using error messages from the language's validator. For Challenge 3, the oracle models derive test cases from the same evidence, each pairing a concrete authorization request with an expected allow or deny decision. REPARO runs the synthesized policy on these test cases with the language's policy engine and compares its decisions with the expected ones. We manually assess the LLM-generated oracle: a statistically sized sample of 390 test cases is reviewed for correctness. Moreover, we measure the extent to which the test cases exercise each policy.

To evaluate REPARO, we need real application repositories that express authorization intent. Existing datasets are often synthetic [26, 63], curated [7, 26], or small [26]. We therefore construct a benchmark of 228 real-world GitHub repositories that use Cedar [16], OpenFGA [1], or Rego [37], three policy languages with distinct authorization models. In this benchmark, 40.6–55.7% of the repository policies that were originally included by the developers fail their language's validator [11, 40, 43], confirming that they cannot reliably serve as ground truth.

REPARO produces 99.0–100% valid policies after repair in all three languages. We measure correctness as decision agreement: the share of oracle test cases on which the policy returns the expected Allow or Deny decision. Decision agreement is 98.2–99.6% for OpenFGA, 82.0–86.5% for Cedar, and 76.3–80.2% for Rego. Manual review finds 91.5–96.9% of 390 sampled test cases correct. Our case studies further show that, when repositories contain sufficient authorization evidence, synthesized policies recover core authorization behavior and correct defects in the repository policy. In summary, we make the following contributions:

  • Policy synthesis from repository evidence. We present REPARO, an LLM-aided pipeline that synthesizes access-control policies from code, comments, and documentation, without a separate specification, and repairs invalid policies using feedback from each language's validator.
  • Validation without ground truth. We introduce a validation approach in which independent LLMs derive behavioral test cases from the same repository evidence, and the language's policy engine checks the policy's decisions against them. We also measure the correctness and coverage of these test cases.
  • Benchmark and evaluation. We construct a benchmark of 228 real-world repositories across Cedar, OpenFGA, and Rego, in which 40.6–55.7% of repository policies fail validation. Evaluated with proprietary and open-weight models, REPARO produces 99–100% valid policies, and its synthesized policies can correct defects in repository policies.

References (21)