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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 3b116e70-267c-49cd-8b9f-af3c53c5a8dfBuilds on6
- 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
- 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
- GoldCoin: Grounding Large Language Models in Privacy Laws via Contextual Integrity TheoryWei Fan, Haoran Li, Zheye Deng, Weiqi Wang et al.EMNLP 2024 · 7 citations
- Defense Against Prompt Injection Attack by Leveraging Attack TechniquesYulin Chen, Haoran Li, Zihao Zheng, Dekai Wu et al.ACL 2025
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
- User Perceptions vs. Proxy LLM Judges: Privacy and Helpfulness in LLM Responses to Privacy-Sensitive ScenariosXiaoyuan Wu, Roshni Kaushik, Wenkai Li, Lujo Bauer et al.ACL 2026 · 2 citations
- PrivAct: Internalizing Contextual Privacy Preservation via Multi-Agent Preference TrainingYuhan Cheng, Hancheng Ye, Hai Li, Jingwei Sun et al.ICML 2026 · 3 citations
