Playwright MCP server data privacy: profiles, stored state and output files

The Playwright MCP server keeps login state, cookies and local storage in a persistent profile by default, but --isolated mode writes nothing to disk. This page explains what is stored, where, and what to configure before approval.

On this page

Does the Playwright MCP server keep browser data on disk?

Yes, by default. A security reviewer deciding whether an AI agent driving a browser leaves cookies, logins and files behind needs to know that the Playwright MCP server is open source, runs locally via npx, and has no hosted service or plan tier, so data privacy is controlled entirely by the flags and host the organization chooses. Nothing is enforced by a vendor cloud. The server's default mode is persistent: login state, cookies and local storage are kept between sessions. Each client workspace gets its own profile directory, and the default location on Linux follows the pattern ~/.cache/ms-playwright-mcp/mcp-{channel}-{workspace-hash}. Any employee's agent session can therefore leave an authenticated browser profile on a developer laptop or build host unless someone changes that default.

The memory-only option is the --isolated flag. According to the profile and state documentation, it starts each session fresh with nothing written to disk. It cannot be combined with --user-data-dir, so a team that needs a specific profile must choose one mode or the other. If an agent must start logged in, --storage-state loads an initial state file into the isolated session, but that file is itself sensitive and must be stored, rotated and deleted under the organization's normal secret handling rules. Reviewers should confirm the effective flags in each client's configuration file, since a single override can switch a host back to persistent storage.

Before approving the server, ask the engineering team to run it in both modes on a test host and list every path written under the profile and output locations. Confirm the --output-dir location for automatically named output files and the --output-max-size eviction threshold, because old output files are removed only at that limit. Confirm which Node.js version the team pins, since the README and the getting started page disagree. Finally, record which MCP client and model provider receive page content, since that data leaves the host regardless of the browser storage mode. The Playwright MCP profile and state documentation is the reference for these checks.

Storage and privacy controls by mode and option

This table compares each Playwright MCP server setting that affects what is kept on disk, from the default persistent profile to output and secret handling. Read each row against the what-it-writes column to see where session data, cookies and files end up. There is no vendor plan tier for these options, so every control is set on the local server by the organization running it.

SettingWhat it doesWhat it writes to diskBuilt in or needs an outside component
Default persistent profileKeeps login state, cookies and local storage between sessionsA profile directory per client workspace, such as ~/.cache/ms-playwright-mcp on LinuxBuilt in, no outside component
--isolatedStarts each session freshNothing written to disk, per the profile docsBuilt in, cannot be combined with --user-data-dir
--storage-stateLoads initial cookies and storage into an isolated sessionReads a supplied state file; the file itself must be protected by the organizationBuilt in, used with --isolated
--user-data-dirSets the browser profile location manuallyThe chosen directory, which keeps persistent stateBuilt in, incompatible with --isolated
--output-dirStores automatically named output files from the serverFiles in the configured directoryBuilt in, no outside component
--output-max-sizeSets the threshold for evicting old output filesRemoves older output files once the threshold is reachedBuilt in, controls retention of output files only
--secretsRedacts matching values in tool responses and substitutes placeholdersSecret values are read from the configured source, not stored by this optionBuilt in, but the docs state it is not a security boundary

What the default profile keeps between sessions

The default mode of the Playwright MCP server is persistent, so login state, cookies and local storage are kept between sessions instead of being discarded when a task ends. For a security reviewer, this means the server is not stateless by default. A browser profile on the host can hold authenticated sessions for any site an agent has signed into, and a later agent run can reuse those sessions without a fresh login. Before approving the server, confirm with your team which sites staff will open through it and whether any of them are internal systems or accounts with broad access.

The Profile and State documentation gives a default profile location on Linux that follows the pattern ~/.cache/ms-playwright-mcp/mcp-{channel}-{workspace-hash}. Each client workspace gets its own profile directory, so two projects opened in separate workspaces do not share cookies or storage by default. That separation is useful for keeping a client engagement apart from an internal project, but it is a per-workspace boundary on one machine, not an access control. Anyone with access to the user account can read the profile directory, so treat the directory as sensitive data in your endpoint and disk encryption reviews.

The supplied documentation covers only the Linux pattern. Confirm the equivalent profile paths for macOS and Windows in the Playwright MCP profile and state documentation before you write endpoint rules or backup exclusions, and ask the team deploying the server to list the exact directories on each operating system in their fleet. Also confirm whether backup, sync or endpoint tools copy these directories, because a copied profile carries the same logged-in sessions as the original.

Choosing between persistent, isolated and seeded modes

The decision starts with one question: does the agent need login state to survive across sessions? If yes, the default persistent mode keeps cookies, local storage and login state in a profile directory that each client workspace gets for itself, so the team must decide where that directory lives and who can read it. If no, --isolated starts each session fresh and writes nothing to disk, but it cannot be combined with --user-data-dir. If the agent needs a known starting point, --storage-state loads that state into the isolated session. Check the storage-state file itself, since it holds the cookies and tokens it carries.

Decision path for persistent, isolated and seeded Playwright MCP sessions.

Decisions to make before the first approved workspace

Four decisions shape what the Playwright MCP server leaves behind on a managed endpoint: whether sessions persist, where profiles and output files land, whether seed state is approved, and how far a client workspace reaches. Each one changes what a reviewer can later inspect, delete or explain during an incident.

Persistent or isolated mode per use case

The default mode keeps login state, cookies and local storage between sessions, so a workflow that signs in once can resume later. Running with --isolated starts each session fresh with nothing written to disk, which limits retention but means every run must re-authenticate. Decide per use case, record the choice in the workspace configuration, and confirm with your security team which flows, such as logged-in admin consoles, justify persistence.

Persistent mode
Default
Profile and state docs

Profile directory location on endpoints

Persistent profiles are written to a per-workspace directory, for example under ~/.cache/ms-playwright-mcp/ on Linux, so each client workspace gets its own profile. Ask your endpoint team whether these paths fall inside disk encryption, backup scope and endpoint detection coverage, and whether they can be wiped on offboarding. Where your policy requires a fixed location, set --user-data-dir explicitly, noting that it cannot be combined with --isolated.

Approval of storage-state seed files

The --storage-state option loads initial cookies and storage into an isolated session, which lets a team reuse a login without a persistent profile. Those seed files contain live session material, so treat them like credentials. Name an owner for each seed, define who may create and rotate it, set an expiry review, and exclude them from shared repositories and ticket attachments.

Output directory and size limits

Output files, such as snapshots or downloads, are named automatically and written to the directory set by --output-dir. The --output-max-size setting is the threshold at which old output files are evicted, so it governs how long artifacts persist and how much they accumulate. Choose a directory outside synced folders, set a size limit that matches your retention rule, and confirm with the reviewer what evidence must survive eviction.

Configuration options

Workspace boundary versus project boundary

Profiles are separated by client workspace, so a developer's project boundary determines which sessions and cookies a given agent can reuse. Check whether one workspace spans sensitive and non-sensitive projects, and whether sessions from a production-facing site could be reached from a sandbox project. If the boundaries differ, split workspaces or use isolated mode so that an investigation can tie each session to a single project.

How the storage answer changes by use case

Long-running loops are the case the Playwright MCP docs describe for persistent state. The default mode keeps login state, cookies and local storage between sessions, so an agent can resume work without signing in again. That convenience is also the main storage risk, because the profile sits on disk under a per-workspace directory and outlives the task. Treat the profile as a credential store, not a cache.

  • Persistent profile is the default: Confirm that the team accepts login state, cookies and local storage remaining on the developer machine between sessions.
  • Profile location: Ask each team to locate its profile directory (on Linux, under ~/.cache/ms-playwright-mcp/) and record it in the workstation standard.
  • One profile per workspace: Each client workspace gets its own profile, so confirm which workspaces may hold sessions for which systems.
  • Output files: Set --output-dir deliberately and review what is written there, since screenshots or snapshots from long runs accumulate.
  • Cleanup rule: Define when profiles are deleted, such as at project end or offboarding.

Before approving this pattern, confirm which logged-in sites the agent can reach and whether any of them hold data that must not persist on a laptop.

Keeping secrets out of tool responses

The --secrets option lets an organization reduce accidental exposure of credential values in what the Playwright MCP server returns to the model. According to the configuration docs, values listed through this option are redacted when they match tool output and replaced with placeholders, so the model sees a token instead of the literal string. Before relying on it, confirm the exact file format and how values are supplied in the Playwright MCP configuration options, and test it against the pages and flows your agents actually use. Treat it as a hygiene control for responses, not as a secret store.

The docs are explicit that --secrets is not a security boundary. Redaction happens in tool responses only. The browser profile, page memory and any storage the session holds can still contain the real value, so anyone with access to the profile directory or a live session may still reach it. A page can also display a secret in its own markup, and a prompt injection embedded in that page can instruct the agent to read or type values it can see, regardless of how responses are filtered. Pages that render credentials in plain text, or forms that echo them back, fall outside what this option can reliably protect.

The practical control is to keep credentials out of the browser where you can. Prefer sessions that log in with short-lived credentials supplied at run time, avoid storing long-lived passwords in profiles, and combine this with --isolated so nothing persists after the run. Where a login must be reused, review who can read the profile directory before approving the workflow. Ask your security team to decide which accounts agents may use, and set up a test that checks whether a known test secret appears in a tool response, a saved file or the profile after a sample run.

Where the server does not cover data privacy

The Playwright MCP server runs locally, so the privacy picture depends on the machine, the client and the model provider around it. The cards below name the gaps a reviewer should close with controls the organization already runs, and what to confirm with each vendor.

No hosted service or retention terms

The server runs locally through npx, and the docs describe no hosted Playwright MCP service or plan tiers. Microsoft therefore publishes no retention schedule or data processing terms for the server itself, because it never receives the data. Check instead whether the endpoint's disk encryption and local logging meet your policy, since those controls hold what the server writes. Confirm with Microsoft through the microsoft/playwright-mcp README that no telemetry or update channel changes this picture.

Read the README

Model provider receives page content

Snapshots of pages the agent reads are passed to whichever MCP client and model provider the organization chooses. The server does not decide where that content goes, so the provider's terms govern retention, training use and regional processing. Require an approved model provider agreement that covers the data classes staff will browse, and confirm the client's data handling settings with the client vendor before rollout.

The secrets flag is not a boundary

The --secrets option redacts matched values from tool responses and substitutes placeholders, but the docs state it is not a security boundary. Anything the page displays that does not match a supplied value can still reach the model, and sensitive values held in the browser remain reachable. Treat it as a reduction in exposure, pair it with isolated mode for sensitive tasks, and test with a page that displays dummy credentials to confirm what the client actually receives.

Persistent profiles stay on disk

In default mode, login state, cookies and local storage are kept between sessions in a profile directory under the cache path, such as ~/.cache/ms-playwright-mcp on Linux. The profile remains after the session ends unless someone deletes it. Set a scheduled cleanup for profile directories on managed endpoints, and confirm the location on each operating system your staff use, since the default path varies by platform.

Profile and state docs

Output files accumulate by size

Automatically named output files written to the directory set by --output-dir are evicted only when the total passes the threshold in --output-max-size. Until then, files with page content or downloads can sit on disk for an unknown period. Choose a dedicated output directory outside synced folders, set a size limit that matches your policy, and check the directory after test runs. Confirm the eviction behavior against the current options page before relying on it.

Configuration options

No documented audit trail of state

The docs do not describe an audit log of what the server stored, which profile a session used, or which values were redacted. A reviewer who needs to answer what data a session left behind has to reconstruct it from the file system and the client's own logs. Compensate with endpoint file monitoring on profile and output directories, a written record of which profiles belong to which users, and a request to the client vendor for its session logging options.

Order of work before approving the server

