AI-assisted testing

Where does your data go during AI-assisted testing?

During AI testing, data may pass through a browser, a tool server, the AI application and the model provider. Knowing where the browser runs or whether a supplier uses inputs for training is not enough. Before the first pilot, you need a data flow map, an approved scope of access and verification of what remains in records and generated code.

Where the data may go

When using Playwright MCP, the AI application calls a tool server through an MCP client. The server controls the browser and returns results to the client. The AI application may then include them in the model’s context. MCP is a way to communicate with tools, rather than the language model itself. The MCP architecture explains these roles.

The model does not necessarily receive the entire page or every file at each step. The scope depends on the client, available tools and settings. Review the full chain for the deployment you intend to use:

Location What it may contain What to check
Browser Pages, forms, cookies and authenticated sessions The profile, account and applications it can access
MCP server Action results, page text, files and tool settings Where it runs, its permissions and what it returns to the client
AI application and MCP client Instructions, work history, file contents and tool results What they send to the model and whether they keep their own records
Model provider Submitted inputs, responses and attachments Processing, retention, access and other services
Logs and artefacts Error messages, execution traces, screenshots or saved sessions Storage location, access, retention and deletion
Repository and automated tests Generated code, test data and reports Whether they contain secrets and where other tools send them

A locally running MCP server may communicate with a client that uses a cloud model. A local tool therefore does not prove that all data is processed locally. Even a model you operate yourself does not rule out transmission through telemetry, connected services or other tools. Verify the actual configuration and network communication.

Sensitive text can leave without a screenshot

Playwright MCP works with a structured accessibility tree, a text description of elements and their meaning. A screenshot is therefore not required for every operation. That description may still contain a customer’s name, email address, order note or a value entered into a form. The Playwright MCP documentation explains how it works.

To check a form, you do not need to expose a list of all customers to the model. Prepare a separate test record and a page containing only what the scenario needs. Also inspect page URLs, network responses, error messages and attachments. Sensitive data may appear in a URL or file name even when it is not visible on screen.

Disabling screenshots or masking text in the prompt does not cover these other routes. Restrictions must apply before transmission, including when data comes from a tool result rather than being copied into the prompt by a user.

Training, retention and processing location are separate questions

A statement that “we do not use data for training” does not explain whether a request is kept in an operational log, who can make it available to support or where processing happens. Retention is how long data is kept. Data residency defines the geographical scope of storage or processing under the particular offering. The storage region may differ from the processing region.

Ask the model provider and the operator of the AI application separate questions:

For example, OpenAI API data controls distinguish training, operational logs, feature state and regional options. The Claude API documentation distinguishes coverage for different products and integrations. Do not automatically extend one service’s contractual and technical conditions to a personal chat account, an editor extension or an external MCP server.

Set permissions and network boundaries outside the prompt

Use a separate account with the permissions required for the approved scenario. An agent creating a test of the order display does not need a production administrator account or permission to change billing. Do not connect the browser to a personal profile that retains authenticated sessions for other applications.

Restrict file system access, command execution and the network access of processes too. Verify the source of the MCP server, the command that launches it and the versions you use. The MCP security best practices recommend these measures.

A list of allowed addresses in Playwright MCP may help constrain routine work, but it is not a security boundary. The documentation also notes limitations involving redirects for allowed-origins. Enforce actual boundaries through application permissions, process isolation and the network layer. Verify them by attempting unauthorised access in an approved test environment.

Treat page content and tool responses as untrusted data. They may contain an instruction that tries to change the model’s behaviour, such as sending a file to another address. This is prompt injection. OWASP recommends minimum permissions and checks on high-risk operations. Writing “do not send data” in the prompt does not replace a technical restriction.

Start with an approved data pilot

A hypothetical pilot could check an order form in a separate environment. Use a fabricated test customer, a non-production order and an account that cannot make a real payment. The goal is to create a form validation test, rather than explore the customer database.

Before starting, assign an owner and approve the environment, data categories, permitted actions, suppliers and how outputs will be retained. Do not copy production passwords, API keys or customer data into the prompt. Then verify the prepared conditions:

  1. Prepare synthetic test data without taking production records. Disable real email delivery, payments and other side effects.
  2. Use a new test profile and a restricted account. Expose only the required working directory and approved services.
  3. Establish what the client sends and what each component records. Use recognisable test text without personal data. Check for it in the outputs available for inspection.
  4. Include an unwanted instruction and attempt a disallowed action in the prepared test content. Observe whether technical permissions stop it and whether a usable record is produced.
  5. Review the resulting code, data and artefacts. Resolve the gaps you find before expanding the scope.

A network record can show where communication goes. It does not by itself prove what the provider subsequently retains or who can access the content. Support that part with the service terms and relevant contracts. The pilot verifies a configuration in practice. It is not a security certificate.

If you discover real customer data or a secret during the pilot, stop the affected flow. Establish which components received access to the data and follow your internal incident process. Do not copy the entire sensitive content into an ordinary repair ticket. For an exposed credential, address revocation too. Removing it from the prompt is not enough.

Masking data and GDPR compliance

Replacing a name with “Customer A” may reduce the amount of content shared. If an address, order number or link to the original record remains, the person may still be identifiable. Consistent placeholders or removing a few fields do not automatically constitute anonymisation. The EDPB explains the distinction.

If you work with personal data, assess the purpose and legal basis, minimisation, access, retention and supplier relationships. The GDPR also governs processors and transfers to third countries. A non-disclosure agreement (NDA), EU hosting or disabled training alone does not demonstrate overall compliance. Assess the specific deployment with your security and legal teams, including whether a data protection impact assessment is needed.

Review the output and clean up after the pilot

Before saving code in the repository, check it for passwords, tokens, production addresses and personal data. Review new dependencies, installation commands, file access and network calls too. Once approved, the test should check the agreed behaviour and should not need an AI service on every run unless that is the intended design.

Configure the audit trail to retain the necessary information about actions and approvals without unnecessary copies of sensitive content. After the pilot, revoke temporary access and delete unneeded profiles, sessions and artefacts under the agreed retention policy. Deleting a local directory does not by itself delete provider history or reports stored elsewhere.

The pilot should produce an approved test and a documented data flow, including its remaining limitations. If you cannot explain one part of the chain, verify it first. Expand the scope according to what the data, permissions and terms of the specific deployment allow.

When adding a tool or changing the model, client or deployment mode, check the affected flows again. The original pilot approval may not cover new services or expanded permissions.

Related topics

You might also be interested in

AI will speed up work. The person is responsible for the result.

AI speeds up the design, creation, repair and migration of web, Android, API and Electron tests; a specialist verifies every output before use.