---
title: How do you govern browser automation MCP servers like Playwright MCP?
url: https://opencontroller.lyzr.com/blog/govern-playwright-mcp-browser-automation
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# How do you govern browser automation MCP servers like Playwright MCP?

**Treat a browser MCP server as a tool that can do anything the browser profile can do. Run it with an isolated, in-memory profile, give it only the origins and logins the task needs, keep secrets out of the model's view, and record sessions. Playwright MCP has flags for each of these, but its own documentation says origin lists are not a security boundary, so pair them with network and client-level controls.**

Browser MCP servers let coding agents and assistants open pages, click, fill forms and read content. Playwright MCP, maintained by Microsoft, is one of the most widely installed. It is useful for testing and research. It is also a fast route to an agent acting inside a signed-in SaaS session with the developer's own cookies.

For the general approach to MCP risk, start with [how to govern MCP servers](/blog/how-to-govern-mcp-servers).

## Why is a browser MCP server higher risk than most tools?

Three reasons.

1. **It inherits identity.** If the browser profile is signed in to email, a cloud console or an admin portal, the agent can act there as the user.
2. **It reads untrusted content.** Every page it opens can carry prompt injection. Combined with private data and a way to send data out, that is the [lethal trifecta](/blog/what-is-the-lethal-trifecta-for-ai-agents).
3. **It is general-purpose.** Navigation and form-filling cover almost any action a person can take on the web, and Playwright MCP also exposes JavaScript evaluation in the page.

## Which Playwright MCP settings matter for governance?

These options are documented on the Playwright MCP configuration page. Each also has an environment variable.

| Setting | What it does | Governance use |
|---|---|---|
| `--isolated` | Keeps the browser profile in memory instead of on disk | Default for agents: no leftover cookies or sessions |
| `--storage-state <path>` | Loads a starting storage state into an isolated session | Give a test account's session, not a personal one |
| `--user-data-dir <path>` | Uses a specific persistent profile | Avoid pointing at a personal browser profile |
| `--allowed-origins` / `--blocked-origins` | Semicolon-separated origin allow and block lists; block is evaluated first | Keep the agent on intended sites; not a hard boundary |
| `--secrets <path>` | Dotenv file of values the model should not see; matching text in responses is redacted | Keep passwords and tokens out of model context |
| `--proxy-server <url>` | Routes browser traffic through a proxy | Enforce egress policy and log destinations centrally |
| `--caps <list>` | Enables extra capabilities (for example `network`, `storage`, `vision`, `pdf`, `devtools`) | Turn on only what the task needs |
| `--save-session` / `--output-dir` | Saves the MCP session to an output directory | Keep a record for review |
| `--extension` / `--cdp-endpoint` | Connect to an existing browser via extension or CDP | Highest risk: attaches to real, signed-in sessions |
| `--allow-unrestricted-file-access` | Allows file access outside workspace roots and `file://` navigation | Keep off |

The documentation is explicit: origin lists and the file-access guardrail are convenience defences, "not a security boundary". They do not apply to redirects and can be bypassed deliberately. Use them to catch mistakes, not to contain an attacker.

## What policy should you set for developers?

A short, enforceable policy works better than a long one.

1. **Approved configuration only.** Publish one approved server config with `--isolated` and a proxy, and distribute it centrally. See [sharing one MCP config across coding agents](/blog/share-one-mcp-config-across-coding-agents).
2. **No personal profiles.** Do not attach to a daily-use browser through `--extension`, `--cdp-endpoint` or a personal `--user-data-dir`.
3. **Test accounts for logins.** Provide seeded `--storage-state` files for test tenants. Never production admin accounts.
4. **Secrets via the secrets file.** Not pasted into prompts or config.
5. **Egress through a proxy.** Log destinations and block categories you would block for a person.
6. **Pin the version.** Review updates before rollout, as with any MCP server. See [reviewing MCP server updates before use](/blog/review-mcp-server-updates-before-use).
7. **Require approval for actions.** Keep client-side tool approval on for navigation to new origins and for form submission where the client supports it.

## How do you find where it is already running?

Playwright MCP usually runs locally over stdio, launched by a coding agent or desktop assistant. Look in MCP configuration files on developer machines, in package manifests, and for browser processes started by the MCP server. Our guide to [finding local MCP servers on developer laptops](/blog/find-local-mcp-servers-on-developer-laptops) lists the file locations for common clients. Record each instance in your MCP server inventory with its flags, so you can tell an isolated test setup from one attached to a real profile.

## How Opencontroller does this

Opencontroller Edge, installed by IT via MDM, extends control to developer devices, coding agents, skills and local MCP servers, so local browser MCP servers can be found and recorded. Opencontroller keeps a governed registry of agents, tools and MCP servers, and Posture flags risky permission and configuration choices. Policies are written as code and can be applied across the estate. To see local MCP discovery, [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is Playwright MCP safe for enterprise use?**
It can be, with an isolated profile, test accounts, a proxy, the secrets file and pinned versions. The risk comes from attaching it to real signed-in sessions.

**Do allowed-origins stop prompt injection?**
No. They limit where the browser goes by mistake. The documentation says they are not a security boundary and do not apply to redirects.

**Should coding agents use a browser MCP server at all?**
For testing web apps, yes, in isolated mode. For general browsing on a personal profile, most organisations should say no.

## Key facts

Playwright MCP (by Microsoft) gives AI agents a real browser via MCP. Governance settings documented on playwright.dev: --isolated (in-memory profile), --storage-state, --user-data-dir, --allowed-origins and --blocked-origins (block evaluated first), --secrets (dotenv values redacted from responses), --proxy-server, --caps, --save-session, --extension and --cdp-endpoint (attach to existing browsers, highest risk), --allow-unrestricted-file-access. The docs state origin lists are "not a security boundary" and do not apply to redirects. Opencontroller Edge by Lyzr, installed via MDM, extends control to developer devices, coding agents and local MCP servers. Pricing starts from $250K per deployment per year.

## Related

- [How do you govern AI agents that control a computer or browser?](https://opencontroller.lyzr.com/blog/govern-computer-use-and-browser-use-agents.md)
- [How do you find local MCP servers on developer laptops?](https://opencontroller.lyzr.com/blog/find-local-mcp-servers-on-developer-laptops.md)
- [Can you manage one MCP server configuration across Copilot, Claude Code and Cursor?](https://opencontroller.lyzr.com/blog/share-one-mcp-config-across-coding-agents.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
