Skip to content

Enhance AI network access control for integrated browser - #328880

Draft
dmitrivMS wants to merge 1 commit into
mainfrom
dev/dmitriv/integrate-browser-network-filter
Draft

Enhance AI network access control for integrated browser#328880
dmitrivMS wants to merge 1 commit into
mainfrom
dev/dmitriv/integrate-browser-network-filter

Conversation

@dmitrivMS

Copy link
Copy Markdown
Contributor

No description provided.

@dmitrivMS
dmitrivMS requested review from jruales and kycutler August 4, 2026 01:16
@dmitrivMS dmitrivMS self-assigned this Aug 4, 2026
Copilot AI review requested due to automatic review settings August 4, 2026 01:16
@dmitrivMS dmitrivMS added security browser-integration Web browsing features integrated into VS Code (e.g. integrated browser) labels Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens integrated-browser network policy enforcement across Electron requests, Playwright actions, screenshots, and page sharing.

Changes:

  • Adds per-view request filtering and retained policy errors in Electron sessions.
  • Validates frame URLs before and after Playwright/screenshot operations.
  • Adds unit and extension-level coverage for denied frames, redirects, and allowed complex pages.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/test/electron-browser/tools/screenshotBrowserTool.test.ts Tests screenshot policy checks and telemetry.
src/vs/workbench/contrib/browserView/test/common/browserViewModelSharing.test.ts Tests sharing lifecycle and denied URLs.
src/vs/workbench/contrib/browserView/electron-browser/tools/screenshotBrowserTool.ts Brackets screenshot capture with policy validation.
src/vs/workbench/contrib/browserView/common/browserView.ts Exposes policy errors through the renderer model.
src/vs/platform/browserView/test/node/playwrightTab.test.ts Tests frame and action policy enforcement.
src/vs/platform/browserView/test/electron-main/browserViewNetworkFilter.test.ts Tests filtering-source lifecycle.
src/vs/platform/browserView/test/electron-main/browserSessionNetworkFilter.test.ts Tests Electron request filtering behavior.
src/vs/platform/browserView/node/playwrightTab.ts Applies policy checks to frames, actions, summaries, and logs.
src/vs/platform/browserView/electron-main/browserViewMainService.ts Exposes main-process policy errors.
src/vs/platform/browserView/electron-main/browserViewGroup.ts Toggles filtering with agent group membership.
src/vs/platform/browserView/electron-main/browserViewAgentNetworkFilter.ts Tracks agent filtering sources.
src/vs/platform/browserView/electron-main/browserView.ts Connects each native view to session filtering.
src/vs/platform/browserView/electron-main/browserSessionNetworkFilter.ts Implements per-WebContents request filtering.
src/vs/platform/browserView/electron-main/browserSession.ts Installs the Electron request interceptor.
src/vs/platform/browserView/common/browserView.ts Adds the cross-process policy-error operation.
extensions/vscode-api-tests/src/singlefolder-tests/browser.tools.test.ts Adds end-to-end browser-tool policy scenarios.

Review details

  • Files reviewed: 16/16 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment on lines 275 to +278
override dispose(): void {
for (const view of this.views.values()) {
setBrowserViewGroupAgentNetworkFiltering(view, this.owner, false);
}
Comment on lines +40 to +42
if (webContentsId === undefined || !this.filteredWebContents.has(webContentsId)) {
callback({ cancel: false });
return;
Comment on lines +228 to 230
// When the current page or any frame is blocked by network policy, return only a
// policy error — do not expose title, URL, console logs, or snapshot to
// avoid prompt-injection via blocked content.
Comment on lines +54 to +56
const allowed = this.agentNetworkFilterService.isUriAllowed(uri);
if (!allowed) {
this.policyErrors.set(webContentsId, this.agentNetworkFilterService.formatError(uri));
*/
getSelectedText(id: string): Promise<string>;

getNetworkPolicyError(id: string): Promise<string | undefined>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

browser-integration Web browsing features integrated into VS Code (e.g. integrated browser) security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants