Abstract
Large Language Models (LLMs) are increasingly deployed in enterprise environments where data privacy is paramount. This paper investigates "role-conditioned refusals"—the ability of an LLM to provide helpful outputs to authorized users while strictly denying access to unauthorized ones based on Role-Based Access Control (RBAC) policies. We introduce a framework for evaluating LLMs on Text-to-SQL tasks using newly created benchmarks, Spider-ACL and BIRD-ACL. Our findings indicate that while standard prompting is often insufficient, multi-step verification pipelines and targeted fine-tuning significantly enhance a model's adherence to security policies without sacrificing utility.
Introduction: The Challenge of Probabilistic Access Control
In traditional software engineering, access control is deterministic. A system checks a user's credentials against a hardcoded list of permissions and grants or denies access accordingly. However, LLMs operate probabilistically, generating tokens based on learned patterns rather than rigid logic. This poses a significant security risk: an LLM fine-tuned on sensitive organizational data might inadvertently leak restricted information if a user crafts a query that bypasses simple safety filters.
The authors define the problem as role-conditioned refusals: teaching models to internalize who is asking and what they are permitted to see. The goal is to ensure the model provides a valid SQL query to an authorized user but a firm "Access Denied" to an unauthorized one.
Experimental Framework: Methods and Datasets
To evaluate LLM performance in this domain, the researchers developed two new benchmarks by augmenting existing Text-to-SQL datasets with Access Control Lists (ACLs):
- Spider-ACL: 19.6k queries across 153 databases.
- BIRD-ACL: 35.8k queries across 80 complex, enterprise-scale databases.
For each database, a hierarchy of four roles (ranging from "Unrestricted" to "Minimal Visibility") was established. A deterministic policy engine provided ground-truth labels (PERMIT or DENY) for every question-role pair.
The study compared three distinct architectural strategies to enforce these boundaries:
- Direct Decision (Prompting): The model receives the schema, policy, and user role in a single prompt and must decide whether to generate SQL or refuse.
- Generator-Verifier (Pipeline): A two-step process where one model (the Generator) writes a candidate SQL query and a second model (the Verifier) audits that SQL against the access policy.
- LoRA Fine-tuning: Models like Mistral-7B and LLaMA-3.1 are trained directly on permission-aware data using Low-Rank Adaptation to internalize refusal logic.
Key Insights
- Verification Superiority: Explicitly separating query generation from policy auditing (Setting 2) consistently outperformed single-step reasoning. LLMs appear more capable of auditing existing code than self-censoring during the generation process.
- The Reasoning Burden: Performance drops as access policies become more granular and lengthy. This suggests that complex logical processing, rather than just memory, is the bottleneck in long-context scenarios.
- DeepSeek-R1 as a Verifier: In the auditing role, DeepSeek-R1 demonstrated a superior balance of high recall (minimizing false blocks) and high precision (preventing data leakage).
- Fine-tuning for Efficiency: Fine-tuning smaller models allowed them to punch above their weight. A fine-tuned Mistral-7B achieved a refusal F1-score of 0.933 on Spider-ACL, suggesting that domain-specific training is more reliable than complex zero-shot prompting.
Results and Performance
The two-step pipeline significantly reduced unauthorized data leakage. For instance, GPT-4o-mini’s refusal F1-score on Spider improved from 0.797 in the Direct setting to 0.877 in the Pipeline setting. Interestingly, the verification step also improved execution accuracy (from ~61% to over 73% for GPT-4o-mini), as the verifier served as a secondary logic check. On the more challenging BIRD dataset, fine-tuned models nearly doubled the execution accuracy of zero-shot configurations in some instances.
Limitations and Future Directions
While promising, the authors note several challenges for real-world application. Current models rely on static roles and explicit role identification. Future work must address dynamic, overlapping permissions and the ability of models to infer user identity from metadata. Additionally, extending these deterministic verification methods to open-ended generation tasks remains a significant open challenge.
Summary updated