← Latest papers
💻 computer science

MCP-SandboxScan: WASM-based Secure Execution and Runtime Analysis for MCP Tools

This paper introduces SandScope, an MCP-aware audit framework that combines WebAssembly-based secure execution, runtime witness detection, and semantic tool profiling to identify and report confused-deputy risks where attacker-controlled inputs cause benign MCP tools to leak sensitive data or execute unauthorized operations within LLM agent contexts.

Original authors: Zhuoran Tan, Run Hao, Jeremy Singer, Yutian Tang, Christos Anagnostopoulos

Published 2026-06-23
📖 5 min read🧠 Deep dive

Original authors: Zhuoran Tan, Run Hao, Jeremy Singer, Yutian Tang, Christos Anagnostopoulos

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

The Big Picture: The "Confused Deputy" Problem

Imagine you hire a very smart, helpful robot assistant (an AI agent) to help you write code or manage your files. To make the robot more useful, you let it install "tools" (like a file reader, a web browser, or a database connector) that act like apps on a phone.

The problem is trust. You might install a tool that looks harmless, but if a hacker tricks the robot into giving that tool a specific command, the tool might accidentally hand over your private passwords or secret files to the robot.

This is called the "Confused Deputy" problem. The tool isn't evil; it's just doing exactly what it was told to do by the robot. But because the robot is talking to the tool, the tool might accidentally whisper your secrets back to the robot, and the robot might then show those secrets to you (or worse, use them to make bad decisions).

The Solution: SandScope (The "Glass Box" Inspector)

The researchers built a tool called SandScope to catch these accidental leaks before they happen. Think of SandScope as a high-tech glass box where you can test these tools safely.

Here is how it works, step-by-step:

1. The "Canary in the Coal Mine" (Setting the Trap)

Before testing a tool, SandScope plants invisible "traps" inside the environment.

  • The Analogy: Imagine you want to see if a new delivery driver is stealing from your house. You leave a few distinct, bright red envelopes on your desk with a unique code written inside.
  • In the paper: SandScope puts fake "canary" values (like fake passwords or unique codes) into the tool's environment, files, or the arguments the robot sends to the tool.

2. The "Glass Box" (Safe Execution)

SandScope runs the tool in a special, isolated room.

  • The Analogy: You don't let the delivery driver into your actual house. Instead, you let them into a soundproof, glass-walled booth. They can see what's on the table, but they can't touch your real safe or call your bank.
  • In the paper: They use a technology called WASM (WebAssembly) to run the tool in a sandbox. This limits what the tool can actually do to your real computer. If the tool tries to access a real file, the sandbox blocks it.

3. The "Eavesdropper" (Watching the Output)

While the tool is running in the glass box, SandScope watches everything the tool says back to the robot.

  • The Analogy: You are listening through a microphone to see if the delivery driver accidentally says, "Oh, I found that red envelope on the desk!"
  • In the paper: SandScope scans the tool's output (the text it sends back to the AI) to see if any of those fake "canary" codes appear there.

4. The "Report Card" (The Evidence)

If the tool accidentally repeats a fake code, SandScope raises a red flag.

  • The Analogy: If the driver says the code, you know, "Aha! This tool leaks information." You don't need to know how they stole it, just that they did leak it.
  • In the paper: This is called a "Source-to-Sink Witness." It proves that a secret (Source) ended up in a place the AI can see (Sink).

Two Ways of Looking at the Tools

SandScope is smart because it uses two different methods to check tools:

  1. The "Live Test" (Dynamic Analysis): It actually runs the tool in the glass box to see what happens. This is like letting the driver try to deliver a package to see if they drop it.

    • Result: They tested 35 real-world tools this way and found that 12 of them leaked information in specific scenarios.
  2. The "Resume Check" (Semantic Profiling): Sometimes, a tool is too complicated to run (maybe it needs a password or a special setup). In this case, SandScope just reads the tool's "resume" (its code description and metadata) to see what it claims it can do.

    • Result: Even when they couldn't run the tools, they analyzed the "resumes" of 1,127 tools. They found that 886 of them claimed to have access to sensitive things like networks, files, or passwords. This helps them know which tools to watch out for.

What Did They Find?

  • It works: SandScope successfully caught tools leaking fake secrets back to the AI in controlled tests.
  • It's not perfect: If a tool hides the secret by encrypting it (scrambling the letters) or compressing it, SandScope might miss it. It's good at catching "plain text" leaks.
  • It's practical: They tested 100 real-world tools. They could run about 35 of them fully. For the rest, they could still read their "resumes" to understand the risks.

The Bottom Line

The paper introduces SandScope, a safety inspector for AI tools. It doesn't try to stop hackers directly; instead, it creates a safe, isolated test environment to see if a tool accidentally spills secrets back to the AI. It combines live testing (watching the tool run) with resume reading (checking what the tool claims to do) to give developers a clear, auditable report on whether a tool is safe to use.

Important Note: The paper does not claim this fixes all security problems or that it can predict every future hack. It simply provides a way to gather evidence of leaks so developers can fix them before they become real disasters.

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 →