From adfce583894ec589bba7877994b3a94b5cdbbb66 Mon Sep 17 00:00:00 2001 From: Aleksei Aleinikov Date: Sat, 7 Nov 2026 10:41:44 +0200 Subject: [PATCH 1/2] Document invisible characters in tool metadata in security considerations Fixes #360 --- index.bs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/index.bs b/index.bs index 847677e..c93915b 100644 --- a/index.bs +++ b/index.bs @@ -2149,6 +2149,44 @@ page, protecting against malicious scripts or dependencies from using WebMCP API **How:** This restriction would not fully solve prompt injection attacks but helps shrink the possible universe of attacks, preventing longer prompts that leverage e.g. repetition and sockpuppetting [[SOCKPUPPETTING]] to convince agents of malicious tasks. The specification already implements a nominal size restriction of 128 characters for the tool {{ModelContextTool/name}} (see [[#supporting-concepts]]), but further work is needed to evaluate the right size limits for titles, names, and other inputs. See [Issue #73](https://github.com/webmachinelearning/webmcp/issues/73). +

Handling invisible characters in tool metadata

+ +**What:** Normalizing or exposing characters in tool metadata that are passed to the model but are +not visible when the text is displayed. + +**Threats addressed:** [[#metadata-description-attacks]] + +**How:** A tool's {{ModelContextTool/title}}, {{ModelContextTool/description}}, and the strings in +its {{ModelContextTool/inputSchema}} and {{ModelContextTool/outputSchema}} can contain characters +that take no space on screen: Unicode tag characters (U+E0000 to U+E007F), which can encode ASCII +text, zero-width characters, and bidirectional formatting controls that change the displayed order of +text. An instruction hidden this way is no more persuasive to a model than a visible one, but it is +missed by anything that relies on the displayed text, such as code review, a tool list or +confirmation prompt shown to the user, or a guardrail that matches keywords or uses a small model. +This matters most when a script that the site author does not control registers tools on the page. +Tool names are limited to ASCII (see [[#supporting-concepts]]) and are not affected. Length limits +([[#mitigation-restrict-input-lengths]]) do not help, because many of these characters fit within any +practical limit. + +[=Agents=] and guardrails that inspect tool metadata are encouraged to: + +

Supporting interoperable probabilistic defense structures through shared attack eval datasets

**What:** Shared evals for prompt injection attacks against WebMCP From a9d758002788e56192d6cd3a712959e40b3702cc Mon Sep 17 00:00:00 2001 From: Aleksei Aleinikov Date: Wed, 11 Nov 2026 05:33:00 +0000 Subject: [PATCH 2/2] Recommend rejecting invisible characters in tool metadata --- index.bs | 56 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/index.bs b/index.bs index c93915b..3f38945 100644 --- a/index.bs +++ b/index.bs @@ -2151,8 +2151,8 @@ page, protecting against malicious scripts or dependencies from using WebMCP API

Handling invisible characters in tool metadata

-**What:** Normalizing or exposing characters in tool metadata that are passed to the model but are -not visible when the text is displayed. +**What:** Rejecting tool registrations with invisible characters in metadata, rather than silently +removing those characters. **Threats addressed:** [[#metadata-description-attacks]] @@ -2168,25 +2168,47 @@ Tool names are limited to ASCII (see [[#supporting-concepts]]) and are not affec ([[#mitigation-restrict-input-lengths]]) do not help, because many of these characters fit within any practical limit. -[=Agents=] and guardrails that inspect tool metadata are encouraged to: +Rejecting a registration lets the developer fix the text rather than having the host silently change +it. Stripping descriptive text changes what the developer wrote; stripping property names or values +such as `enum`, `const`, and `default` also changes what the tool accepts or receives. Implementers +considering registration-time validation are encouraged to: +This guidance does not add a rejection step to {{ModelContext/registerTool()}}. A normative +registration check would need an interoperable definition of the Unicode version, any exceptions, +the schema checks, and the rejection behavior. +

Supporting interoperable probabilistic defense structures through shared attack eval datasets

**What:** Shared evals for prompt injection attacks against WebMCP