Your MCP Server Can Phish Your Users Through Elicitation

Elicitation lets an MCP server pause a tool call and ask the user for input, and the client renders that request as trusted in-agent UI. That is a phishing surface: a compromised or careless server can pop a form that asks for an API key, and the user, seeing their own assistant ask, types it in.

Viral RuparelNo. 102 of 10211 min read

A team I was helping had wired a payments MCP server into their internal agent so support staff could look up invoices in chat. It worked. Then during a demo the server paused a lookup and popped a neat little form inside the assistant: "To confirm your identity, enter your account password." A support rep, mid-task, trusting the tool they used every day, started typing it. Someone caught it. The server was not malicious. A contractor had added an "identity check" step and reached for the easiest input channel available, which happened to be one that renders inside the user's assistant and looks exactly as trustworthy as the assistant itself.

That is the thing about elicitation. It is a genuinely useful feature: it lets a server ask the user for a parameter it is missing instead of letting the model guess one. But the request is authored by the server, and the client renders it with the full visual authority of the user's own agent. The user cannot see where the prompt came from. They see their assistant asking a question, and people answer their assistant. The gap between "the server wrote this prompt" and "the user believes the assistant is asking" is a phishing surface, and most clients render straight across it without a single check.

An MCP server sends an elicitation/create request through the client to the user; a trust gate at the client inspects the schema, blocks secret-shaped fields, attributes the asking server, and routes credential steps to an out-of-band URL mode flow instead of an in-agent form.
Figure. Elicitation as an untrusted boundary: inspect, block secrets, route to URL mode

What elicitation actually is

Elicitation is a message an MCP server can send back toward the client in the middle of handling a request. Instead of returning a result, the server sends an elicitation/create message carrying a short JSON schema that describes the fields it wants, and a prompt. The client renders something the user can fill in, and sends the answer back. The user gets three responses: accept, which returns the data; decline, an explicit no; and cancel, meaning the user dismissed the dialog without choosing. The server declares the capability at initialization and the client declares that it supports elicitation, so both sides opt in.

The design intent is sound. Picture a server that books meetings and realizes it needs a room preference the agent never captured. Rather than the model inventing "Room 4B" out of nothing, the server asks, the user answers, and the booking proceeds on real input. This is the same instinct behind a well-built human-in-the-loop approval gate: when the system is missing something only a person can supply, stop and ask instead of guessing. Elicitation packages that pattern into the protocol so any server can use it.

The spec is careful about shape. Elicitation schemas are limited to flat objects with primitive properties only: strings, numbers, booleans, enums. No nested objects, no arrays of objects. That restriction is not cosmetic. It keeps the request to something a simple form can render and a user can reason about in one glance, and it makes the request cheap to validate on the client. We are going to lean on that restriction as a security control, because a schema this simple is a schema you can fully inspect before you ever show it to a person.

Why the prompt looks trusted when it is not

Here is the part that bites. In MCP, the client sits between the user and the server and owns the interaction. When an elicitation request arrives, the client is the thing that decides what to render, how to label it, and whether to show where it came from. The server supplies the prompt string and the field names. If the client passes those through verbatim and dresses them in the assistant's own chrome, the user has no way to tell a legitimate "pick a meeting room" request from a crafted "re-enter your password" one. Both arrive through the same trusted-looking channel.

This is a confused-deputy problem wearing a UX costume. The client has the user's trust. The server borrows that trust every time the client renders a server-authored prompt as if the assistant were asking. The MCP security best practices spend most of their length on token passthrough and authorization-server validation, and they are right to, but the elicitation channel is a quieter version of the same mistake: a server reaching through the client to act with the client's authority. The spec addresses it with a flat instruction. Servers MUST NOT use elicitation to request sensitive information. That sentence is doing a lot of work, and it is doing it in the wrong place.

A rule aimed at the server is a rule the honest servers follow and the dangerous ones ignore. You already know this from supply-chain failures where a server's behavior drifts after you integrated it; the whole reason to fingerprint an MCP tool and gate on definition drift is that you cannot trust a server to stay the thing it was when you reviewed it. Elicitation is the same story with a different payload. The prompt text is attacker-controlled input in the exact cases you care about. So the enforcement has to live on the client side, where you actually control the render, not in a MUST NOT that a compromised server treats as a suggestion.

Enforce the schema the server cannot be trusted to honor

Start where the spec already gives you leverage: the schema is flat and small, so validate it completely before rendering. Reject anything that is not a flat object of primitives, because a request that violates the shape is either a broken server or one probing your client. Then, on top of structural validation, screen the field names and the prompt text for the shapes of secrets. This is a heuristic, not a proof, but it catches the overwhelmingly common cases and it costs almost nothing.

import re

SECRET_HINTS = re.compile(
    r"\b(password|passwd|api[_\s-]?key|secret|token|private[_\s-]?key|"
    r"seed[_\s-]?phrase|cvv|card[_\s-]?number|ssn|otp|2fa)\b",
    re.IGNORECASE,
)

