fix(browser): add proxy bypass constraint to domain restriction system prompt (#23229)

Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>
This commit is contained in:
tony-shi
2026-03-25 23:59:21 +08:00
committed by GitHub
parent bbf5c2fe95
commit 6deee11449
2 changed files with 2 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ export function buildBrowserSystemPrompt(
.map((d) => `- ${d}`)
.join(
'\n',
)}\nDo NOT attempt to navigate to any other domains using new_page or navigate_page, as it will be rejected. This is a hard security constraint.`
)}\nDo NOT attempt to navigate to any other domains using new_page or navigate_page, as it will be rejected. This is a hard security constraint.\nDo NOT use proxy services (e.g. Google Translate, Google AMP, or any URL translation/caching service) to access content from domains outside this list. Embedding a blocked URL as a parameter of an allowed-domain service is a direct violation of this security restriction.`
: '';
return `You are an expert browser automation agent (Orchestrator). Your goal is to completely fulfill the user's request.${allowedDomainsInstruction}

View File

@@ -467,6 +467,7 @@ describe('buildBrowserSystemPrompt', () => {
expect(prompt).toContain('SECURITY DOMAIN RESTRICTION - CRITICAL:');
expect(prompt).toContain('- github.com');
expect(prompt).toContain('- *.google.com');
expect(prompt).toContain('Do NOT use proxy services');
});
it('should exclude allowed domains restriction when not provided or empty', () => {