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

Ruiyi Yang, Gayathri Lihinikaduarachchi, Rahat Masood, Flora D. Salim, Salil S. KanherearXiv 2026 · arXiv

TL;DR

GuardianAgent is a policy-conditioned, risk-adaptive privacy agent designed to protect live web traffic by aligning text anonymization with a destination site's specific privacy policy and context. By introducing a structured risk controller and a verified adversarial loop, it achieves a state-of-the-art privacy-utility trade-off while preventing the over-anonymization typically caused by LLM hallucinations.

What Problem Does This Paper Address?

Modern web applications routinely expose fine-grained personal data through form fields, clipboard actions, and chatbot interactions. Existing text anonymization tools suffer from three major limitations when deployed as live browser mediators:

  1. Context Blindness: They treat privacy in isolation, applying the same level of sanitization regardless of whether data is sent to a trusted first-party service or a third-party advertising network.
  2. High Latency: Many recent LLM-based anonymizers invoke a large model for every single browser event, making them too slow for real-time mediation.
  3. Over-Anonymization via Hallucination: Adversarial anonymizers typically use a simulated "attacker" model to find residual leaks and escalate rewriting. However, these attackers often make highly confident, lucky guesses based on world knowledge rather than actual text leakage (e.g., guessing "coffee shop" from "[PERSON] going to [LOCATION]"), leading to unnecessary semantic distortion of the user's text.

Methods

GuardianAgent addresses these gaps through a multi-stage, dual-system architecture:

  1. Efficient Policy Matching: To minimize latency, a hybrid retriever pulls relevant policy statements. A fast-path evidential classifier processes the action-policy pair; it routes the request to an LLM "slow path" reasoning model only if its epistemic uncertainty exceeds a set threshold.
  2. AMRSF Risk Estimator: Instead of relying on an LLM to directly guess a scalar risk value, the system utilizes the Adaptive Multi-factor Risk Scoring Formula (AMRSF). This explicit controller combines policy-violation likelihood with data sensitivity, recipient transmission risk, purpose legitimacy, and policy transparency to output a structured risk score ($R$). This score dictates the final allow/transform/deny decision.
  3. Risk-Adaptive Hierarchical Anonymizer: If an action requires transformation, its position within the risk "transform band" determines its starting level across a 5-level rewrite hierarchy (ranging from L1 Partial Masking to L5 Semantic LLM Rewriting).
  4. Verified Adversarial Escalation: An adversarial LLM attempts to reconstruct the redacted information from the anonymized text. Crucially, a local verifier checks if the attacker's guesses are lexically supported by the original text. If a guess cannot be verified against the source text, the system blocks unnecessary escalation, preserving text utility.
Figure 1: Framework of GuardianAgent. Policy matching estimates the violation likelihood L, and AMRSF converts it into an action-conditioned risk score R. The score has two effects: it determines the action decision y ∈{allow, transform, deny}, and, for transformed actions, its normalized transform-band position z selects the initial anonymization level ℓ0(z). The hierarchical anonymizer then escalates when leakage is detected.
An example of the 5-level anonymization hierarchy progressively removing specific entities and contextual cues.

Datasets

The authors evaluated GuardianAgent across three distinct text domains and a policy corpus:

  • TAB (Text Anonymization Benchmark): Legal prose containing court judgments from the European Court of Human Rights (ECHR).
  • SynthPAI: Reddit-style posts annotated with implicit personal attributes.
  • PII-Masking-300k: Multi-format synthetic records (XML, JSON, tabular, and free-form) containing explicit PII categories.
  • OPP-115: A dataset of website privacy policies used to train and evaluate the policy-matching component.

Key Insights and Ideas

  • Operationalizing Contextual Integrity: The paper successfully shifts text anonymization from a static entity-masking task to a dynamic, context-aware control problem. The same input string receives entirely different levels of rewriting based on where it is going and why.
  • The "Anti-Hallucination" Verifier: A key insight is that adversarial attackers in text rewriting are often too smart, leveraging LLM priors to guess hidden variables. Grounding the attacker's feedback via a simple lexical verification step prevents the system from over-mangling text based on phantom leaks.
  • Uncertainty-Gated Efficiency: By pairing evidential deep learning with an LLM safety net, the system bypasses expensive generative model calls for over 96% of routine traffic, making browser-resident privacy agents computationally viable.

Key Results

  • Top-Tier Privacy Across Domains: GuardianAgent was the only evaluated method to achieve $\ge 0.90$ privacy across all three benchmarks (TAB, SynthPAI, and PII-Masking-300k), outperforming robust iterative rewriters like Staab'25 and AgentStealth.
  • Optimal Pareto Frontier: It consistently demonstrated the strongest privacy-utility trade-off, sitting above or beyond the baseline frontiers across all datasets.
  • Massive Cost Reduction: The dual-path policy matcher achieved a $28.6\times$ reduction in expected computational cost compared to an always-LLM pipeline, maintaining a 95th percentile latency of just 0.25 ms on its fast path.
The privacy-utility Pareto frontier on the PII-Masking-300k dataset, showing GuardianAgent outperforming baseline methods.

Limitations and Future Work

  • Language and Domain Constraints: The evaluation was restricted to English-language text and primarily public or synthetic corpora. Performance on real-world browser traces, clinical data, and multilingual traffic remains an open question.
  • Not a Legal Engine: AMRSF functions as a engineering mediation controller rather than a certified legal compliance tool; it cannot guarantee strict regulatory adherence (e.g., GDPR perfection).
  • Residual Risk: While the system significantly mitigates data exposure, text rewriting inherently reduces—but does not entirely eliminate—the risk of sophisticated re-identification attacks.

Summary updated

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 more than 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.
BibTeX
@misc{yang2026guardianagent,
  author = {Ruiyi Yang and Gayathri Lihinikaduarachchi and Rahat Masood and Flora D. Salim and Salil S. Kanhere},
  title = {{GuardianAgent: Policy-Conditioned Risk-Adaptive Anonymization with Verified Adversarial Escalation}},
  year = {2026},
  eprint = {2608.29251},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.29251},
}
Figure