This sequence confirms the runtime, sets how the server keeps browser state and output files, and tests those settings in a workspace before any staff member connects a production client. The result is a written decision on each storage setting that the approver can review.

  1. Confirm the Node.js version first

    The repository README lists Node.js 18 or newer, while the Playwright getting started page lists Node.js 20 or newer. The platform engineer checks the current getting started page, pins the version that page supports, and records the source and date in the approval file. Done means the approver has one Node.js version, a named source for it, and a check that the endpoint image matches it.

  2. Choose the default mode for each use case

    The default mode is persistent, so login state, cookies and local storage carry over between sessions. The security lead decides, per use case, whether persistence is needed for long-running work or whether each session should start fresh. Done means every planned use case has a recorded mode, and any use case that needs persistence has a named owner and a reason.

  3. Set profile and output locations on managed endpoints

    Persistent profiles default to a per-workspace directory under the user's cache folder, and output files go to the directory set by the output option. The endpoint administrator confirms these paths on a managed device, decides whether they sit on encrypted storage, and checks that standard endpoint protection and backup policies cover or exclude them as intended. Done means the approver has the exact paths for each workstation image and a documented decision on backups.

  4. Decide on seeded state and secrets handling

    If a session needs a saved login, the team decides whether to load a stored state file into an isolated session, and who creates and stores that file. The secrets option redacts matching values in tool responses, but the documentation says it is not a security boundary. The security reviewer decides which credentials are never placed in a browser session and records where the secret values are kept. Done means each credential has an owner, a storage location and an explicit yes or no on seeding.

  5. Identify the model provider and client

    The server runs locally, but page content returned by tools goes to whichever MCP client and model provider the organization selects. The procurement and privacy reviewers identify each client in use, the model provider behind it, and the terms that apply to retention and training for that provider. Done means the data flow diagram names every party that receives tool responses, and each one has a reviewed agreement or an approved exception.

  6. Verify storage in a test workspace

    The platform team runs a test workspace with a non-sensitive test account and checks that profile directories and output files appear where the documentation and the endpoint settings predict. They then confirm the removal behavior on the chosen schedule, including the size threshold for evicting old output files. Done means a written test record shows the expected paths, the files created, and the files removed, and the approver signs off on that record.

Evidence a security reviewer asks for

This table lists the evidence a reviewer should request for the Playwright MCP server's disk, output and secrets behavior, with where each item is documented and who produces it. Read it as a checklist: each row names one control, the artifact that proves it, and the team that should supply it. The main takeaway is that the default mode keeps browser state between sessions, so the endpoint team must show the profile location and the isolation setting in use before approval.

Evidence itemWhat to ask forWhere it comes from in the toolWho produces it
Data location and profile pathsProfile directory per workspace on each endpoint, plus whether the default persistent mode is kept or replacedProfile and state docs, including the default ~/.cache/ms-playwright-mcp path on LinuxEndpoint team
Isolation mode configurationClient config showing --isolated, or a written reason for persistent mode, and confirmation it is not combined with --user-data-dirConfiguration options docs and the profile and state docsEndpoint team, checked by the reviewer
Initial state loadingAny --storage-state file used to seed isolated sessions, with its owner, storage location and review dateProfile and state docsEndpoint team
Output retention and size limitsConfigured --output-dir and --output-max-size values, and where old files are evictedConfiguration options docsEndpoint team
Secrets handling configurationClient config showing the --secrets setting and the list of secret names covered, plus a note that redaction is not a security boundaryConfiguration options docsEndpoint team, reviewed against the security policy
Model and client data flowNamed MCP client and model provider, and a statement of which page content and tool responses are sent to the modelREADME, which says the server runs locally via npx and sends data to the chosen client and providerReviewer, with the vendor contract from procurement
Package version pinnedThe exact @playwright/mcp version installed, not a floating @latest, and the Node.js version that matches the current requirementREADME and getting started page, which list conflicting Node.js minimumsEndpoint team

Questions buyers ask about Playwright MCP data privacy

Does the Playwright MCP server store our data in the cloud?

No hosted Playwright MCP service is described in the docs, and the server runs locally through npx on the machine where the MCP client starts it. Anything the server keeps is written to that machine, such as profiles and output files. What leaves the machine is the content the agent sends to the model, and that depends on the MCP client and model provider your organization chooses. Confirm with each client and provider which prompts, page content and tool results they retain, and under which terms. The Playwright MCP README is the starting point for the local run model.

