Manuscript Offprint

arXiv:2608.27990

CAITLYN: Can LLM Agents Autonomously Synthesize Defenses against Emerging Injection Attacks?

Zi Liang, Xiaoyu Xu, Yanyun Wang, Minxin Du, Qingqing Ye, Haibo Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ASTAPLE Security, Trust and Privacy

THE HONG KONG POLYTECHNIC UNIVERSITY 香港理工大學

CAITLYN: Can LLM Agents Autonomously Synthesize Defenses against Emerging Injection Attacks?

Zi Liang 1†^{1\dagger} Xiaoyu Xu 1†^{1\dagger} Yanyun Wang 2^{2} Minxin Du 1^{1} Qingqing Ye 1^{1} Haibo Hu 1∗^{1*}

1^{1}The Hong Kong Polytechnic University 2^{2}The Chinese University of Hong Kong

†^{\dagger}Equal contributions ∗^{*}Corresponding author

zi1415926.liang@connect.polyu.hk haibo.hu@polyu.edu.hk

ASTAPLE

Security, Trust and Privacy

Figure

Prompt injection attacks on Large Language Model (LLM) agents seek to introduce malicious instructions or content into external text sources retrieved by agents, forcing the underlying LLMs to execute harmful actions outside their benign scope. While current defenses effectively counter known injection attacks, deploying them in LLM agent environments remains challenging due to attack variants and emerging threats. Moreover, existing solutions typically suffer from an inherent trilemma, i.e., a constant trade-off among runtime efficiency, contextual precision, and adaptability. To bridge this gap, we propose Continuous Agents for Injection Threats via Lifelong Yielding Nexus (CAITLYN), an agent-agnostic defense middleware. CAITLYN integrates two systems. System I focuses on immediate defense against existing attacks using a two-tiered library: Tier-0 for rule-based detection scripts and Tier-1 for optimized LLM-based accurate inference. System II, in contrast, is deployed to monitor potential abnormal signals and attempt to synthesize new defenses. On standard benchmarks, CAITLYN matches the detection performance of state-of-the-art defenses at lower token overhead than LLM-as-a-judge baselines. On Emerging, our new delivery-aware benchmark featuring novel injection techniques, static baselines and the standalone System I configuration remain vulnerable. In contrast, System II autonomously synthesizes verified defense capabilities, substantially lowering the attack success rate across three diverse agent environments.

GitHub Project

References (38)