AgentVisor: Defending LLM Agents Against Prompt Injection via Semantic Virtualization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ying, Zonghao, Wang, Haozheng, Liu, Jiangfan, Zou, Quanchen, Liu, Aishan, Yang, Jian, Yang, Yaodong, Liu, Xianglong
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908995159064576
author Ying, Zonghao
Wang, Haozheng
Liu, Jiangfan
Zou, Quanchen
Liu, Aishan
Yang, Jian
Yang, Yaodong
Liu, Xianglong
author_facet Ying, Zonghao
Wang, Haozheng
Liu, Jiangfan
Zou, Quanchen
Liu, Aishan
Yang, Jian
Yang, Yaodong
Liu, Xianglong
contents Large Language Model (LLM) agents are increasingly used to automate complex workflows, but integrating untrusted external data with privileged execution exposes them to severe security risks, particularly direct and indirect prompt injection. Existing defenses face significant challenges in balancing security with utility, often encountering a trade-off where rigorous protection leads to over-defense, or where subtle indirect injections bypass detection. Drawing inspiration from operating system virtualization, we propose AgentVisor, a novel defense framework that enforces semantic privilege separation. AgentVisor treats the target agent as an untrusted guest and intercepts tool calls via a trusted semantic visor. Central to our approach is a rigorous audit protocol grounded in classic OS security primitives, designed to systematically mitigate both direct and indirect injection attacks. Furthermore, we introduce a one-shot self-correction mechanism that transforms security violations into constructive feedback, enabling agents to recover from attacks. Extensive experiments show that AgentVisor reduces the attack success rate to 0.65%, achieving this strong defense while incurring only a 1.45% average decrease in utility relative to the No Defense scenario, demonstrating superior performance compared to existing defense methods.
format Preprint
id arxiv_https___arxiv_org_abs_2604_24118
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle AgentVisor: Defending LLM Agents Against Prompt Injection via Semantic Virtualization
Ying, Zonghao
Wang, Haozheng
Liu, Jiangfan
Zou, Quanchen
Liu, Aishan
Yang, Jian
Yang, Yaodong
Liu, Xianglong
Cryptography and Security
Large Language Model (LLM) agents are increasingly used to automate complex workflows, but integrating untrusted external data with privileged execution exposes them to severe security risks, particularly direct and indirect prompt injection. Existing defenses face significant challenges in balancing security with utility, often encountering a trade-off where rigorous protection leads to over-defense, or where subtle indirect injections bypass detection. Drawing inspiration from operating system virtualization, we propose AgentVisor, a novel defense framework that enforces semantic privilege separation. AgentVisor treats the target agent as an untrusted guest and intercepts tool calls via a trusted semantic visor. Central to our approach is a rigorous audit protocol grounded in classic OS security primitives, designed to systematically mitigate both direct and indirect injection attacks. Furthermore, we introduce a one-shot self-correction mechanism that transforms security violations into constructive feedback, enabling agents to recover from attacks. Extensive experiments show that AgentVisor reduces the attack success rate to 0.65%, achieving this strong defense while incurring only a 1.45% average decrease in utility relative to the No Defense scenario, demonstrating superior performance compared to existing defense methods.
title AgentVisor: Defending LLM Agents Against Prompt Injection via Semantic Virtualization
topic Cryptography and Security
url https://arxiv.org/abs/2604.24118