Does isolated mode keep everything off disk?

The docs say --isolated starts each session fresh with nothing written to disk, so it is the setting to use when you do not want logins or browsing state to persist. It cannot be combined with --user-data-dir. If an agent needs a signed-in state, --storage-state loads initial state into an isolated session, which means the state file itself still sits on disk and must be protected. Output files are a separate question, so check --output-dir settings too. Test the chosen flags on a workstation and confirm the profile and output paths stay empty after a session.

Does the --secrets option actually protect our credentials?

It reduces exposure but does not protect them. The docs describe --secrets as keeping listed values out of tool responses by redacting matches and substituting placeholders. The same docs state it is not a security boundary, so a credential the browser can reach can still be used, typed into a form or exposed through a page the agent visits. Treat it as one layer. Pair it with short-lived test accounts, least-privilege logins, origin restrictions and secret stores that never place real passwords in the agent's context. Ask your reviewers to test whether a known secret ever appears in a transcript or output file.

How long do profiles and output files persist?

In default persistent mode, login state, cookies and local storage are kept between sessions, so they remain until someone removes them. Each client workspace gets its own profile directory, and on Linux the docs give a default location under ~/.cache/ms-playwright-mcp/. Output files are named automatically and older ones are evicted once the total passes the --output-max-size threshold, so retention depends on that size and on how much the agent writes. The docs do not give a fixed retention period. Confirm the paths and sizes on your own endpoints, and set a cleanup routine for devices where staff may hold sensitive sessions.

What drives the effort of a Playwright MCP rollout?

Three factors matter most. The first is the number of workspaces, because each client workspace gets its own profile directory that must be found, reviewed and cleaned. The second is the sensitivity of the logins the agent may use, since admin, finance or customer-data accounts need isolated mode or no stored state at all. The third is endpoint management: if your devices are managed centrally, you can standardize flags and output locations, while unmanaged laptops need a written standard and checks. Ask any implementation partner for a quote built from these factors and from the written scope of workspaces, endpoints and test cases.

Can our own team configure these privacy settings without outside help?

Often yes, for a small pilot, because the settings are documented flags and a local run model. A team with endpoint management skills and a security reviewer can set default flags, choose an isolated or storage-state pattern, and test whether profiles and outputs stay where expected. Outside help becomes more useful when many workspaces, shared machines or regulated logins are involved, or when the team needs evidence for a security review. DeployOpen can plan and implement self-hosted platforms in your infrastructure and run security testing of AI agent setups, including tests of data exposure and credential handling, with a findings report and retest. It does not issue audit reports or certifications.

How DeployOpen works on this

DeployOpen approaches Playwright MCP storage controls as a fixed-scope review of what the server writes to disk, how the profile, stored state and output directories are configured, and what reaches tool responses. Each engagement ends with written findings, fixes and a retest, so the security and IT reviewers can make a documented decision about the setup.

How we scope

  • Written scope lists which clients, workspaces and machines will run the Playwright MCP server.
  • Scope names the profile directories, output directories and any storage-state files to be reviewed.
  • Fixed-scope engagements agree deliverables and timelines in writing before any testing begins.

How we build

  • We compare default persistent mode with isolated mode and record which settings each client uses.
  • We check the --output-dir and --output-max-size values and where old output files are kept.
  • We test whether --secrets placeholders hold up in tool responses, treating redaction as a convenience rather than a boundary.

How we hand over

  • Findings report lists each storage location, its contents, retention and the control that governs it.
  • Deliverables include a recommended configuration file and the steps to confirm it on each workstation.
  • A retest after fixes confirms whether profiles, cookies and output files are handled as documented.

How we support

  • Ongoing support is available as a retainer for upgrades to the @playwright/mcp package and config changes.
  • Retainers can include periodic retesting when client teams change their workspace or output settings.
  • Support questions about storage behavior are answered against the current Playwright MCP documentation.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.