A Line-Jumping Attack is the MCP attack pattern where a malicious tool description gets read by the LLM before the user has approved the tool, bypassing the normal consent flow. The attack works because most MCP clients pull the full tool list during the initialize handshake and merge every description into the LLM’s context immediately, even though the user only sees an approval prompt afterwards. By the time the user clicks “deny,” the malicious instructions are already inside the model’s working memory. The tool was never approved, but its payload already ran. Line-jumping inverts the assumption that approval gates protect anything.
How a Line-Jumping Attack Works
The user adds a new MCP server to their host. The host connects, sends initialize, and the server returns its tools/list response with full descriptions for every tool. The MCP client passes that list to the LLM as part of the available tool registry. The user then sees an approval dialog asking whether to trust the server. The user reads the description, gets suspicious, and clicks deny. But the description was already in the LLM’s context before the dialog appeared. The LLM has read the payload. If the payload included instructions referencing other already-approved tools, those instructions can still fire on later requests.
Certified MCP Security Expert
Attack, defend, and pen test MCP servers in 30+ hands-on labs. Get certified.
Why Line-Jumping Defeats Approval-Based Defenses
Approval gates assume the user reviews the tool description before any action happens. Line-jumping breaks the assumption: the LLM already saw the description. Even sandboxing the server’s execution doesn’t help, because the payload lives inside the model’s context, not inside the server’s process. The MCP spec doesn’t define a strict ordering between description ingestion and user approval, so different client implementations differ. Most fail open. Researchers analyzing MCP clients in 2025 found this pattern consistently across major IDE plugins and chat hosts.
How to Detect and Stop Line-Jumping Attacks
Don’t pass tool descriptions to the LLM until after the user has explicitly approved the server. Quarantine new servers in isolation before connecting them to the active agent context. Show the user the full description before any LLM-side ingestion. Treat denied servers as a security event: clear the LLM context and start a fresh session if a server was denied after partial connection. The Certified MCP Security Expert (CMCPSE) certification covers line-jumping with client-side approval flow design labs.
Summary
Line-Jumping Attacks bypass MCP approval flows by getting tool descriptions into the LLM’s context before the user gets a chance to deny the server. Approval-after-ingestion is the structural flaw. Strict ordering, server quarantine, and context resets are the defenses. The Certified MCP Security Expert (CMCPSE) certification trains engineers to design MCP clients whose approval prompts actually gate ingestion.
