Leveraging RAG and LLMs for Access Control Policy Extraction From User Stories in Agile Software Development
Authors’ abstract
Agile development has become increasingly popular among software development teams due to its capacity to deliver and update software rapidly while accommodating evolving requirements. Within this dynamic context, access control policies are critical for ensuring the security of systems by defining who can access specific resources under given conditions. However, identifying and documenting these policies often rely on manual, time-intensive processes prone to errors and oversight. This paper proposes an innovative framework leveraging Retrieval-Augmented Generation (RAG) and Large Language Models (LLMs) to automate the extraction and organization of access control policies from user stories and software documentation. The framework focuses on the early stages of the development lifecycle, capturing access control requirements as expressed in natural language artifacts. It comprises two core components: 1) a pipeline for extracting and categorizing access control policies, enabling precise mappings between roles, actions, and resources, and 2) an interactive chatbot designed to support Security Operations Center (SOC) analysts in evaluating suspicious access requests by providing contextualized insights into access policies. By integrating advanced natural language processing techniques with retrieval-based augmentation, the framework aims to reinforce access control mechanisms by improving visibility, and providing contextualized insights for security analysts. INDEX TERMS Access control, agile software development, software requirements, RAG, LLMs. I. INTRODUCTION Agile software development has become widely popular in the software industry due to its iterative and incremental approach and the emphasis on user participation. However, it has been criticized for its lack of focus on security through-out the development life cycle. Key challenges include the absence of explicit security requirements, inadequate attention to security concerns during development, and the lack of dedicated personnel with specialized knowledge in software security [1]. These gaps highlight the need for improved methods to integrate security into Agile practices, addressing it as a priority rather than an afterthought. [2], [3]. The lack of incentives to prioritize security during the early stages of development, coupled with the absence of integrated The associate editor coordinating the review of this manuscript and approving it for publication was Sunil Karamchandani. security practices within Agile frameworks, often results in the neglect of security considerations [4]. Access control policies are critical components of infor-mation security, defining rules that determine who can access resources, under what conditions, and for what purposes. In the context of this work, ‘‘resources’’ refer to the elements that users interact with or request access to during normal usage. These may include files, transaction records, system components, microservices, or any domain-specific assets that the application manages. The exact nature of these resources varies depending on the product being developed, but they consistently represent the data or functionality that needs to be protected from unauthorized access while remaining accessible to entitled users. Access control policies ensure that sensitive data and systems are protected against unauthorized access while allowing legitimate users to perform their tasks efficiently. The scale and complexity of modern systems, or the lack of access to their source code, can make it challenging for both users and developers to obtain a precise and comprehensive understanding of these policies. This gap can hinder efforts to evaluate, improve, or enforce security measures effectively. In particular, agile practices often contribute to the introduction and propagation of access control and other security vulnerabilities [5], [6]. Key challenges arise from the nature of agile processes, such as frequent code refactoring, modifications to functional requirements, and changes to system design tend to compromise previously implemented security constraints and to hinder the ability to perform thorough security assurance reviews. Moreover, in Agile environments, access control requirements are typically embedded within evolving natural language artifacts, such as user stories, rather than being formally specified. This makes it difficult to systematically capture, verify, and maintain access control policies over time, and hinders the ability to perform thorough security assurance reviews throughout the development lifecycle. Our contributions are as follows: • We propose a novel framework for extracting access control policies from user stories in agile software development, leveraging RAG and LLMs. We take user stories as inputs, with the goal of deriving access control policies that are expressed in natural language within the requirements described by these stories. By analyzing these textual artifacts, our framework identifies the access control rules embedded in the product requirements. • We design an automated pipeline that identifies candi-date access control rules from user stories. This allows teams, particularly SOC analysts or security reviewers, to evaluate whether these early requirements align with the actual implemented policies, identify potential gaps, and support more informed access reviews. • We introduce a specialized retrieval mechanism to enhance the precision of access control rule extraction, minimizing irrelevant data and improving contextual understanding. • We develop an intelligent agent to assist Security Operations Center (SOC) analysts in querying and validating access control rules efficiently. • We provide a comprehensive evaluation of our frame-work using real-world agile software development datasets, demonstrating its effectiveness in policy extraction accuracy and system scalability. • We provide a score representing the confidence of the model in the selected answer span, with higher values indicating greater confidence. This article is organized as follows: In Section II, we provide background information on agile software devel-opment, RAG, and LLMs. In Section III, we present related work along with the challenges and limitations of existing contributions. In Section IV, we propose our framework. In Section V, we describe the dataset used, followed by the results, discussion, and analysis. In Section VI, we conclude the paper and outline future work perspectives. II. BACKGROUND A. USER STORIES IN AGILE SOFTWARE DEVELOPMENT Agile software development (ASD) has proven its effective-ness in delivering high-quality software by accommodating evolving requirements, reducing time to market, and aligning IT solutions with business needs [7]. At the core of ASD are iterative practices such as planning, daily stand-up meetings, retrospectives, and iterative reviews, which facilitate contin-uous consideration of requirements and foster collaboration between product owners and development teams. These practices leverage user stories, a widely adopted artifact written in semi-structured natural language, to articulate software functionality from the user’s perspective. User stories are concise and simple descriptions of a feature or functionality written from the perspective of an end user. They are commonly used in agile development to capture the requirements and goals of users in a way that is easy to understand and actionable for development teams. A typical user story follows the format: ‘‘As a [user type], I want to [goal or action], so that [reason or benefit].’’ This structure ensures clarity about who the user is, what they need, and why it matters. Despite their advantages, several studies have shown that user stories are vulnerable to multiple interpretations and often fail to capture complete requirements [8], [9]. They are also prone to ambiguity [10], [11], [12], which can lead to imprecision and conflicting interpretations of the documented requirements. These issues frequently affect the access control rules governing the system under development. B. LLM Transformers [13] are a type of neural network architecture that excel at handling sequential data: In a transformer, text is first converted to numerical representations called tokens, which break down sentences into smaller, manageable units. Each token is then converted into a vector using a word embedding table, which assigns a unique vector representation to each token based on its position in a multidimensional space that captures semantic relationships. This vectorized form enables the transformer to perform mathematical operations on the tokens, allowing it to understand not just individual words but also the context in which they appear. Through mechanisms like self-attention, transformers weigh the importance of each token relative to others in the sequence, helping the model capture contextual relationships and dependencies regardless of token distance. This powerful combination of tokenization, embedding, and attention enables transformers to perform exceptionally well on tasks in natural language processing, such as translation, summarization, and text generation. Expanding on the revolutionary advancements of trans-formers, large language models (LLMs) have emerged as highly advanced AI systems trained on extensive corpora of text. A key strength of LLMs lies in their ability to generalize to new tasks from only a few examples or textual instructions [14]. By leveraging the transformer architec-ture [13], LLMs have pushed the boundaries of natural language processing, powering groundbreaking applications such as ChatGPT, which was released in 2022. C. RAG Despite their impressive capabilities, LLMs face notable lim-itations. They struggle with domain-specific or knowledge-intensive tasks [15] and often generate ‘‘hallucinations’’ [16], where responses include incorrect or fabricated information. This issue is particularly pronounced when queries require information beyond the training data or up-to-date knowl-edge, underscoring the need for complementary strategies to enhance their reliability and accuracy. One such strategy is Retrieval-Augmented Generation (RAG), which addresses these challenges by integrating external knowledge into the generation process [17]. RAG retrieves relevant information from external databases using semantic similarity techniques, combining it with the intrinsic knowledge of LLMs. This approach significantly improves the accuracy and credibility of generated responses, partic-ularly in knowledge-intensive or domain-specific contexts. Additionally, RAG facilitates continuous updates to the knowledge base, making it adaptable to dynamic environ-ments and specialized domains. By integrating retrieval with generation, RAG proves especially effective in domains requiring context-specific and explainable outputs, such as cybersecurity and access control, where accurate and context-aware decision-making is critical. Advanced RAG enhances retrieval and contextual integration by refining indexing techniques, incorporating fine-grained segmen-tation, metadata, and alignment optimization. It further improves query handling through optimization methods like rewriting and expansion, ensuring user queries are clear and well-suited for retrieval tasks. Furthermore, post-retrieval processes focus on re-ranking retrieved chunks and compressing context to emphasize the most relevant information. Figure 1 depicts Advanced RAG pipeline: The process begins with an indexing phase, where documents are split into smaller chunks, tokenized, and converted into vector embeddings, which are stored in a vector database for efficient retrieval. During query processing, a pre-retrieval step applies techniques such as indexing, query rewriting, and query expansion to refine the input query. The retrieval module then extracts relevant document chunks based on semantic similarity, followed by a post-retrieval reranking step that prioritizes the most useful information. Finally, the refined content is incorporated into a system prompt and processed by a Large Language Model (LLM) to generate a response. This pipeline improves information retrieval by ensuring that the LLM operates on contextually relevant and structured data. D. MOTIVATION AND PROBLEM STATEMENT In Agile development context, access control requirements are frequently embedded within user stories, rather than articulated through formal specifications. This lack of structure complicates the systematic extraction, validation, and maintenance of access control policies, thereby impeding comprehensive security assurance throughout the software development lifecycle. While LLMs offer promising capabilities for understand-ing and processing natural language, they face notable challenges in security-critical applications. LLMs may pro-duce false or irrelevant outputs when context is insufficient, rely on outdated or overly generic training data, and reference informal sources. These limitations are particularly con-cerning in cybersecurity, where precision and reliability are paramount. RAG addresses these limitations by integrating retrieval mechanisms that source relevant, authoritative, and context-specific information from predetermined knowledge bases. In our proposed framework for extracting access control rules from user stories and other requirements’ documentation, RAG enhances the accuracy and relevance of LLM-generated outputs by grounding responses in authori-tative documents. Furthermore, RAG provides transparency by disclosing the sources of the retrieved information, thereby offering insight into the reasoning process behind generated responses and increasing trust in the system’s recommendations. III. RELATED WORK A. LITERATURE REVIEW OF ADVANCED AI IN ACCESS CONTROL
Paper
- Authors
- S. Aboukadri, A. Ouaddah, A. Mezrioui, I. El Asri
- Publication date
- 2025
Transcript
A transcript has not been published for this episode yet.
Licensing
- Source license
- Creative Commons Attribution 4.0 International
- Recording license
- CC-BY-4.0
The authors and publisher do not sponsor or endorse this recording.