Skip to content
LyraShield AIOpen beta

WebMCP Assurance

WebMCP Assurance — Definition, Risks, and 10 Security Controls

What WebMCP is, why browser-native agent tools need review, the 10 WebMCP assurance controls, and how to check your source locally before release.

What is WebMCP?

WebMCP is an emerging browser protocol that lets a web page expose JavaScript functions or declarative form tools to an AI agent. The page can register a tool with document.modelContext.registerTool() or mark up a form with toolname, tooldescription, and toolautosubmit. When the protocol is available, the agent can discover and call those tools directly from the page.

This is different from a coding-agent MCP server. WebMCP is scoped to the current browser origin and the tools the page chooses to register. It is also experimental: support, behavior, and security boundaries may change as the protocol evolves.

Why WebMCP tools need review

A browser tool can read data, trigger UI changes, or start network requests. If the tool annotations do not match the implementation, an agent may call a durable mutation thinking it is read-only, send data to an unexpected origin, or skip a confirmation step. Because the tools are exposed to the page origin, misconfigured headers or cross-origin iframes can widen that surface.

LyraShield's approach is to treat WebMCP as part of the release surface: discover the registered tools, check their behavior against the 10 controls, prepare a bounded diff, and rerun the check before applying anything. No tool is automatically trusted just because it has a clean schema.

The 10 WebMCP controls

Machine-readable registry

Each control has a stable ID, severity, and evidence state. A result is a signal for review, not a claim that the condition is exploitable. The registry is versioned as webmcp-assurance/1.

WEBMCP-05 · Durable/resource-consuming mutation lacks visible confirmation boundary

CRITICAL

A tool performs a durable, resource-consuming, or otherwise destructive mutation without a visible human confirmation step.

Negative evidence: Every mutation tool in supported files shows an explicit confirmation prompt or is prepared for the user to review before submission.

What to do: Add a visible confirmation step before any durable mutation. For declarative forms, omit toolautosubmit and require the user to click Submit.

WEBMCP-01 · WebMCP annotation/behavior mismatch

HIGH

A tool claims to be read-only or safe but its implementation performs mutation, network calls, or handles untrusted content inconsistently with its annotations.

Negative evidence: Every tool's readOnlyHint, untrustedContentHint, and behavior classification are consistent with its execute body and schema.

What to do: Align the tool's annotations with its behavior. Add untrustedContentHint for externally sourced output and remove readOnlyHint when the tool mutates state.

WEBMCP-03 · Unsafe or dynamic cross-origin tool exposure

HIGH

A tool is exposed to an untrusted origin, a wildcard, or a value that cannot be resolved at analysis time.

Negative evidence: Every exposedTo value is a precise same-origin or explicitly trusted origin list and is not dynamic.

What to do: Scope exposedTo to the minimum required origins. Replace dynamic or wildcard exposure with an explicit allowlist.

WEBMCP-04 · Explicitly unsafe tool permissions or disabled origin isolation

HIGH

The site or config exposes tools broadly through Permissions-Policy: tools=*, Origin-Agent-Cluster: ?0, document.domain manipulation, or delegated cross-origin iframes.

Negative evidence: No Permissions-Policy wildcard, no OAC ?0, no document.domain assignment, and no delegated tool iframe is present in assessed source.

What to do: Add Origin-Agent-Cluster: ?1, keep Permissions-Policy tools=(self), remove document.domain assignments, and avoid cross-origin tool delegation.

WEBMCP-09 · Weak schema or missing runtime validation at a trust boundary

HIGH

A tool accepts structured input without a closed schema, type checks, or a validation library at the trust boundary.

Negative evidence: Every supported tool has a closed object schema and uses explicit runtime validation before acting on input.

What to do: Define a strict JSON Schema, set additionalProperties: false for object inputs, and add runtime validation before using tool input.

WEBMCP-02 · Externally influenced output lacks untrusted content hint

MEDIUM

