Skip to content

Commit a99ffd2

Browse files
authored
Spec untrustedContentHint (#169)
1 parent e1ddba1 commit a99ffd2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

index.bs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ A <dfn>tool definition</dfn> is a [=struct=] with the following [=struct/items=]
155155

156156
: <dfn>read-only hint</dfn>
157157
:: a [=boolean=], initially false.
158+
159+
: <dfn>untrusted content hint</dfn>
160+
:: a [=boolean=], initially false.
158161
</dl>
159162

160163
<div algorithm>
@@ -263,6 +266,9 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var
263266
1. Let |read-only hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and
264267
its {{ToolAnnotations/readOnlyHint}} is true. Otherwise, let it be false.
265268

269+
1. Let |untrusted content hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and
270+
its {{ToolAnnotations/untrustedContentHint}} is true. Otherwise, let it be false.
271+
266272
1. Let |signal| be |options|'s {{ModelContextRegisterToolOptions/signal}}.
267273

268274
1. If |signal| [=map/exists=], then:
@@ -294,6 +300,9 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var
294300
: [=tool definition/read-only hint=]
295301
:: |read-only hint|
296302

303+
: [=tool definition/untrusted content hint=]
304+
:: |untrusted content hint|
305+
297306
1. Set [=this=]'s [=ModelContext/internal context=][|tool name|] to |tool definition|.
298307

299308
</div>
@@ -316,6 +325,7 @@ dictionary ModelContextTool {
316325

317326
dictionary ToolAnnotations {
318327
boolean readOnlyHint = false;
328+
boolean untrustedContentHint = false;
319329
};
320330

321331
callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient client);
@@ -362,6 +372,10 @@ The {{ToolAnnotations}} dictionary provides optional metadata about a tool:
362372
<dl class="domintro" dfn-type=dict-member dfn-for=ToolAnnotations>
363373
: <dfn>readOnlyHint</dfn>
364374
:: If true, indicates that the tool does not modify any state and only reads data. This hint can help [=agents=] make decisions about when it is safe to call the tool.
375+
376+
: <dfn>untrustedContentHint</dfn>
377+
:: If true, indicates that the tool's output contains data that is untrusted, from the perspective
378+
of the author registering the tool.
365379
</dl>
366380

367381
<h4 id="model-context-register-tool-options">ModelContextRegisterToolOptions Dictionary</h4>

0 commit comments

Comments
 (0)