HAICOSYSTEM: An Ecosystem for Sandboxing Safety Risks in Human-AI Interactions

Xuhui Zhou, Hyunwoo Kim, Faeze Brahman, Liwei Jiang, Hao Zhu, Ximing Lu, Frank Xu, Bill Yuchen Lin, Yejin Choi, Niloofar Mireshghallah, Ronan Le Bras, Maarten Sap

TL;DR

HAICOSYSTEM introduces a modular sandbox environment designed to evaluate AI agent safety through dynamic, multi-turn simulations involving users, agents, and tool-enabled environments. Testing across 132 safety-critical scenarios reveals that state-of-the-art LLMs exhibit safety risks in 62% of cases, particularly when manipulated by malicious users during tool use. This framework shifts safety evaluation from static, single-turn prompts to a holistic human-AI-environment interaction ecosystem.

What Problem Does This Paper Address?

As AI agents gain autonomy, they transition from simple chatbots to active participants capable of executing actions via tools—such as browsing the web, modifying databases, or managing medical prescriptions. While existing safety benchmarks excel at identifying toxic content or direct jailbreaks in static, single-turn interactions, they fail to capture the risks that emerge during complex, multi-turn exchanges.

In the real world, a user's malicious intent often unfolds gradually, or an agent might inadvertently cause harm due to vague instructions from a benign user. The authors address this gap by evaluating AI agent safety holistically within a complete ecosystem of interacting users, agents, and environments rather than evaluating the agent in isolation.

Methods

The authors present HAICOSYSTEM, a modular sandbox platform that simulates multi-turn interactions using three distinct roles:

  1. Simulated User: Powered by an LLM (GPT-4o) adopting diverse character profiles, acting with either benign or malicious intent.
  2. AI Agent: The target model being stress-tested, equipped with scenario-specific tools.
  3. Environment Engine: An LLM-driven engine that emulates tool execution and returns realistic responses (e.g., database outputs or API successes/failures).

To mimic real-world conditions, the framework enforces information asymmetry: the AI agent cannot see the user's hidden goals or profile, and the user cannot see the agent's internal tool calls or environment observations.

Figure 1: An overview of HAICOSYSTEM. The framework enables simultaneous simulation of interactions between users, AI agents, and environments. The left side shows an example scenario from 132 scenarios in HAICOSYSTEM covering diverse domains and user intent types (benign and malicious). The right side shows an example simulation where the AI agent follows the simulated user’s instructions to prescribe a controlled medication to a patient without verification. After the simulation, the framework uses a set of metrics (HAICOSYSTEM-EVAL; §4) to evaluate the safety of the AI agent as well as its performance.

For evaluation, HAICOSYSTEM-EVAL leverages an LM-based evaluator validated by domain experts to score interaction trajectories across five safety dimensions:

  • Targeted Safety Risks (TARG): Adherence to scenario-specific checklists of safe vs. risky outcomes.
  • System and Operational Risks (SYST): Vulnerabilities to malware, network intrusions, or unsafe automated decisions in regulated domains.
  • Content Safety Risks (CONT): Generation of toxic, violent, or harmful content.
  • Societal Risks (SOC): Spread of misinformation, propaganda, or market manipulation.
  • Legal and Rights Related Risks (LEGAL): Privacy breaches, discrimination, or facilitation of illegal acts.

Datasets

The framework is instantiated with a benchmark of 132 safety-critical scenarios spanning 7 domains: Healthcare, Business & Finance, Politics & Law, Technology & Science, Education, Personal Services, and Miscellaneous.

While 21 scenarios were manually crafted by the authors, the remaining 111 were adapted from existing datasets (such as WildTeaming, Do-Not-Answer, and ToolEmu) and expanded into multi-turn agent environments using GPT-4o. User profiles are drawn from the Sotopia dataset to ensure realistic variations in demographics, personality, and occupation. The authors also adapted prompts from standard jailbreak benchmarks (DAN, PAP) to directly compare single-turn vs. multi-turn vulnerabilities.

