Skip to content

Commit 2d5b9b9

Browse files
Merge branch 'main' of github.com:webmachinelearning/webmcp into events
2 parents dba8376 + a816d2e commit 2d5b9b9

3 files changed

Lines changed: 410 additions & 46 deletions

File tree

docs/proposal.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Handling tool calls in the main thread with the option of delegating to workers
4040
- **Fine-grained permissions**: Tool calls are mediated through the browser, so the user has the opportunity to review the requesting client apps and provide consent.
4141
- **Developer involvement**: Encourages developer involvement in the agentic web, required for a thriving web. Reduces the need for solutions like UI automation where the developer is not involved, improving privacy, reducing site expenses, and a better customer experience.
4242
- **Seamless integration**: Since tool calls are handled locally on a real browser, the agent can interleave these calls with human input when necessary (e.g. for consent, auth flows, dialogs, etc.).
43-
- **Accessibility**: Bringing tools to webpages via may help users with accessibility needs by allowing them to complete the same job-to-be-done via agentic or conversational interfaces instead of relying on the accessibility tree, which many websites have not implemented.
43+
- **Accessibility**: Bringing tools to webpages via WebMCP may help users with accessibility needs by allowing them to complete the same job-to-be-done via agentic or conversational interfaces instead of relying on the accessibility tree, which many websites have not implemented.
4444

4545
## Limitations of this design
4646

@@ -54,27 +54,30 @@ Handling tool calls in the main thread with the option of delegating to workers
5454
### modelContext
5555
The `window.navigator.modelContext` interface is introduced for the site to declare functionality that can be used by an AI Agent. Access to these tools is arbitrated by the browser.
5656

57-
The `modelContext`'s `registerTool()` and `unregisterTool()` methods are used to add and remove tools from the agent's context.
57+
The `modelContext`'s `registerTool()` method is used to add and remove tools from the agent's context.
5858

5959
```js
60-
window.navigator.modelContext.registerTool({
61-
execute:
62-
({ text }, agent) => {
63-
// Add todo item and update UI.
64-
return /* structured content response */
65-
},
66-
name: "add-todo",
67-
description: "Add a new todo item to the list",
68-
inputSchema: {
69-
type: "object",
70-
properties: {
71-
text: { type: "string", description: "The text of the todo item" }
72-
},
73-
required: ["text"]
74-
},
75-
});
60+
const addTodoTool = {
61+
execute: ({ text }, agent) => {
62+
// Add todo item and update UI.
63+
return /* structured content response */
64+
},
65+
name: "add-todo",
66+
description: "Add a new todo item to the list",
67+
inputSchema: {
68+
type: "object",
69+
properties: {
70+
text: { type: "string", description: "The text of the todo item" }
71+
},
72+
required: ["text"]
73+
},
74+
};
75+
const controller = new AbortController();
76+
77+
window.navigator.modelContext.registerTool(addTodoTool, { signal: controller.signal });
7678

77-
window.navigator.modelContext.unregisterTool("add-todo");
79+
// Unregister tool later...
80+
controller.abort();
7881
```
7982

8083
### agent

docs/security-privacy-considerations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ To advance the security and privacy posture of WebMCP, we need community input o
360360

361361
**How:** Ensuring an interoperable basis for prompt injection defense, by requiring any implementer to protect against at least the attacks in that dataset
362362

363+
#### [Untrusted Annotation for Tool Responses](https://github.com/webmachinelearning/webmcp/issues/136)
364+
365+
**What:** Giving agents information about trust boundaries such as highlighting untrustworthy content to the model using an untrusted annotation.
366+
367+
**Threats addressed:** Prompt Injection Attacks (Output Injection Attacks)
368+
369+
**How:** A boolean `ToolAnnotations.untrustedContentHint = true` annotation that acts as a signal to the client that the payload requires heightened security handling, allowing the client to sanitize the payload, use indicators such as spotlighting to highlight untrustworthy content to the model, or hide that part of the response entirely.
370+
363371
... add more issues here
364372

365373
## Next Steps

0 commit comments

Comments
 (0)