TL;DR
GuardAgent is a novel, self-evolving agentic framework designed to protect Large Language Model (LLM)-based recommender systems from stealthy adversarial text attacks. By utilizing a continuous loop of perception, action, reflection, and memory, it not only achieves state-of-the-art detection performance but also provides human-readable reasoning traces to explain its decisions.
What Problem Does This Paper Address?
Modern recommender systems (RS) are undergoing a paradigm shift. Instead of relying solely on user-item interaction matrices, new models use LLMs to process natural language prompts containing item metadata and user history. While this improves personalization, it creates a massive new attack surface: adversarial promotions.
Malicious actors (like profit-driven merchants) can subtly manipulate item titles or descriptions to trick the LLM into ranking their products higher. Because these manipulations happen in the open-ended space of natural language, they are incredibly hard to detect with traditional, static security tools. Existing detectors often struggle to adapt to new attack patterns and usually function as "black boxes," offering no explanation for why a particular piece of text was flagged as malicious.
Methods
The authors propose GuardAgent, which treats adversarial detection as a cognitive, iterative process rather than a one-off classification task. The framework operates through a four-stage "Cognitive Loop":
- Perception: The agent receives new content and integrates it with its current "Memory" to form a detection state.
- Action: Using Chain-of-Thought (CoT) reasoning, the agent identifies whether a candidate is malicious based on its internal policies.
- Reflection: This is the "secret sauce." When the agent makes a mistake (e.g., a false alarm), it performs a Two-level Contrastive Analysis. It compares the failed case against successful ones to identify exactly which linguistic patterns led it astray, refining its rules accordingly.
- Memory: GuardAgent maintains a dual-memory system. Short-term Memory (STM) stores recent updates for rapid adaptation, while Long-term Memory (LTM) acts as a persistent repository of historically validated knowledge and examples.
Datasets
The framework was evaluated on two text-intensive, real-world datasets:
- Amazon Products: Specifically the Musical Instruments category.
- Yelp Business: A sampled subset ensuring balanced category coverage.
To test robustness, the authors subjected these datasets to seven different types of attacks, ranging from character-level typos (DeepwordBug) and word-level synonyms (BertAttack) to sophisticated, agent-led prompt injections (DrunkAgent).
Key Insights and Ideas
- Self-Evolution is Key: Static security rules are doomed to fail against evolving LLM attacks. GuardAgent’s ability to "reflect" on its own errors allows it to adapt to unseen threat patterns without manual retraining.
- Contrastive Learning for Nuance: By specifically analyzing why a benign marketing phrase triggered a false alarm versus why a stealthy attack was missed, the agent learns the subtle boundaries of malicious intent.
- Explainability as a Security Feature: GuardAgent doesn't just say "Yes" or "No." It generates "Reasoning Traces" that map specific text features to stored decision policies. This allows human security teams to audit the agent's logic and intervene if necessary.
Key Results
GuardAgent consistently outperformed a suite of baselines, including zero-shot LLMs and fine-tuned models:
- Superior Accuracy: On the Amazon dataset, GuardAgent achieved an Accuracy of 0.93 and an F1-score of 0.92, significantly higher than the next best baseline (Retrieval-based ICL at 0.87 Accuracy).
- Generalization to "Zero-Day" Attacks: In a stress test against the advanced DrunkAgent attack (which the model had not seen during its initial adaptation phase), GuardAgent achieved a 100% detection rate.
- Reliable False Alarm Control: Unlike many LLM detectors that either miss everything or flag everything, GuardAgent maintained a very low False Positive Rate (0.03 on Amazon, 0.01 on Yelp).
Limitations and Future Work
While GuardAgent represents a major step forward, the authors note several areas for improvement:
- Explanation Faithfulness: Ensuring that the generated reasoning traces perfectly mirror the model's internal decision logic remains a challenge.
- Scalability: The iterative reflection process is computationally more expensive than simple inference, which might impact real-time deployment on massive scales.
- Future Directions: The team plans to explore causal inference to better distinguish between coincidental text patterns and actual malicious manipulation, as well as ensemble learning to further boost generalization.
Summary updated