Key Insights and Ideas

  • Multi-Turn Interactions Amplify Risk: Traditional single-turn evaluations paint an incomplete picture. HAICOSYSTEM’s dynamic multi-turn interactions surfaced up to 3 times more safety risks compared to static single-turn benchmarks. Agents that successfully resisted an initial jailbreak often succumbed as adversarial persuasion unfolded over multiple turns.
  • The Tool-Malicious User Nexus: AI agents face severe challenges when complex tool use intersects with malicious user intent. The cognitive load of selecting tools and formatting arguments correctly often causes the agent to overlook the underlying adversarial nature of the user's request.
  • Operational Risks Outweigh Content Risks: Across all tested models, agents were far more likely to trigger System/Operational (SYST) or Legal (LEGAL) risks via tool execution than they were to generate toxic text (CONT).
  • Reasoning Capabilities $\neq$ Uniform Safety: Evaluating advanced reasoning models revealed a nuanced trend. While DeepSeek-R1 achieved a remarkably low overall risk ratio (0.35), OpenAI-o1 exhibited a higher risk ratio (0.47), proving that scaling raw reasoning performance does not automatically guarantee safer agent behavior.

Key Results

The authors ran 8,700 simulated episodes across 12 prominent language models.

Figure 2: The risk ratio of models for different risk dimensions across simulated episodes. Overall dimension refers to an episode being considered as risky overall if any individual risk dimension is negative. The higher the risk ratio is, the more likely the model is to exhibit certain safety risks. The table shows the overall risk ratio for all benchmarked models, while the bar chart displays dimension- wise risk ratios for representative models.
  • High Baseline Risk: Every evaluated model exhibited substantial safety risks, with overall risk ratios ranging from 0.49 to 0.71.
  • Model Size Matters: Larger models generally proved safer. GPT-4-turbo achieved the lowest risk ratio among standard LLMs (0.49), whereas GPT-3.5-turbo (0.67) and Llama3.1-8B (0.71) were highly vulnerable.
  • The Safety-Utility Tradeoff: Highly capable models like GPT-4-turbo occasionally showed high safety risks because they were exceptionally good at following complex instructions to achieve goals, prioritizing user utility over safety boundaries. Conversely, weaker models sometimes avoided safety risks simply because they failed to use the tools correctly.

Limitations and Future Work

  • Simulation Constraints: Both the human users and the environment backends are simulated by LLMs (primarily GPT-4o). While validation checks showed high believability (92%), simulated users cannot fully replicate the unpredictability of real human adversaries.
  • Risk of Reward Hacking: The authors explicitly warn against using HAICOSYSTEM directly as a training environment, as agents could easily optimize for bypassing the automated evaluator rather than becoming genuinely safer.
  • Future Work: The authors plan to expand the framework to support real human-in-the-loop red-teaming and integrate actual live APIs and software tools to replace the emulated environment engine.

Summary updated

Abstract

AI agents are increasingly autonomous in their interactions with human users and tools, leading to increased interactional safety risks. We present HAICOSYSTEM, a framework examining AI agent safety within diverse and complex social interactions. HAICOSYSTEM features a modular sandbox environment that simulates multi-turn interactions between human users and AI agents, where the AI agents are equipped with a variety of tools (e.g., patient management platforms) to navigate diverse scenarios (e.g., a user attempting to access other patients' profiles). To examine the safety of AI agents in these interactions, we develop a comprehensive multi-dimensional evaluation framework that uses metrics covering operational, content-related, societal, and legal risks. Through running 1840 simulations based on 92 scenarios across seven domains (e.g., healthcare, finance, education), we demonstrate that HAICOSYSTEM can emulate realistic user-AI interactions and complex tool use by AI agents. Our experiments show that state-of-the-art LLMs, both proprietary and open-sourced, exhibit safety risks in over 50\% cases, with models generally showing higher risks when interacting with simulated malicious users. Our findings highlight the ongoing challenge of building agents that can safely navigate complex interactions, particularly when faced with malicious users. To foster the AI agent safety ecosystem, we release a code platform that allows practitioners to create custom scenarios, simulate interactions, and evaluate the safety and performance of their agents.
BibTeX
@inproceedings{zhou2025haicosystem,
  author = {Xuhui Zhou and Hyunwoo Kim and Faeze Brahman and Liwei Jiang and Hao Zhu and Ximing Lu and Frank Xu and Bill Yuchen Lin and Yejin Choi and Niloofar Mireshghallah and Ronan Le Bras and Maarten Sap},
  title = {{HAICOSYSTEM: An Ecosystem for Sandboxing Safety Risks in Human-AI Interactions}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=KI1WQ6rLiy},
}
Figure