Webmcp security

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Webmcp security is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Implement WebMCP security best practices — permission model, data minimization, honest descriptions, input validation, fingerprinting prevention, and fraud mitigation. Use when auditing or hardening WebMCP tool implementations.

How to use this skill

Skill file

WebMCP Security

Before writing code

Fetch live docs:

  1. Fetch https://webmachinelearning.github.io/webmcp/ for security-related sections of the specification
  2. Web-search webmcp security privacy permission model for security architecture details
  3. Web-search site:github.com mcp-b security for polyfill security guidelines
  4. Web-search webmcp fingerprinting data minimization for privacy best practices

Conceptual Architecture

Permission-First Design

WebMCP's security model is permission-first:

  1. The site defines what tools exist (tool registration)
  2. The browser mediates — prompts the user before allowing agent invocation
  3. The user grants or denies permission per tool or per session
  4. Annotations (destructiveHint, readOnlyHint) inform browser permission decisions
  5. Tools execute within the page's secure context (same-origin, HTTPS required)

Threat Model

| Threat | Description | Mitigation |

|--------|-------------|------------|

| Deceptive tool descriptions | Tool named "addToCart" actually charges the user | Honest descriptions; browser/audit verification |

| Agent hallucination | Agent calls wrong tool or passes bad parameters | Schema validation; user confirmation for high-risk tools |

| Over-parameterization | Tool requests excessive personal data from agent | Data minimization; server-side session lookups |

| Fingerprinting | Tool parameters reveal user attributes | Minimal input schemas; avoid asking for identity data |

| Rapid automation abuse | Agent makes rapid repeated transactions | Server-side rate limiting; CAPTCHA for bulk operations |

| Cross-origin data leak | Tool exposes data from another origin | Same-origin enforcement; browser sandboxing |

| Session hijacking | Tool's session exploited by malicious agent | Standard CSRF protection; secure cookie flags |

| Prompt injection | Malicious content in tool results manipulates agent | Output sanitization; structured JSON responses |

Honest Descriptions

Tool descriptions are a critical security surface:

Data Minimization

Minimize the data tools request from agents:

Bad — over-parameterized:

// DON'T: asking agent to supply user's personal data
inputSchema: {
  properties: {
    userId: { type: "string" },
    email: { type: "string" },
    shippingAddress: { type: "object" },
    creditCardLast4: { type: "string" }
  }
}

Good — minimal, server-side lookup:

// DO: only take what's needed, look up user data server-side
inputSchema: {
  properties: {
    productId: { type: "string" },
    quantity: { type: "integer" }
  }
}
// execute callback uses session cookies to identify the user server-side

Input Validation

Always validate tool input:

Rate Limiting

Protect against agent abuse:

Audit Logging

Log all agent interactions:

Liability Considerations

Best Practices Checklist

Fetch the specification for the latest security requirements, permission model details, and browser enforcement behavior before auditing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.