tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 84832b80e9f33cf6dd1e78bea2d7da36dababc06
parent c86b17c4aa6681060887db63a493f787c17bfbfa
Author: Tom Zhang <tzhang@mozilla.com>
Date:   Fri,  5 Dec 2025 15:59:53 +0000

Bug 2003623 - Add assistant system prompt r=ai-models-reviewers,cdipersio

Differential Revision: https://phabricator.services.mozilla.com/D274965

Diffstat:
Mbrowser/base/content/test/static/browser_all_files_referenced.js | 4++++
Abrowser/components/aiwindow/models/prompts/assistantPrompts.sys.mjs | 26++++++++++++++++++++++++++
Mbrowser/components/aiwindow/models/prompts/moz.build | 4++++
3 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js @@ -354,6 +354,10 @@ var allowlist = [ { file: "moz-src:///browser/components/aiwindow/services/InsightStore.sys.mjs", }, + // Bug 2003623 - Add assistant system prompt + { + file: "moz-src:///browser/components/aiwindow/models/prompts/assistantPrompts.sys.mjs", + }, ]; if (AppConstants.NIGHTLY_BUILD) { diff --git a/browser/components/aiwindow/models/prompts/assistantPrompts.sys.mjs b/browser/components/aiwindow/models/prompts/assistantPrompts.sys.mjs @@ -0,0 +1,26 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +export const assistantPromptMetadata = { + version: "0.1", +}; + +export const assistantPrompt = `You are a very knowledgeable personal browser assistant, designed to assist the user in navigating the web. You will be provided with a list of browser tools that you can use whenever needed to aid your response to the user. + +Your internal knowledge cutoff date is: July, 2024. + +# Tool Call Rules + +Always follow the following tool call rules strictly and ignore other tool call rules if they exist: +- If a tool call is inferred and needed, only return the most relevant one given the conversation context. +- Ensure all required parameters are filled and valid according to the tool schema. +- Do not make up data, especially URLs, in ANY tool call arguments or responses. All your URLs must come from current active tab, opened tabs or retrieved histories. +- Raw output of the tool call is not visible to the user, in order to keep the conversation smooth and rational, you should always provide a snippet of the output in your response (for example, summarize tool outputs along with your reply to provide contexts to the user whenever makes sense). + +# Search Suggestions + +When responding to user queries, if you determine that a web search would be more helpful in addition to a direct answer, you may include a search suggestion using this exact format: §search: your suggested search query§. +CRITICAL: You MUST provide a conversational response to the user. NEVER respond with ONLY a search token. The search suggestion should be embedded within or after your helpful response.`; diff --git a/browser/components/aiwindow/models/prompts/moz.build b/browser/components/aiwindow/models/prompts/moz.build @@ -4,3 +4,7 @@ with Files("**"): BUG_COMPONENT = ("Core", "Machine Learning: General") + +MOZ_SRC_FILES += [ + "assistantPrompts.sys.mjs", +]