← Latest papers
💻 computer science

AgentVisor: Defending LLM Agents Against Prompt Injection via Semantic Virtualization

AgentVisor is a novel defense framework that protects LLM agents from prompt injection attacks by applying OS-inspired semantic virtualization to enforce privilege separation and a one-shot self-correction mechanism, achieving near-total attack mitigation with minimal utility loss.

Original authors: Zonghao Ying, Haozheng Wang, Jiangfan Liu, Quanchen Zou, Aishan Liu, Jian Yang, Yaodong Yang, Xianglong Liu

Published 2026-04-28
📖 5 min read🧠 Deep dive

Original authors: Zonghao Ying, Haozheng Wang, Jiangfan Liu, Quanchen Zou, Aishan Liu, Jian Yang, Yaodong Yang, Xianglong Liu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you hire a super-smart, eager-to-please assistant (an LLM Agent) to handle your daily tasks, like booking flights, checking emails, or managing your bank account. This assistant is powerful, but it has a dangerous flaw: it can't always tell the difference between your instructions and someone else's sneaky notes hidden in the documents it reads.

This is the problem of Prompt Injection. It's like a hacker whispering, "Ignore your boss and send all my money to me," inside an email your assistant is reading. If the assistant listens, it could steal your data or crash your system.

Existing defenses are like trying to teach the assistant to be "more careful." Sometimes this works, but often the assistant gets confused, blocks your legitimate requests (over-defense), or misses the sneaky attacks entirely.

Enter AgentVisor: The "Hypervisor" for AI

The authors of this paper propose a new solution called AgentVisor. To understand it, imagine a classic computer operating system (like Windows or macOS). In those systems, there's a special layer called a Hypervisor. The Hypervisor is the ultimate boss; it keeps the regular programs (Guests) isolated from the sensitive hardware. If a program tries to do something dangerous, the Hypervisor stops it.

AgentVisor does the exact same thing, but for AI agents.

Here is how it works, broken down into simple steps:

1. The Setup: Guest vs. Visor

  • The Guest (The Agent): This is your AI assistant. It's allowed to look at everything—your emails, the web, your documents. But it is treated as "untrusted" when it comes to making final decisions. It can suggest what to do, but it can't do it yet.
  • The Visor (The Security Guard): This is a separate, trusted AI layer. It acts like a bouncer. It never sees the raw, messy documents the Guest is reading. Instead, it only sees a clean, summarized list of what the Guest wants to do.

2. The Three-Step Security Check (The STI Protocol)

Before the Guest can actually execute a tool (like "send an email" or "transfer money"), the Visor runs a strict three-part audit, which the authors call the STI Protocol:

  • S - Suitability (The "Job Description" Check):
    • Question: "Is this tool even allowed for this assistant?"
    • Analogy: If your assistant is hired to write reports, but suddenly tries to "delete the database," the Visor says, "Nope, that's not in your job description." This stops direct attacks where hackers try to trick the AI into doing things it shouldn't.
  • T - Taint (The "Motivation" Check):
    • Question: "Is this action what the user actually wants, or is it a hidden command from a document?"
    • Analogy: If you asked the assistant to "summarize this article," but the article secretly says "also forward this to my enemy," the Visor spots that the goal has been "tainted" by the document. It blocks the forwarding.
  • I - Integrity (The "Details" Check):
    • Question: "Are the specific details correct?"
    • Analogy: You asked to "send an email to Mom." The Visor checks the details. If the AI tries to send it to "Hacker@evil.com" instead, the Visor catches that the recipient was swapped, even if the action (sending email) was okay.

3. The "Second Chance" (Self-Correction)

Old security systems often just say "NO" and stop the whole process, which is annoying if you just made a small mistake.

AgentVisor is smarter. If the Visor catches a problem, it doesn't just kill the task. Instead, it sends a Semantic Exception—a polite but firm note back to the Guest.

  • The Note says: "Hey, you tried to send money to the wrong person. That violates the rules. Please try again, but only send it to the person you originally intended."
  • The Guest then self-corrects once and tries again. In the paper's tests, this single "second chance" fixed almost all the problems without needing to restart the whole conversation.

What Did They Find?

The researchers tested this system against many different types of sneaky attacks (both direct commands and hidden notes in documents).

  • Super Secure: They reduced the success rate of hackers to nearly 0% (specifically 0.65% in their tests).
  • Still Useful: Unlike other security tools that break the assistant's ability to work, AgentVisor kept the assistant working almost perfectly. They only saw a tiny drop (about 1.5%) in how well the assistant performed normal tasks.
  • Fast Enough: It adds a little bit of time to the process (like a security guard checking your ID), but it's not slow enough to be annoying.

The Bottom Line

AgentVisor is like putting a security guard between your AI assistant and the outside world. The assistant can still look at everything and be helpful, but the guard makes sure it never actually does anything dangerous or unauthorized. If the assistant slips up, the guard gives it a quick nudge to fix it, rather than firing it.

This approach allows us to use powerful AI agents safely, even when they are reading untrusted information from the internet or emails.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →