Skip to content

Commit 401e948

Browse files
authored
Always show warning about untrusted content from fetch tool (#254727)
* Always show warning about untrusted content from fetch tool Fix #254654 * Put info icon back
1 parent ffd3f6f commit 401e948

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/vs/workbench/contrib/chat/electron-browser/tools/fetchPageTool.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,22 @@ export class FetchWebPageTool implements IToolImpl {
203203
if (urlsNeedingConfirmation.length === 1) {
204204
confirmationTitle = localize('fetchWebPage.confirmationTitle.singular', 'Fetch web page?');
205205
confirmationMessage = new MarkdownString(
206-
urlsNeedingConfirmation[0].toString() + '\n\n$(info) ' +
207-
localize('fetchWebPage.confirmationMessage.singular', 'Web content may contain malicious code or attempt prompt injection attacks.'),
206+
urlsNeedingConfirmation[0].toString(),
208207
{ supportThemeIcons: true }
209208
);
210209
} else {
211210
confirmationTitle = localize('fetchWebPage.confirmationTitle.plural', 'Fetch web pages?');
212211
confirmationMessage = new MarkdownString(
213-
urlsNeedingConfirmation.map(uri => `- ${uri.toString()}`).join('\n') + '\n\n$(info) ' +
214-
localize('fetchWebPage.confirmationMessage.plural', 'Web content may contain malicious code or attempt prompt injection attacks.'),
212+
urlsNeedingConfirmation.map(uri => `- ${uri.toString()}`).join('\n'),
215213
{ supportThemeIcons: true }
216214
);
217215
}
218-
result.confirmationMessages = { title: confirmationTitle, message: confirmationMessage, allowAutoConfirm: true };
216+
result.confirmationMessages = {
217+
title: confirmationTitle,
218+
message: confirmationMessage,
219+
allowAutoConfirm: true,
220+
disclaimer: new MarkdownString('$(info) ' + localize('fetchWebPage.confirmationMessage.plural', 'Web content may contain malicious code or attempt prompt injection attacks.'), { supportThemeIcons: true })
221+
};
219222
}
220223
return result;
221224
}

0 commit comments

Comments
 (0)