A tool fetches or returns content from an external origin, user, or unvalidated source but does not set untrustedContentHint.

Negative evidence: Every tool that returns external, user-generated, or otherwise unvalidated content sets untrustedContentHint.

What to do: Set untrustedContentHint for tools whose output is sourced from or influenced by external content.

WEBMCP-06 · Sensitive or unbounded input/output contract

MEDIUM

A tool accepts or returns unbounded, sensitive, or poorly described data without limits or closed schema constraints.

Negative evidence: Every supported tool schema has bounded string/array lengths, closed object schemas with additionalProperties: false where safe, and descriptions for sensitive fields.

What to do: Add maxLength, maxItems, additionalProperties: false, and clear descriptions. Bound output arrays and mark sensitive parameters.

WEBMCP-07 · Network operation does not forward cancellation

MEDIUM

A tool starts a network request but does not pass the AbortSignal through to fetch, leaving in-flight requests after the caller cancels.

Negative evidence: Every supported network call forwards the tool's AbortSignal to the underlying fetch or request.

What to do: Forward { signal } into every fetch call inside the tool's execute body and handle the resulting AbortError.

WEBMCP-08 · Component registration lacks lifecycle cleanup

MEDIUM

A tool is registered inside a component or effect without a corresponding cleanup that unregisters it when the context is destroyed.

Negative evidence: Every supported registration returns or uses an AbortController/abort handler that unregisters the tool on cleanup.

What to do: Store the registration handle and unregister it in the component or effect cleanup path.

WEBMCP-10 · Duplicate, overlapping, ambiguous, or misleading tool contract

MEDIUM

Two or more tools share a name, have misleading titles or descriptions, or overlap so much that an agent cannot choose safely.

Negative evidence: Every tool has a unique name, a clear title and description, and a distinct purpose.

What to do: Rename, merge, or clarify duplicate tools so each has a unique name and a distinct, honest description.

Methodology

  1. 1Discover imperative registerTool calls and declarative forms with tool attributes, plus header and config exposure.
  2. 2Normalize each tool surface into a stable model with annotations, schema, behavior, network methods, and source range.
  3. 3Evaluate each control and emit an evidence state: DETECTED, NO_FINDING, INCONCLUSIVE, or NOT_ASSESSED.
  4. 4Prepare a bounded, non-overlapping rewrite diff for supported findings and show it for review.
  5. 5Rerun the check after applying the diff in memory before any real repository change.

CLI and CI

The LyraShield CLI can include WebMCP findings in lyrashield check-diff. You can fail a gate on HIGH or CRITICAL findings and export SARIF for GitHub Advanced Security. The GitHub Action uses the same gate and posts findings as annotations.

Limitations

  • Static discovery cannot resolve dynamic behavior, runtime values, or server-side context.
  • A NO_FINDING for a control only means the specific syntactic condition was not observed, not that the whole application is secure.
  • WebMCP is experimental. Browsers that do not support it cannot execute the registered tools even if the page registers them.
  • The free checker does not upload source, but it also does not replace a full repository scan, retest, or evidence-backed report.

Questions

What is WebMCP?

WebMCP is an emerging browser protocol that lets a web page register tools for an AI agent through document.modelContext.registerTool or declarative form attributes. It is experimental and not yet supported in every browser.

Does WebMCP improve search rankings?

No. WebMCP may help an agent understand what your page can do, but it is not a ranking, indexing, or citation guarantee.

What does the free checker do?

It analyzes selected source files or pasted code entirely in your browser for 10 WebMCP controls, prepares a bounded rewrite diff, and exports JSON, Markdown, or SARIF. Nothing is uploaded.

Can the tool rewrite my repository automatically?

No. The lab applies rewrites only in memory so you can review them. Repository-level fix proposals require an authenticated account and explicit approval.

Try the checker

Open the WebMCP Security Checker, load the unsafe sample, and review the 10 controls without creating an account. The check runs in your browser and nothing is uploaded.

Open the WebMCP Security Checker