ContextLens: Modeling Imperfect Privacy and Safety Context for Legal Compliance
Haoran Li, Yulin Chen, Huihao Jing, Wenbin Hu, Tsz Ho Li, Chanhou Lou, Hong Ting Tsang, Sirui Han, Yangqiu Song
Abstract
Individuals' concerns about data privacy and AI safety are highly contextualized and extend beyond sensitive patterns. Addressing these issues requires reasoning about the context to identify and mitigate potential risks. Though researchers have widely explored using large language models (LLMs) as evaluators for contextualized safety and privacy assessments, these efforts typically assume the availability of complete and clear context, whereas real-world contexts tend to be ambiguous and incomplete. In this paper, we propose ContextLens, a semirule-based framework that leverages LLMs to ground the input context in the legal domain and explicitly identify both known and unknown factors for legal compliance. Instead of directly assessing safety outcomes, our Con-textLens instructs LLMs to answer a set of crafted questions that span over applicability, general principles and detailed provisions to assess compliance with pre-defined priorities and rules. We conduct extensive experiments on existing compliance benchmarks that cover the General Data Protection Regulation (GDPR) and the EU AI Act. The results suggest that our ContextLens can significantly improve LLMs' compliance assessment and surpass existing baselines without any training. Additionally, our ContextLens can further identify the ambiguous and missing factors.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
Builds on8
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- LEGAL-BERT: "Preparing the Muppets for Court'"Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras et al.EMNLP Findings 2020 · 1,073 citations
- Multi-step Jailbreaking Privacy Attacks on ChatGPTHaoran Li, Dadi Guo, Wei Fan, Mingshi Xu et al.EMNLP Findings 2023 · 204 citations
- Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity TheoryNiloofar Mireshghallah, Hyunwoo Kim, Xuhui Zhou, Yulia Tsvetkov et al.ICLR 2024 · 198 citations
- Privacy Reasoning in Ambiguous ContextsRen Yi, Octavian Suciu, Adrià Gascón, Sarah Meiklejohn et al.NeurIPS 2025 · 15 citations
Related papers
- Context Reasoner: Incentivizing Reasoning Capability for Contextualized Privacy and Safety Compliance via Reinforcement LearningWenbin Hu, Haoran Li, Huihao Jing, Qi Hu et al.EMNLP 2025 · 1 citation
- PrivaCI-Bench: Evaluating Privacy with Contextual Integrity and Legal ComplianceHaoran Li, Wenbin Hu, Huihao Jing, Yulin Chen et al.ACL 2025
- CASE-Bench: Context-Aware SafEty Benchmark for Large Language ModelsGuangzhi Sun, Xiao Zhan, Shutong Feng, Philip C. Woodland et al.ICML 2025
- AgenticEval: Toward Agentic and Self-Evolving Safety Evaluation of Large Language ModelsYixu Wang, Xin Wang, Yang Yao, Xinyuan Li et al.ACL Findings 2026 · 1 citation
- Is Safety Standard Same for Everyone? User-Specific Safety Evaluation of Large Language ModelsYeonjun In, Wonjoong Kim, Kanghoon Yoon, Sungchul Kim et al.EMNLP Findings 2025 · 1 citation
