AI coding agents are becoming capable of doing more than reading source code and generating suggestions. They can open websites, navigate application pages, fill out forms, interact with buttons, and test complete user workflows.
For developers, this creates an interesting opportunity. Instead of asking an AI assistant to inspect HTML and guess whether a web application works, you can let it open the application in a browser and test the actual user experience.
However, giving an AI agent access to a browser introduces security and privacy concerns. Your browser may contain signed-in accounts, personal information, saved sessions, and access to internal business applications. Allowing an agent to interact with everything in your browser without restrictions is not a good approach.
GitHub Copilot provides browser use capabilities that allow agents to interact with websites through a browser extension. Developers can enable this functionality when needed and retain control over browser access.
This article explains how GitHub Copilot browser use works, how to configure it, how browser sessions are isolated, and how to reduce the risks associated with giving an AI agent access to websites.
Understanding Browser Use in GitHub Copilot
Browser use allows GitHub Copilot to interact with websites as part of an agent task.
For example, suppose you are developing an ASP.NET Core application with a React frontend. You have implemented a registration form and want to verify that validation messages appear correctly.
Traditionally, you would start the application, open the browser, enter test data, submit the form, and inspect the results manually.
With browser use enabled, you can ask Copilot to perform these steps.
For example:
Open my local application and test the registration form. Submit it with empty fields, invalid email addresses, and valid information. Verify that the correct validation messages appear. Do not use real personal information or create actual accounts.
Copilot can navigate to the application, interact with the form, inspect the results, and report what happened.
Depending on the task, it can also capture screenshots and use the results to help identify problems.
Browser use is available through several Copilot surfaces, including GitHub Copilot CLI, the GitHub Copilot app, Visual Studio Code, and JetBrains IDEs.
The feature is currently in public preview and may change.
Why Browser Access Needs Restrictions
A browser is not simply a tool for opening websites. It is also a gateway to information and services that a developer may already be authenticated to use.
Consider a developer who has several browser tabs open:
- A local application running on localhost.
- A GitHub account containing private repositories.
- An internal company dashboard.
- An email account.
- A cloud management portal.
If an AI agent can access every existing browser tab automatically, it could potentially read information or perform actions that were never part of the original task.
Even an innocent instruction can create unexpected behavior when the agent encounters a webpage containing misleading instructions or unfamiliar controls.
For example, an agent asked to inspect a dashboard might encounter a button that permanently deletes a record. If the task is not clearly defined, the agent could misunderstand the expected action.
This is why browser access should be limited to the websites and actions required for a particular task.
GitHub's browser use implementation requires developers to enable the feature rather than granting unrestricted access automatically. Browser interactions should still be reviewed, especially when they involve changing data or interacting with other people's accounts.
How Browser Use Works
GitHub Copilot browser use relies on a browser extension and the Copilot client running the agent.
The general process is straightforward.
First, the developer installs the GitHub Copilot browser extension in Google Chrome or Microsoft Edge.
Next, browser use is enabled in the selected Copilot environment.
When the developer requests a browser-related task, Copilot can use the browser integration to navigate pages and interact with website elements.
The agent can perform actions such as:
- Opening a webpage.
- Navigating between pages.
- Clicking buttons and links.
- Entering text into forms.
- Reading visible webpage content.
- Testing application workflows.
- Retrieving information from a webpage.
The browser extension provides the connection between the browser and the Copilot agent.
The important point is that browser access is an explicitly enabled capability. Installing the extension alone does not mean every Copilot session automatically has unrestricted access to your browser.
Setting Up Browser Use in GitHub Copilot CLI
Let's configure browser use with GitHub Copilot CLI.
Before starting, make sure you have the following:
- GitHub Copilot CLI installed.
- An authenticated GitHub account with Copilot access.
- Google Chrome or Microsoft Edge installed.
- Node.js 22 or later available on your PATH.
- The GitHub Copilot browser extension installed.
Start by checking your Node.js version:
node --version
The installed version should be 22 or later.
Next, open Chrome or Microsoft Edge and install the GitHub Copilot extension from the Chrome Web Store.
Start an interactive Copilot CLI session:
copilot
Inside the session, open the plugin interface:
/plugin
Find the browser-use plugin and enable it.
After enabling the plugin, start a new Copilot CLI session so the browser integration can become available.
You can optionally click the browser extension icon and verify that its connection status shows Connected.
If Copilot cannot connect to the browser, run the diagnostic command:
/browser-use:doctor
This helps identify common setup and connection problems.
Once the configuration is complete, you can give Copilot browser-related instructions directly.
For example:
Open github.com in my browser and find the repository settings page. Do not change any settings. Show me the information you can access.
This gives the agent a clear task while explicitly preventing configuration changes.
Using Browser Use With Visual Studio Code
Developers using Visual Studio Code can also work with browser tools directly from agent sessions.
Browser tools are built into the VS Code agent experience. They allow an agent to open a page, interact with a web application, inspect page content, and investigate browser errors.
To get started, open Visual Studio Code and start a new agent session.
Make sure the browser tools are enabled through the browser settings and available in the agent's configured tools.
The relevant setting is:
workbench.browser.enableChatTools
When enabled, the agent can use the integrated browser tools.
For example, you can ask:
Start my React application and open it in the browser. Test the login page with empty fields and invalid email addresses. Verify that the correct validation messages appear. Do not submit real credentials. Report any problems you find.
The agent can start the application, open the page, exercise the workflow, and report the results.
VS Code also supports sharing an existing browser page with an agent when a task requires an authenticated session.
This is important because an agent does not automatically receive access to every page you have opened.
Understanding Isolated Browser Sessions
One of the most important security concepts in browser use is the difference between an agent-opened browser session and a browser page that you explicitly share.
An agent-opened page uses an isolated session. It does not automatically inherit cookies or browser storage from your everyday browsing sessions.
This means that if you are signed in to GitHub in your normal Chrome window, an isolated browser session does not automatically receive that authentication state.
This separation reduces the possibility of an agent accessing your existing signed-in accounts without permission.
However, some tasks require an authenticated browser session.
For example, you may want Copilot to inspect a private project dashboard that requires your existing login.
In Visual Studio Code, you can open the required page in the integrated browser and select Share with Agent.
After confirming the action, the agent can access that specific shared page and its existing session state.
You can revoke the sharing permission by selecting Share with Agent again.
This gives developers a more controlled approach to authenticated browser access. Instead of sharing the entire browser environment, you explicitly choose which page the agent can use.
Writing Better Browser Instructions
Browser automation is only as reliable as the instructions provided to the agent.
A broad instruction such as "Test my website" does not explain which pages to inspect, what behavior to expect, or which actions should be avoided.
A better instruction describes the application, the user journey, the expected result, and any restrictions.
For example:
Open http://localhost:3000 and test the password reset workflow.
Follow these steps:
- Open the password reset page.
- Submit the form without entering an email address.
- Verify that a validation message appears.
- Enter an invalid email address and submit again.
- Verify that the application handles the invalid input correctly.
- Test the page at desktop and mobile viewport sizes.
Do not use a real email address or submit any actual password reset request. Report the results and identify any problems.
This prompt provides an observable outcome and prevents the agent from performing an unintended real-world operation.
For more complex workflows, also specify whether Copilot should fix problems it discovers or only report them.
Security Practices for Browser-Based AI Agents
Browser access should be treated as an additional permission granted to an AI agent. It should not be considered a harmless extension of normal code assistance.
A few practices can help reduce unnecessary exposure.
Use isolated sessions whenever possible.
For public websites and local applications, allow the agent to open its own isolated browser session. This avoids sharing cookies and storage from your normal browser environment.
Share only the required pages.
If an authenticated workflow requires your existing browser session, explicitly share the necessary page. Avoid giving access to unrelated tabs.
Avoid real credentials.
Do not ask Copilot to enter production passwords, payment information, or other sensitive credentials. Use test accounts and non-production environments when testing application workflows.
Review actions that modify data.
Reading a page is different from submitting a form, deleting a record, or changing an account setting. Ask the agent to explain its intended actions and review important changes before allowing them.
Use test environments.
When testing registration, checkout, payment, or account management workflows, use a dedicated test environment. This reduces the possibility of accidental changes to production data.
Apply enterprise restrictions.
Organizations can control whether users are allowed to enable browser use through managed settings. The features.browserUse setting can be used to prevent users from enabling the capability.
Network restrictions can also help limit the domains that agents are permitted to access.
These controls are especially important when developers work with private applications or internal business systems.
Understanding Browser Use Limitations
Browser use does not guarantee that every website interaction will succeed.
Modern applications frequently use dynamic content, asynchronous requests, popups, animations, and complex navigation patterns. These behaviors can make it difficult for an agent to identify the correct control or understand whether an operation has completed.
For example, a button may appear on the page before the underlying API request finishes. If the agent continues too quickly, it might incorrectly report that the operation failed.
Similarly, a page update can move a button or change the layout while the agent is interacting with it.
Unexpected webpage content can also influence an agent's behavior. Instructions displayed on a website should not automatically be treated as trusted instructions from the developer.
For these reasons, browser-based testing should be combined with normal application testing practices.
Use automated tests for repeatable scenarios, and use browser interaction when you need to inspect real user workflows or investigate issues that are difficult to reproduce through code alone.
Common Problems and Troubleshooting
Browser extension is not connecting
First, verify that the GitHub Copilot extension is installed in Chrome or Edge. Check the extension status and confirm that it shows Connected.
For Copilot CLI, verify that the browser-use plugin is enabled and run the browser diagnostic command if necessary.
Copilot cannot access a signed-in website
An isolated browser session does not automatically share your normal browser cookies or authentication state.
If the task requires an existing signed-in page, use the supported page-sharing mechanism in your Copilot environment.
Browser tools are unavailable in Visual Studio Code
Check whether workbench.browser.enableChatTools is enabled.
Also verify that the browser tools are available in the agent's configured tool list. Organization policies may prevent the feature from being enabled.
The agent interacts with the wrong page element
This can happen when a page changes dynamically or contains multiple controls with similar labels.
Provide more specific instructions, identify the expected page or control, and ask the agent to verify the result after every important action.
The agent cannot access a website
The website may be unavailable, require authentication, or be blocked by an organization-level network restriction.
Check the browser session, network configuration, and any managed domain restrictions.
Summary
GitHub Copilot browser use allows AI agents to interact with real websites instead of relying only on source code and text-based instructions. Developers can use it to test forms, navigate applications, inspect webpages, and investigate user-facing problems.
The important part is controlling how the agent accesses the browser. Isolated sessions help protect everyday browser data, while explicit page sharing provides access when an authenticated workflow requires it.
Browser access should always be limited to the task at hand. Use test environments, avoid real credentials, review actions that modify data, and apply organizational restrictions where necessary.
With these practices, developers can use browser-based AI automation to improve application testing and development workflows without treating unrestricted browser access as a requirement.
Join the conversation! Your thoughts help the community grow.