Contextualized Privacy Defense for LLM Agents
Abstract
LLM agents increasingly act on users’ personal information, yet existing privacy defenses remain limited in both design and adaptability. Most prior approaches rely on static or passive defenses, such as prompting and guarding. These paradigms are insufficient for supporting contextual, proactive privacy decisions in multi-step agent execution. We propose Contextualized Defense Instructing (CDI), a new privacy defense paradigm in which an instructor model generates step-specific, context-aware privacy guidance during execution, proactively shaping actions rather than merely constraining or vetoing them. Crucially, CDI is paired with an experience-driven optimization framework that trains the instructor via reinforcement learning (RL), where we convert failure trajectories with privacy violations into learning environments. We formalize baseline defenses and CDI as distinct intervention points in a canonical agent loop, and compare their privacy–helpfulness trade-offs within a unified simulation framework. Empirically, CDI consistently achieves a better balance between privacy preservation (94.2\%) and helpfulness (80.6\%) than baselines, with superior robustness to adversarial conditions and generalization.
Lay Summary
Modern AI assistants often need to access personal information to complete their tasks. However, existing privacy protections for these agent systems are mostly static or passive: they either block certain actions or rely on hard-coded rules. These approaches are insufficient for supporting contextual, proactive privacy decisions in multi-step agent execution. We introduce a new method called Contextualized Defense Instructing (CDI). Instead of simply blocking or allowing actions, CDI actively guides agents step by step during task completion, telling it how to handle private information safely in each social context. Importantly, CDI is paired with an experience-driven optimization framework: when agents leaks private data to adversarial attackers, that experience is turned into a valuable learning environment. We formalize baseline defenses and CDI as distinct intervention points in a canonical agent loop, and compare their privacy–helpfulness trade-offs within a unified simulation framework. Empirically, CDI achieved a strong balance between protecting privacy (94.2\% effectiveness) and remaining helpful to users (80.6\% effectiveness), with superior robustness to adversarial conditions and generalization. Our result shows that proactive, step-specific privacy instructions is a promising path towards privacy-safe agent deployment.