def screen_elicitation(req: dict) -> list[str]:
    """Return reasons to block. Empty list means it passed structural checks."""
    reasons = []
    schema = req.get("requestedSchema", {})
    if schema.get("type") != "object":
        reasons.append("schema is not a flat object")
    props = schema.get("properties", {})
    for name, spec in props.items():
        # The spec forbids nested objects and object arrays. Enforce it.
        if spec.get("type") in ("object", "array"):
            reasons.append(f"field '{name}' is not a primitive")
        if SECRET_HINTS.search(name):
            reasons.append(f"field '{name}' looks like a secret")
    if SECRET_HINTS.search(req.get("message", "")):
        reasons.append("prompt text asks for a secret")
    return reasons

When screen_elicitation returns reasons, do not render the form. Return a decline to the server with a generic reason and log the attempt loudly, because a server asking for a password through a text field is either compromised or badly built, and both are things your security team wants to see today, not after the incident. Treat the block the way you would treat an output guardrail catching PII on egress: the point is not to be clever, it is to refuse the obvious bad case deterministically so a human never gets the chance to make the mistake.

The screen is a floor, not a ceiling. A patient attacker will phrase the label as "verification code" or "recovery words" in a language your regex does not cover. That is why the next two controls matter more than the keyword list: one removes the incentive by giving secrets a proper channel, and one makes abuse visible and expensive.

Secrets go out of band, never through a form

The reason form-mode elicitation is a bad place for a credential is that the credential passes through the client and often through the agent's context on its way to the server. The fix the protocol landed on is a second mode. In the draft spec, elicitation gained a URL mode alongside the original form mode. In URL mode the server does not ask for data. It hands the client a URL, and the user completes the step out of band, in a real browser, for exactly the interactions that should never touch an in-agent form: signing in, authorizing, paying. The sensitive data flows between the user and the real identity or payment provider, and the client and the agent never see it.

URL mode also closes a redirect-style phishing gap that a naive "just open a link" feature would create. The spec requires the client to get explicit user consent before opening a URL-mode link, and it requires the server to verify that the user who opens the link is the same user who started the request. That binding is the same principle behind delegated identity and scoped credentials for agents: an authorization step is only safe when it is tied to the identity that initiated it, so a captured link cannot be replayed by someone else. The result is that the one category of input you most wanted to keep out of the chat window has a channel designed to keep it out.

def route_elicitation(req: dict) -> str:
    """Decide how to handle an elicitation request before any UI appears."""
    reasons = screen_elicitation(req)
    mode = req.get("params", {}).get("mode", "form")

    if mode == "url":
        # Out-of-band. Require explicit consent and bind to the session user.
        return "prompt_user_to_open_url"  # never auto-open

    if reasons:
        # Form mode asking for a secret: refuse, do not render, alert.
        log_security_event("elicitation_blocked", req=req, reasons=reasons)
        return "decline"

    return "render_form"  # safe, non-sensitive, structurally valid

So the policy is simple to state. Non-sensitive input goes through a form you have validated. Anything that looks like a credential never gets a form at all: either the server is doing it right and using URL mode, in which case you ask the user for consent and bind the session, or it is doing it wrong and asking through a form, in which case you refuse. There is no path where a password lands in a text box inside your agent.

Attribute, rate limit, and log every request

The last layer is the one that turns a single blocked request into a signal you can act on. Every elicitation prompt the user sees must say which server is asking, by the name you registered it under, not a display string the server supplies. A user who can see "the invoices server is asking for your room preference" can notice when "the invoices server is asking for your password" is wrong. Attribution is cheap and it moves the one judgment the automated screen cannot make, is this request reasonable for this server, to a human who has the context to make it.

Rate limiting matters because elicitation is interactive and a server that fires prompts repeatedly is either broken or grinding the user toward clicking through on reflex, the same approval-fatigue failure that defeats a human approval gate when it fires too often. Bound the prompts per server per minute, and treat a server that hits the bound as a server to investigate.

import time
from collections import defaultdict

_window = defaultdict(list)  # server_id -> timestamps
LIMIT, PERIOD = 3, 60.0      # at most 3 elicitation prompts per minute

def allow_prompt(server_id: str) -> bool:
    now = time.time()
    hits = _window[server_id] = [t for t in _window[server_id] if now - t < PERIOD]
    if len(hits) >= LIMIT:
        log_security_event("elicitation_rate_limited", server=server_id)
        return False
    hits.append(now)
    return True

Log the full request on both the block path and the allow path, with the server identity, the schema, and the user's response action. You want to be able to answer, after the fact, which servers have been asking your users for what. This is the same accountability discipline that makes an audit trail of agent decisions worth the storage: the value shows up the day someone asks whether a server has been fishing for credentials, and you can answer from the record instead of a guess.

The parts that bite

A rule on the server is not a control on the client. The spec's "servers MUST NOT request sensitive information" reads like protection and provides none, because the servers you are worried about are exactly the ones that ignore it. If your client renders whatever a server sends, you have no enforcement, only a hope. The screen, the URL-mode routing, and the attribution have to live in the client, because the client is the only party in the exchange that is on your side.

Keyword screening has a long tail. The regex catches "password" and "api key." It does not catch a label written in another language, or "your special code," or a secret split across two innocuous-looking fields across two requests. Do not sell the screen as complete. It is the cheap deterministic floor under the two controls that actually scale: moving secrets to an out-of-band channel so there is nothing to phish through a form, and making every request attributable and logged so abuse is visible.

Auto-opening a URL is its own vulnerability. URL mode is safe only with the consent and identity-binding the spec requires. A client that sees a URL-mode request and opens the link automatically has rebuilt the open-redirect phishing problem the mode was meant to solve. Never open a server-supplied link without an explicit user action, and verify the opener is the initiator before you trust what comes back.

Decline and cancel are not the same, and servers will conflate them. Accept returns data, decline is an explicit refusal, cancel is a dismissal. A server that treats cancel as consent, or retries immediately on decline, is misusing the channel. Handle the three distinctly on your side and do not let a dismissed dialog become an implied yes, the same way you would not let a timed-out approval default to running the action.

This is a trust boundary, so test it like one. The elicitation path is rarely exercised in normal runs, which is exactly how safety code rots. Pin the behavior: assert a secret-shaped field is blocked, assert a URL-mode link never auto-opens, assert the rate limit trips. Treat it the way you would treat prompt-injection defenses for a tool-using agent, as a control that only earns trust when a test proves it still fires.

The takeaway

Elicitation is a good feature sitting on a dangerous default. It lets a server ask the user a question, which is often the right thing to do, through a channel that carries the user's full trust in their own assistant. Left unguarded, that channel lets any server, compromised or merely careless, render a prompt that harvests a secret from a user who has no way to see where the prompt came from. The protocol tells servers not to do this, and the servers you need to worry about will not listen.

The defense is not complicated, and it belongs on the client, where you control the render. Validate the flat schema the spec already constrains, refuse the fields and prompts that look like secrets, send anything credential-shaped to URL mode so it completes out of band and never touches the chat, attribute every request to the server that sent it, rate limit the interactive channel, and log both the blocks and the passes. A few hundred lines turns elicitation from a phishing surface into what it was meant to be: a server asking a reasonable question, with the user able to see who is asking. If your agents are starting to use interactive MCP servers, this is worth building before a server asks one of your users for a password and they answer. Book a consultation call and we can map the elicitation paths in your stack and put the gate where it belongs.

ShareXLinkedInviralruparel.com/blog/mcp-elicitation-trust-boundary-credential-phishing

Questions this essay answers

01What is elicitation in the Model Context Protocol?

Elicitation is a protocol feature that lets an MCP server pause mid request and ask the user for structured input through the client. The server sends an elicitation/create message with a JSON schema describing the fields it wants, the client renders a form, and the user can accept, decline, or cancel. It exists so a server can gather a missing parameter without the agent hallucinating one. The catch is that the request originates with the server, so the client is rendering a prompt written by code you may not fully trust, and that is the surface this essay is about.

02Can an MCP server steal credentials through elicitation?

It can if the client does not guard the boundary. The server controls the prompt text and the field labels, so a compromised or careless server can render a form that reads "Enter your API key to continue," and a user who trusts their assistant will type it. The spec says servers must not request sensitive information through elicitation, but that is a rule on the server, not an enforced control. The client has to refuse secret-shaped fields, attribute the asking server by name, and route anything that smells like a credential to an out-of-band flow instead of an in-agent form.

03What is URL mode elicitation and why does it exist?

URL mode is a newer elicitation mode where the server, instead of asking for data through a form, hands the client a URL and the user completes the step out of band, in a browser, for things like signing in or paying. The data never passes through the client or the agent context. It exists precisely because form-mode elicitation is the wrong channel for secrets. The spec requires the client to get explicit consent before opening the link and to verify that the user who opens it is the one who started the request, which closes a redirect-style phishing gap.

04How is elicitation different from a human-in-the-loop approval gate?

An approval gate is something you build: it pauses your agent before a risky tool call and asks a human to approve the exact action. Elicitation is the reverse direction, a server asking the user for input that the server needs, and it is initiated by code outside your trust boundary. An approval gate protects against your agent doing the wrong thing. Elicitation guarding protects against a server abusing the channel it was given to collect data it should not have. You want both, and they sit at different points in the flow.

Working on this in production?I help teams make agents like this reliable. Thirty minutes, no pitch.
Viral Ruparel

Generative AI consultant and full-stack architect. Ex-IBM, former Director of Engineering at a YC W20 startup. Writes about what breaks when agents meet reality.