GuardianAgent: Policy-Conditioned Risk-Adaptive Anonymization with Verified Adversarial Escalation
Organizations: School of Computer Science and Engineering, UNSW Sydney, Australia
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.
Figures & tables
| TAB (legal, ) | SynthPAI (Reddit, ) | PII-Masking-300k ( ) | ||||||||||
| Method | Priv | Util | Guess | Lat. | Priv | Util | Guess | Lat. | Priv | Util | Guess | Lat. |
| Iterative / multi-pass LLM rewriters | ||||||||||||
| A. Ours (full, L1–L5) | ||||||||||||
| B. Staab’25 | ||||||||||||
| C. AgentStealth’25 | ||||||||||||
| D. HaS’23 | ||||||||||||
| Context | Allow | Trans. | Deny | ||
|---|---|---|---|---|---|
| (first-party / functionality / paste / full) | |||||
| (provider / analytics / default / partial) | |||||
| (advertising / profiling / background / vague) | |||||
| (data broker / advertising / background / missing) |
| Context | Recipient | Purpose | Basis | Trans. % | L1 | L2 | L3 | L4 | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| first-party | Personalization | default | ||||||||||
| service-provider | Personalization | default | ||||||||||
| service-provider | Marketing | default | ||||||||||
| advertising | Marketing | default |
| TAB | SynthPAI | PII-Mask | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Cap | Priv | Util | Guess | Priv | Util | Guess | Priv | Util | Guess |
| Variant | Priv | Util | ms |
| SynthPAI | |||
| A. NER only | 23 | ||
| B. + guesser | 729 | ||
| C. + LLM rewrite | 2518 | ||
| D. + L1–L5 adaptive | 9949 | ||
| TAB | |||
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Wt. | Source |
|---|---|---|
| Credentials | 1.00 | NIST 800-122 |
| Financial | 0.95 | Milne’04 |
| Health, Biometric, Genetic | 0.95 | GDPR Art. 9 |
| SSN | 0.90 | NIST 800-122 |
| Location (precise) | 0.85 | Milne’04 |
| Location (unspec.) | 0.75 | default |
| Recipient | |
|---|---|
| first-party only | |
| service provider (Art. 28) | |
| analytics / government | |
| social-media platform | |
| unknown third party | |
| advertising network |
| Purpose | |
|---|---|
| functionality, security, auth. | |
| personalization, research | |
| analytics | |
| marketing | |
| profiling (Art. 22) | |
| advertising |
| Signal | Credit |
|---|---|
| substantial text ( chars) | |
| covers the action’s data category | |
| covers the action’s declared purpose | |
| states a legal basis (GDPR Art. 6) | |
| discloses user rights | |
| specifies retention |
| Data tier | Allow ceiling | Deny floor |
|---|---|---|
| Critical | ||
| High | ||
| Moderate | ||
| Low |
| Method | MAE | Macro-F1 | ||
|---|---|---|---|---|
| Expert-rated scenarios ( ) | ||||
| AMRSF (full) | 0.982 | 0.947 | 0.119 | |
| AMRSF | ||||
| AMRSF | ||||
| AMRSF purpose | ||||
| NIST L I | ||||
| Metric | Value |
|---|---|
| Test pairs (OPP-115) | |
| Accuracy | |
| Precision | |
| Recall | |
| Expected Calibration Error |
| TAB | SynthPAI | |||
|---|---|---|---|---|
| D variant | Priv | Util | Priv | Util |
| D (semantic only) | ||||
| D (min-edit only) | ||||
| D (L1–L5 adaptive) | ||||
| Metric | V ON | V OFF | |
|---|---|---|---|
| Final level | |||
| Upgrade rate | |||
| Privacy | |||
| Utility | |||
| Latency (ms) | |||
| Unnecessary upgrades | |||
| TAB | SynthPAI | |||
|---|---|---|---|---|
| Method | Priv | Util | Priv | Util |
| D. GuardianAgent | ||||
| G. HaS | ||||
| F. CONFAIDE | ||||
| K. Pissarra | ||||
| I. Staab’25 | ||||
| Llama-3.2-3B | Llama-3.1-8B | |||
|---|---|---|---|---|
| Method | Priv | Util | Priv | Util |
| GuardianAgent (full) | ||||
| Staab | ||||
| Class | SynthPAI | TAB |
|---|---|---|
| clean_success | ||
| cascade (L4 ) | ||
| pii_retained | ||
| parse_fail |
| Context | Decision | Final | Anonymized output ( bold marks tokens introduced by the anonymizer) | ||
| TAB TAB_0025 . Original : “The formal record of the judge’s order was not prepared by the parties until 26 October 1995. The applicants and Mrs Price applied to the Court of Appeal for leave to appeal on 1 November 1995. The appeal bundles were lodged on 4 October 1996. On 15 January 1997 the appeal was listed for hearing, and it was heard on 16 and 17 April 1997, on which last date the Court of Appeal gave judgment dismissing the appeal.” | |||||
| allow | L1 | L1 | The formal record of the judge’s order was not prepared by the parties until 1995 . The applicants and a female applied to the Court for leave to appeal on 1995 . The appeal bundles were lodged on 1996 . On 1997 the appeal was listed for hearing, and it was heard on 1997 , on which last date the Court gave judgment dismissing the appeal. | ||
| transform | L1 | L1 | Identical to . | ||
| deny | L4 | L4 | The formal record of the judge’s order was not prepared by the parties until a specific date . The applicants, including a female applicant , applied to a high court for leave to appeal on a specific date . The appeal bundles were lodged on a specific date . On a specific date , the appeal was listed for hearing, and it was heard on two specific dates , on which last date a high court gave judgment dismissing the appeal. | ||
| deny | L4 | L4 | Identical to . | ||
| SynthPAI STAAB_0025 . Original : “Ah reminiscing childhood, huh? Those were the days… I was completely enraptured by my Famicom. … this game — Dragon Quest III. Eiichiro Nakatsu, the genius. … That’s probably why I ended up a game developer now, haha. Nostalgic TIMESSSS!!” | |||||
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 517 papers