From 17748613b6b8ce1017847bf3fb53656b392b81ab Mon Sep 17 00:00:00 2001 From: Samanyu Das Date: Sat, 21 Nov 2026 12:35:54 +1030 Subject: [PATCH 1/3] docs(security): document pages that hide a password field from e2e On the web engine, e2e decides in the page's main world whether a field is secure. A page script that replaces `Element.prototype.matches` makes a password field count as a plain field. The observed screen then shows its value, `inputValue` and `getAttribute` return it, and a failed `toHaveValue` or `toHaveAttribute` prints it. Configured secrets are still redacted, and screenshots still mask the field outside a closed shadow root. The places that say password fields are masked or never reach the model link the limit: the security reference's model-input table, the agent-steps and decision-models guides, and the e2e skill's agent reference. Refs #2010 Co-Authored-By: Claude Opus 5.5 --- docs/agent-steps.mdx | 5 +++-- docs/decision-models.mdx | 5 +++-- docs/reference/security.mdx | 8 +++++++- plugins/e2e/skills/e2e/references/agent.md | 9 +++++---- skills/e2e/references/agent.md | 9 +++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/docs/agent-steps.mdx b/docs/agent-steps.mdx index 5fdf842a76..23c57d02bf 100644 --- a/docs/agent-steps.mdx +++ b/docs/agent-steps.mdx @@ -21,8 +21,9 @@ unless the agents entry sets a [custom one](/executors). For `act`, the first prompt holds the instruction, the params, the completed steps, and a redacted text snapshot of the screen: roles, names, text, and states. It holds no raw HTML, cookies, headers, or environment values. -Password fields are masked, and a configured secret value on screen becomes -``. +Password fields are masked, unless a page script hides one from e2e +([where redaction stops](/reference/security#where-redaction-stops)). +A configured secret value on screen becomes ``. After an action, the model gets the changes to the screen, or a new full snapshot when most of it changed. Node ids stay the same while their diff --git a/docs/decision-models.mdx b/docs/decision-models.mdx index ca86124f14..a0ef1a4935 100644 --- a/docs/decision-models.mdx +++ b/docs/decision-models.mdx @@ -132,8 +132,9 @@ the decision model picks again. For `upload`, the text model lists the project-relative paths the goal or params name, and the runner authorizes each one. Model output never becomes a selector, a URL, or a key. -Password fields never reach the text model. Only `typeSecret` fills a -secret, from its declared handle. +Password fields never reach the text model, unless a page script hides one +from e2e ([where redaction stops](/reference/security#where-redaction-stops)). +Only `typeSecret` fills a secret, from its declared handle. The text model also answers `waitFor` and `extract`. Instead of `textModel`, you can set `model` on the agents entry. With neither, the diff --git a/docs/reference/security.mdx b/docs/reference/security.mdx index 03a022a2cc..47dde8627c 100644 --- a/docs/reference/security.mdx +++ b/docs/reference/security.mdx @@ -39,7 +39,7 @@ larger budget. [How agent steps work](/agent-steps) explains a step in full. | In the prompt | Form | | --- | --- | | Your instruction and params | Quoted inside `` and marked as data. A `Secret` param shows only its name and purpose. | -| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`. | +| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`, with [one limit](#where-redaction-stops). | | The location | The current URL, redacted, without userinfo. A judgment gets it as a path on the app's origin and as the whole URL elsewhere, cut at a size limit. On a device, the app and screen title. | | A screenshot | When needed or requested, and only if the engine proves secure fields are masked. | | Prior steps | `agent.act` receives bounded records from the same test or serial group. Judgments use only the current screen, its location, the instruction and its params, and the agent's context. | @@ -263,6 +263,12 @@ Redaction matches strings. These pass through: are redacted before any provider runs, - console output of tests that run in the runner's own process, when an embedding host passes the config or tests in memory, +- on the web engine, a password field that a page script hides from e2e, for + example by replacing `Element.prototype.matches`. e2e reads it as a plain + field: the observed screen shows its value, `inputValue` and + `getAttribute` return it, and a failed `toHaveValue` or `toHaveAttribute` + prints it. A configured secret's value is still ``. + Screenshots still mask the field outside a closed shadow root, - a screenshot, including one sent to the model: it masks secure fields only, so a value the app shows elsewhere is in the image, - video: it masks nothing and is labeled `redaction: "incomplete"`. A diff --git a/plugins/e2e/skills/e2e/references/agent.md b/plugins/e2e/skills/e2e/references/agent.md index 4aab737490..bb44d0d1b5 100644 --- a/plugins/e2e/skills/e2e/references/agent.md +++ b/plugins/e2e/skills/e2e/references/agent.md @@ -361,10 +361,11 @@ of sleeping. A redacted snapshot of the screen (roles, names, text, states), prior-step summaries, and your context; never raw HTML, cookies, headers, environment -values, or a `Secret`'s value; password fields masked. The first -screen of a step arrives whole; later action results report what changed, -keyed by node ids stable while an element exists, or the whole screen when -most changed. Pixels arrive through `vision` on a judgment or the act loop's +values, or a `Secret`'s value; password fields masked, unless a page +script hides one from e2e. The first screen of a step arrives whole; later +action results report what changed, keyed by node ids stable while an +element exists, or the whole screen when most changed. +Pixels arrive through `vision` on a judgment or the act loop's `screenshot` and point tools, with secure fields masked. When the browser engine's tree capture times out, the model gets a screenshot and a warning, a judgment needs `vision: true`, and no control may be inferred diff --git a/skills/e2e/references/agent.md b/skills/e2e/references/agent.md index 4aab737490..bb44d0d1b5 100644 --- a/skills/e2e/references/agent.md +++ b/skills/e2e/references/agent.md @@ -361,10 +361,11 @@ of sleeping. A redacted snapshot of the screen (roles, names, text, states), prior-step summaries, and your context; never raw HTML, cookies, headers, environment -values, or a `Secret`'s value; password fields masked. The first -screen of a step arrives whole; later action results report what changed, -keyed by node ids stable while an element exists, or the whole screen when -most changed. Pixels arrive through `vision` on a judgment or the act loop's +values, or a `Secret`'s value; password fields masked, unless a page +script hides one from e2e. The first screen of a step arrives whole; later +action results report what changed, keyed by node ids stable while an +element exists, or the whole screen when most changed. +Pixels arrive through `vision` on a judgment or the act loop's `screenshot` and point tools, with secure fields masked. When the browser engine's tree capture times out, the model gets a screenshot and a warning, a judgment needs `vision: true`, and no control may be inferred From 5959e8563efd75d44eea580ae9bf42d66eccaa9f Mon Sep 17 00:00:00 2001 From: Samanyu Das Date: Sat, 21 Nov 2026 13:07:28 +1030 Subject: [PATCH 2/3] docs(security): limit the attribute reads to a password in the value attribute `getAttribute` and `toHaveAttribute` read the element's HTML attributes, not its live value, so they expose a hidden password field's value only when the `value` attribute holds it. Co-Authored-By: Claude Opus 5.5 --- docs/reference/security.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/reference/security.mdx b/docs/reference/security.mdx index 47dde8627c..3dab193b4d 100644 --- a/docs/reference/security.mdx +++ b/docs/reference/security.mdx @@ -265,9 +265,10 @@ Redaction matches strings. These pass through: embedding host passes the config or tests in memory, - on the web engine, a password field that a page script hides from e2e, for example by replacing `Element.prototype.matches`. e2e reads it as a plain - field: the observed screen shows its value, `inputValue` and - `getAttribute` return it, and a failed `toHaveValue` or `toHaveAttribute` - prints it. A configured secret's value is still ``. + field: the observed screen and `inputValue` show its value, and a failed + `toHaveValue` prints it. `getAttribute` and `toHaveAttribute` do the same + when the HTML `value` attribute holds it. A configured secret's value is + still ``. Screenshots still mask the field outside a closed shadow root, - a screenshot, including one sent to the model: it masks secure fields only, so a value the app shows elsewhere is in the image, From 9a5401a1f98dddfb7c329b19af5b748e83cc9951 Mon Sep 17 00:00:00 2001 From: Samanyu Das Date: Sat, 21 Nov 2026 13:16:25 +1030 Subject: [PATCH 3/3] docs: name secure fields where a read is denied, and what a hidden field leaks - The MCP `POLICY_DENIED` row and the e2e skill's writing-tests reference say a read of a secure field is denied, as `screen.mdx` does, since a password field a page hides from e2e is not one. - decision-models says the text model sees a hidden field's value and `type` can fill it, and that only `typeSecret` fills a configured secret. - The security reference names the limit in its model-input table link, and says a closed shadow root loses its screenshot mask only when the page also replaces `querySelectorAll`. Co-Authored-By: Claude Opus 5.5 --- docs/decision-models.mdx | 5 +++-- docs/reference/mcp.mdx | 2 +- docs/reference/security.mdx | 6 +++--- plugins/e2e/skills/e2e/references/writing-tests.md | 4 ++-- skills/e2e/references/writing-tests.md | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/decision-models.mdx b/docs/decision-models.mdx index a0ef1a4935..380189c3dc 100644 --- a/docs/decision-models.mdx +++ b/docs/decision-models.mdx @@ -133,8 +133,9 @@ project-relative paths the goal or params name, and the runner authorizes each one. Model output never becomes a selector, a URL, or a key. Password fields never reach the text model, unless a page script hides one -from e2e ([where redaction stops](/reference/security#where-redaction-stops)). -Only `typeSecret` fills a secret, from its declared handle. +from e2e. Then the text model sees its value, and `type` can fill it +([where redaction stops](/reference/security#where-redaction-stops)). +Only `typeSecret` fills a configured secret, from its declared handle. The text model also answers `waitFor` and `extract`. Instead of `textModel`, you can set `model` on the agents entry. With neither, the diff --git a/docs/reference/mcp.mdx b/docs/reference/mcp.mdx index 8fc119942f..ab72cd34a4 100644 --- a/docs/reference/mcp.mdx +++ b/docs/reference/mcp.mdx @@ -304,7 +304,7 @@ Left out: the built-in fixtures an engine contributes (`browser`, `device`), | `INVALID_ARGUMENT` | Code that doesn't parse or is outside the grammar, such as another name, a call it lacks, an assignment, or a function. The message quotes it with its line and column, and no statement runs. | | `INVALID_ARGUMENT` | A matcher that expects ``, since a test compares the real value. No statement runs. | | `POLICY_DENIED` | A secret `fill` into a field that fails the `type_secret` checks. Nothing is typed. | -| `POLICY_DENIED` | A read of a password field. | +| `POLICY_DENIED` | A read of a secure field, such as a password input. | | `POLICY_DENIED` | When the config declares a secret or credential, a locator found by part of a text: a regular expression, an `exact` other than `true`, or `hasText`. Find it by its exact text. No statement runs. | #### `test_lines` diff --git a/docs/reference/security.mdx b/docs/reference/security.mdx index 3dab193b4d..6b3bc11173 100644 --- a/docs/reference/security.mdx +++ b/docs/reference/security.mdx @@ -39,7 +39,7 @@ larger budget. [How agent steps work](/agent-steps) explains a step in full. | In the prompt | Form | | --- | --- | | Your instruction and params | Quoted inside `` and marked as data. A `Secret` param shows only its name and purpose. | -| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`, with [one limit](#where-redaction-stops). | +| The screen | An accessibility tree with node ids, roles, names, text, test ids, link targets, and states, cut at a size limit. No selectors. A link's query and fragment show only as `?…` and `#…`. Secure fields show as `value=`, unless [a page script hides one](#where-redaction-stops). | | The location | The current URL, redacted, without userinfo. A judgment gets it as a path on the app's origin and as the whole URL elsewhere, cut at a size limit. On a device, the app and screen title. | | A screenshot | When needed or requested, and only if the engine proves secure fields are masked. | | Prior steps | `agent.act` receives bounded records from the same test or serial group. Judgments use only the current screen, its location, the instruction and its params, and the agent's context. | @@ -268,8 +268,8 @@ Redaction matches strings. These pass through: field: the observed screen and `inputValue` show its value, and a failed `toHaveValue` prints it. `getAttribute` and `toHaveAttribute` do the same when the HTML `value` attribute holds it. A configured secret's value is - still ``. - Screenshots still mask the field outside a closed shadow root, + still ``. Screenshots still mask the field, unless it is in a + closed shadow root and the page also replaces `querySelectorAll`, - a screenshot, including one sent to the model: it masks secure fields only, so a value the app shows elsewhere is in the image, - video: it masks nothing and is labeled `redaction: "incomplete"`. A diff --git a/plugins/e2e/skills/e2e/references/writing-tests.md b/plugins/e2e/skills/e2e/references/writing-tests.md index 5a8e48481e..e2facd1217 100644 --- a/plugins/e2e/skills/e2e/references/writing-tests.md +++ b/plugins/e2e/skills/e2e/references/writing-tests.md @@ -345,7 +345,7 @@ drops out, `
` is a space); `toHaveText` reads the same. `isChecked()` on a node that cannot be checked (a button), and `inputValue()` on one that holds no value (a heading), throw `ACTION_FAILED`. `waitFor({ state?: 'attached' | 'detached' | 'visible' | 'hidden', timeout? })` waits within `actionTimeout`, else `LOCATOR_NOT_FOUND`. For a value that has to -settle use `expect`, not a read. Reading a password field's value or +settle use `expect`, not a read. Reading a secure field's value or attributes is `POLICY_DENIED`, as is `toHaveAttribute` on one, negated too. `screen.tree()` returns the whole screen as the agent reads it (one node @@ -401,7 +401,7 @@ typed; prefer it when the app already has a schema for the response. `toHaveText` compares the whole normalized text, `toContainText` a substring or RegExp, `toHaveValue` a form control's value as is, whitespace included -(it fails on a node with none); on a password field all three are +(it fails on a node with none); on a secure field all three are `POLICY_DENIED`, never a comparison against `''`. List forms: `toHaveText(['Alpha', /^Beta/])` needs exactly two matches with those texts in order; `toContainText(['Alpha', 'Beta'])` needs each entry in a distinct diff --git a/skills/e2e/references/writing-tests.md b/skills/e2e/references/writing-tests.md index 5a8e48481e..e2facd1217 100644 --- a/skills/e2e/references/writing-tests.md +++ b/skills/e2e/references/writing-tests.md @@ -345,7 +345,7 @@ drops out, `
` is a space); `toHaveText` reads the same. `isChecked()` on a node that cannot be checked (a button), and `inputValue()` on one that holds no value (a heading), throw `ACTION_FAILED`. `waitFor({ state?: 'attached' | 'detached' | 'visible' | 'hidden', timeout? })` waits within `actionTimeout`, else `LOCATOR_NOT_FOUND`. For a value that has to -settle use `expect`, not a read. Reading a password field's value or +settle use `expect`, not a read. Reading a secure field's value or attributes is `POLICY_DENIED`, as is `toHaveAttribute` on one, negated too. `screen.tree()` returns the whole screen as the agent reads it (one node @@ -401,7 +401,7 @@ typed; prefer it when the app already has a schema for the response. `toHaveText` compares the whole normalized text, `toContainText` a substring or RegExp, `toHaveValue` a form control's value as is, whitespace included -(it fails on a node with none); on a password field all three are +(it fails on a node with none); on a secure field all three are `POLICY_DENIED`, never a comparison against `''`. List forms: `toHaveText(['Alpha', /^Beta/])` needs exactly two matches with those texts in order; `toContainText(['Alpha', 'Beta'])` needs each entry in a distinct