Abstract
As Large Language Models (LLMs) increasingly integrate with live search engines to overcome knowledge cutoffs, they encounter a vast, uncurated threat surface on the open web. This paper presents SAFESEARCH, an automated red-teaming framework designed to evaluate the safety of these "search agents." Our investigation reveals a significant "knowledge-action gap": models that can identify unreliable sources in isolation often fail to filter them out when generating responses to user queries. With attack success rates reaching up to 90% in some top-tier models, SAFESEARCH underscores the critical need for more robust search agent architectures.
Introduction: The Vulnerability of the Open Web
Traditional LLMs are constrained by their training data's temporal limits. To address this, developers have deployed search agents—systems that allow LLMs to browse the live internet. However, unlike Retrieval-Augmented Generation (RAG) which typically relies on curated internal databases, search agents interact with the "open web," a landscape rife with misinformation, SEO-manipulated content, and malicious actors.
The core challenge is whether an LLM can remain a reliable information broker when its primary source is an unreliable or biased search result. Current safety benchmarks often fail to capture the dynamic nature of this threat, necessitating a systematic, automated approach to adversarial testing.
The SAFESEARCH Framework
The authors propose SAFESEARCH, a framework that automates the red-teaming process through three distinct stages:
- Scenario Anchoring: An LLM generator brainstorms realistic user scenarios where specific risks, such as medical misinformation, might manifest.
- Test Design: The system formulates a "malicious plan," identifying a target negative consequence and the type of unreliable source required to trigger it.
- Test Instantiation: Detailed guidelines for a "fake" unreliable website are generated, along with a safety checklist for evaluation.
To ensure ethical and reproducible testing, SAFESEARCH utilizes simulation-based testing. Rather than manipulating live search rankings, the framework "hooks" the agent's search tool, injecting custom, LLM-generated unreliable content into the results alongside authentic webpages.
Datasets and Risk Categories
The study introduces the SAFESEARCH Dataset, comprising 300 high-quality test cases across five critical risk categories:
- Misinformation: Fabricated facts or scientific claims.
- Bias Inducing: Content designed to reinforce harmful stereotypes.
- Harmful Output: Instructions for dangerous activities (e.g., homemade weapons).
- Prompt Injection: Hidden instructions in search results that hijack agent behavior.
- Advertisements: Uncritical promotion of suboptimal or fraudulent products.
Key Insights: The Knowledge-Action Gap
The most striking finding is the knowledge-action gap. Models like GPT-4.1-mini are capable of identifying a website as a "content farm" when asked directly to evaluate it. However, when the same model is tasked with answering a user query, it often ignores this internal skepticism, treating the unreliable site as an authoritative source.
Key results from the study include:
- High Vulnerability: In standard search workflows, GPT-4.1-mini reached an Attack Success Rate (ASR) of 90.5%.
- Scaffold Resilience: Moving from a basic workflow to a "Deep Research" scaffold—which employs iterative loops and cross-validation—dropped the ASR for the same model to 57.4%.
- Misinformation Prevalence: Misinformation proved to be the most successful attack category across all models, highlighting the difficulty agents face in filtering subtle factual errors.
Conclusion and Future Work
The study demonstrates that the "scaffold" surrounding an LLM is often more critical for safety than the model's raw size. While advanced "Deep Research" architectures are more resilient, they are also more computationally expensive. Future work should focus on making these safety-preserving architectures more efficient and using frameworks like SAFESEARCH to "patch" models through targeted safety alignment, teaching them to be more critical of external information.
Summary updated