arXiv:2608.29251cs.AIAug 2026

Manuscript Offprint

arXiv:2608.29251

GuardianAgent: Policy-Conditioned Risk-Adaptive Anonymization with Verified Adversarial Escalation

Ruiyi Yang, Gayathri Lihinikaduarachchi, Rahat Masood, Flora D. Salim, Salil S. Kanhere

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Privacy protection for live web traffic requires more than detecting private spans. Agent-based privacy protection systems must determine whether an outgoing action complies with the destination site's privacy policy, then apply only the level of rewriting or sanitisation justified by the residual disclosure risk. We present GuardianAgent, a policy-conditioned anonymization framework that couples structured risk assessment with verified adaptive rewriting. GuardianAgent computes risk through AMRSF (Adaptive Multi-factor Risk Scoring Formula), an explicit controller that combines policy-violation likelihood with data sensitivity, recipient transmission, purpose legitimacy, contextual basis, and policy transparency, rather than relying on an LLM to assign risk directly. This risk score determines both the allow/transform/deny decision and the initial anonymization level. For efficiency, GuardianAgent uses an evidential fast path for low-uncertainty policy matches and invokes an LLM slow path only for uncertain cases. For rewriting, it applies a five-level hierarchy driven by a verified adversarial guesser: guesses trigger escalation only when supported by the original text, preventing hallucinated attacker confidence from causing unnecessary over-anonymization. Experiments across three benchmarks spanning legal text (TAB), Reddit posts (SynthPAI), and multi-format synthetic PII records (PII-Masking-300k) show that GuardianAgent achieves the strongest privacy–utility trade-off among published baselines and is the only method to reach ≥\geq 0.90 privacy in all three domains, remaining robust under a backbone switch. Action-context stress tests further show that the same outgoing text receives different decisions and anonymization strengths under different recipients, purposes, action bases, and policy-transparency conditions. 1^{1}

1 Introduction

Modern web applications routinely expose fine-grained personal signals through form fields, paste events, outbound requests, clipboard content, and chatbot interactions. A browser-based privacy agent should therefore intervene before an action leaves the browser: it must determine whether the action is consistent with the destination site's privacy policy, and when needed, rewrite the outgoing content to reduce privacy leakage (Zhou et al., 2025; Staab et al., 2025; Chen et al., 2023b; Mireshghallah et al., 2023). This setting brings together two NLP problems that are usually studied in isolation: policy matching, which grounds an observed action in a heterogeneous privacy policy, and text anonymization, which rewrites content so that sensitive attributes cannot be inferred.

Existing work leaves three gaps. First, policy-understanding systems classify, retrieve, or summarize privacy-policy statements (Harkous et al., 2018; Ahmad et al., 2021; Srinath et al., 2021a; Tang et al., 2023; Sun et al., 2025), and recent LLM-based interfaces make policies easier to query and assess (Chen et al., 2025; Freiberger et al., 2026). However, these systems do not provide an operational risk signal that links live action context to the required strength of anonymization. The same text may be acceptable with light rewriting when sent to a first-party service for core functionality, but require stronger rewriting or blocking when sent to an advertising network for profiling. Second, recent LLM-based anonymizers often invoke a large model for every browser event (Staab et al., 2025; Shao et al., 2025), making them poorly suited for low-latency browser-resident mediation. Third, adversarial anonymizers commonly escalate rewriting whenever an auxiliary attacker reports high confidence. Such confidence, however, may reflect hallucinated priors rather than genuine residual leakage. For example, given [PERSON] going

1^{1}Code and evaluation harness at https://anonymous.4open.science/r/guardianAgent/.

to [LOCATION] this afternoon, an attacker may confidently guess “coffee shop” although the original was “school with Bob”, causing unnecessary over-anonymization.

This paper presents GuardianAgent, a policy-conditioned privacy agent that couples structured risk assessment with verified adaptive anonymization. GuardianAgent computes risk through AMRSF, an explicit controller that combines policy-violation likelihood with data sensitivity, recipient transmission, purpose legitimacy, contextual basis, and policy transparency. The resulting score jointly determines the allow/transform/deny decision and the initial anonymization level, ensuring that rewriting strength is controlled by action context rather than by an LLM-assigned risk judgment alone. To reduce latency, GuardianAgent uses an evidential fast path for low-uncertainty policy matches and routes only uncertain cases to an LLM slow path. The anonymizer then applies a five-level rewrite hierarchy and escalates only when a verified adversarial guesser identifies residual leakage that is actually supported by the original text. Our main contributions are:

• Policy-conditioned risk-adaptive anonymization: we introduce a structured risk score that jointly governs action-level decisions and anonymization strength. Action-context stress tests show that the same outgoing text receives different decisions and initial anonymization levels depending on recipient, purpose, action-basis, and policy transparency.

• Verified adversarial anonymization: we propose a hierarchical anonymizer that escalates rewriting only when adversarial guesses are supported by the original text, preventing hallucinated confidence from triggering unnecessary semantic distortion.

• Cross-domain empirical validation: experiments on legal text (TAB), Reddit posts (SynthPAI), and multi-format PII records (PII-Masking-300k) show that GuardianAgent consistently improves the privacy–utility trade-off over published baselines, is the only method to reach ≥\geq 0.90 privacy across all three domains, and maintains its gains under a backbone switch.

References (23)