Playwright officially clarifies browser security: MCP and CLI use stable Chrome, the test runner pins versions and disables the sandbox by default
Playwright officially clarifies that no Playwright package bundles a browser, so there is no need to delete it because of vulnerability rumors. Agents using Playwright MCP or the CLI invoke the stable Chrome or Edge on your machine, which receives security updates normally and has the sandbox enabled by default; whereas the Chrome for Testing downloaded by npx playwright install has a pinned version and the sandbox disabled by default, making it suitable only for end-to-end testing of trusted applications. When calling chromium.launch() directly, the default is likewise a pinned version with the sandbox disabled; if the code will access uncontrolled pages, switch to chromium.launch({ channel: 'chrome', chromiumSandbox: true }) and keep Chrome and Edge up to date.
Why read this
AI score 51
The original text clarifies how each way of using Playwright relates to browser security, and explains how crawlers and Agent scripts should configure the sandbox.
Topics
View original postPlaywright and browser security reminder. We saw a post suggesting that you delete Playwright because it bundles browsers with CVEs. That is a misconception. Do not delete Playwright🙃. Here is how it works and what you should do. No Playwright package bundles a browser. Agents on Playwright MCP or CLI run your stable Chrome, which gets Chrome's security updates, with the sandbox on. 🤖 If you use Playwright MCP or the Playwright CLI They use the stable Chrome / Edge on your machine, so it gets its normal updates. No config edit is needed. 🧪 If you use the test runner When you run npx playwright install, Playwright downloads Chrome for Testing, pinned to the build we tested that release against. The pin is on purpose. Your tests run on the same browser on every laptop and CI machine, and a browser update cannot suddenly break your suite. You choose when to move by upgrading Playwright. New releases usually pin a build ahead of stable Chrome, so you see breakage before your users do. We recommend this for full e2e test suites on your own trusted app. This build can miss Chrome security fixes until the next Playwright release, and by default it runs with the sandbox off. Do not use it on the hostile web. 📚 If you use the library API chromium.launch() has the same defaults: the pinned build with the sandbox off. If your code visits pages you don't control (scrapers, agent scripts), max out protection: chromium.launch({ channel: 'chrome', chromiumSandbox: true }) 🔒 Always keep Chrome / Edge updated. Some bugs can escape a sandbox. Happy testing!
View original
Playwright and browser security reminder. We saw a post suggesting that you delete Playwright because it bundles browsers with CVEs. That is a misconception. Do not delete Playwright🙃. Here is how it works and what you should do. No Playwright package bundles a browser. Agents on Playwright MCP or CLI run your stable Chrome, which gets Chrome's security updates, with the sandbox on. 🤖 If you use Playwright MCP or the Playwright CLI They use the stable Chrome / Edge on your machine, so it gets its normal updates. No config edit is needed. 🧪 If you use the test runner When you run npx playwright install, Playwright downloads Chrome for Testing, pinned to the build we tested that release against. The pin is on purpose. Your tests run on the same browser on every laptop and CI machine, and a browser update cannot suddenly break your suite. You choose when to move by upgrading Playwright. New releases usually pin a build ahead of stable Chrome, so you see breakage before your users do. We recommend this for full e2e test suites on your own trusted app. This build can miss Chrome security fixes until the next Playwright release, and by default it runs with the sandbox off. Do not use it on the hostile web. 📚 If you use the library API chromium.launch() has the same defaults: the pinned build with the sandbox off. If your code visits pages you don't control (scrapers, agent scripts), max out protection: chromium.launch({ channel: 'chrome', chromiumSandbox: true }) 🔒 Always keep Chrome / Edge updated. Some bugs can escape a sandbox. Happy testing!
Body · AI translation
Don't rush to delete Playwright: the official explanation of exactly how it relates to browser security
Some people say Playwright ships with a vulnerable browser, so it should be deleted. This is a misunderstanding, because none of Playwright's installation packages include a browser. The only situation that really warrants attention is this: the fixed-version browser used for testing is not suitable for visiting untrusted web pages.
Agents using Playwright MCP or the command-line tool
These two approaches call the official version of Chrome or Edge on your computer. The browser receives security updates normally, and the sandbox is enabled by default, so you don't need to change any configuration.
Running tests with the test runner
When you run npx playwright install, Playwright downloads Chrome for Testing. This is a browser dedicated to testing, with its version fixed to the one that the current version of Playwright has been tested against.
This is intentional: every development computer and every CI machine runs the same browser, so the browser won't suddenly break your tests because of automatic updates. When the browser version changes is decided by when you upgrade Playwright. A new version of Playwright usually pins a version of Chrome newer than the official release, so you discover compatibility issues before users do.
The trade-off is that, before the next version of Playwright is released, this browser may lack Chrome's latest security fixes, and the sandbox is disabled by default. The official recommendation is to use it only for end-to-end testing of your own trusted applications, and not to use it to visit websites of unknown origin.
Calling the library API directly
The default settings of chromium.launch() are the same as those of the test runner: use the fixed-version browser with the sandbox disabled. If your code visits pages you don't control, such as crawlers or Agent scripts, you should switch to the official version of Chrome and enable the sandbox:
chromium.launch({ channel: 'chrome', chromiumSandbox: true })
In addition, some vulnerabilities can escape the sandbox, so be sure to keep Chrome and Edge updated.