Skip to content

Redact secret values from traces, the transcript, network and console #573

Open

Description

@vishnuv688

Problem

A trace zip records everything a run typed, and the dashboard shows it too. #530 masks password fields in the replayed page, but the same value still appears in:

  • command rows (setValue("#password", "...")) and the Errors and Log sections
  • transcript.md
  • network request and response bodies, headers and URLs
  • console output
  • the DOM mutation stream, where a typed value is recorded as each keystroke

CLAUDE.md records the size of the gap: on the Python login example the demo credential appears about 103 times across six places in one zip, and the password-field masking removes 2 of them. A trace opened in the hosted player or attached to a CI report is as sensitive as the run that produced it.

Playwright 1.65 added a secrets option that redacts given values in traces and reports. Users who share traces need the same here.

Proposal

A secrets option in every adapter: a list of literal values, and of environment variable names whose values are read at start.

  • Redaction is value based and applied where data leaves the adapter, in core and shared, so one implementation covers the service, Selenium and Nightwatch. The Python adapter mirrors it, with cases in packages/shared/mirror-vectors.json.
  • Every artifact is covered: command args and results, transcript, network (URL, headers, bodies), console, DOM snapshot and mutations, and the backend's live stream.
  • A secret is replaced by a fixed placeholder that does not reveal its length. Partial matches inside a longer string are replaced too.
  • Options and docs: README, capability matrix (features.ts), and the webdriver.io DevTools pages.

How we will know it worked

  • On each adapter's login example with the credential listed in secrets, the count of the secret in the trace zip goes from the current number to 0. Measure before and after and record both in the PR.
  • A conformance rule that fails if a listed secret appears anywhere in an exported zip.

Activity

  1. self-assigned this
    on Nov 13, 2026
  2. vishnuv688 commented on Nov 13, 2026

    @vishnuv688
    MemberAuthor

    Scope update: redaction will be automatic by default, so a login test is protected with no configuration.

    • Password fields: a value typed into an <input type="password"> (setValue, sendKeys, addValue and their equivalents in each adapter) is added to the run's redaction set before that command's row is sent, so it is hidden in the command row, test titles, transcript, network, console and the trace zip, in live and trace mode.
    • Auth headers: values of Authorization, Proxy-Authorization, Cookie and Set-Cookie are hidden in captured network entries.
    • Opt-out: both follow the existing maskInputs option (default on), so maskInputs: false turns them off.
    • secrets stays for values that nothing marks as secret: API keys or tokens typed into text fields, values in URLs or request bodies.

    Not covered: text typed with raw keyboard actions that have no target element, and text the page displays, which stays visible in screenshots and the screencast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions